Lines 1082-1088
bool iwl_pcie_check_hw_rf_kill(struct iwl_trans *trans)
Link Here
|
1082 |
report = test_bit(STATUS_RFKILL_OPMODE, &trans->status); |
1082 |
report = test_bit(STATUS_RFKILL_OPMODE, &trans->status); |
1083 |
|
1083 |
|
1084 |
if (prev != report) |
1084 |
if (prev != report) |
1085 |
iwl_trans_pcie_rf_kill(trans, report); |
1085 |
iwl_trans_pcie_rf_kill(trans, report, false); |
1086 |
|
1086 |
|
1087 |
return hw_rfkill; |
1087 |
return hw_rfkill; |
1088 |
} |
1088 |
} |
Lines 1237-1243
static void iwl_pcie_init_msix(struct iwl_trans_pcie *trans_pcie)
Link Here
|
1237 |
trans_pcie->hw_mask = trans_pcie->hw_init_mask; |
1237 |
trans_pcie->hw_mask = trans_pcie->hw_init_mask; |
1238 |
} |
1238 |
} |
1239 |
|
1239 |
|
1240 |
static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans) |
1240 |
static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool from_irq) |
1241 |
{ |
1241 |
{ |
1242 |
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
1242 |
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
1243 |
|
1243 |
|
Lines 1264-1270
static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans)
Link Here
|
1264 |
if (test_and_clear_bit(STATUS_DEVICE_ENABLED, &trans->status)) { |
1264 |
if (test_and_clear_bit(STATUS_DEVICE_ENABLED, &trans->status)) { |
1265 |
IWL_DEBUG_INFO(trans, |
1265 |
IWL_DEBUG_INFO(trans, |
1266 |
"DEVICE_ENABLED bit was set and is now cleared\n"); |
1266 |
"DEVICE_ENABLED bit was set and is now cleared\n"); |
1267 |
iwl_pcie_synchronize_irqs(trans); |
1267 |
if (!from_irq) |
|
|
1268 |
iwl_pcie_synchronize_irqs(trans); |
1268 |
iwl_pcie_rx_napi_sync(trans); |
1269 |
iwl_pcie_rx_napi_sync(trans); |
1269 |
iwl_pcie_tx_stop(trans); |
1270 |
iwl_pcie_tx_stop(trans); |
1270 |
iwl_pcie_rx_stop(trans); |
1271 |
iwl_pcie_rx_stop(trans); |
Lines 1454-1460
void iwl_trans_pcie_handle_stop_rfkill(struct iwl_trans *trans,
Link Here
|
1454 |
clear_bit(STATUS_RFKILL_OPMODE, &trans->status); |
1455 |
clear_bit(STATUS_RFKILL_OPMODE, &trans->status); |
1455 |
} |
1456 |
} |
1456 |
if (hw_rfkill != was_in_rfkill) |
1457 |
if (hw_rfkill != was_in_rfkill) |
1457 |
iwl_trans_pcie_rf_kill(trans, hw_rfkill); |
1458 |
iwl_trans_pcie_rf_kill(trans, hw_rfkill, false); |
1458 |
} |
1459 |
} |
1459 |
|
1460 |
|
1460 |
static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) |
1461 |
static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) |
Lines 1469-1480
static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
Link Here
|
1469 |
mutex_lock(&trans_pcie->mutex); |
1470 |
mutex_lock(&trans_pcie->mutex); |
1470 |
trans_pcie->opmode_down = true; |
1471 |
trans_pcie->opmode_down = true; |
1471 |
was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status); |
1472 |
was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status); |
1472 |
_iwl_trans_pcie_stop_device(trans); |
1473 |
_iwl_trans_pcie_stop_device(trans, false); |
1473 |
iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill); |
1474 |
iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill); |
1474 |
mutex_unlock(&trans_pcie->mutex); |
1475 |
mutex_unlock(&trans_pcie->mutex); |
1475 |
} |
1476 |
} |
1476 |
|
1477 |
|
1477 |
void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state) |
1478 |
void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state, bool from_irq) |
1478 |
{ |
1479 |
{ |
1479 |
struct iwl_trans_pcie __maybe_unused *trans_pcie = |
1480 |
struct iwl_trans_pcie __maybe_unused *trans_pcie = |
1480 |
IWL_TRANS_GET_PCIE_TRANS(trans); |
1481 |
IWL_TRANS_GET_PCIE_TRANS(trans); |
Lines 1485-1493
void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state)
Link Here
|
1485 |
state ? "disabled" : "enabled"); |
1486 |
state ? "disabled" : "enabled"); |
1486 |
if (iwl_op_mode_hw_rf_kill(trans->op_mode, state)) { |
1487 |
if (iwl_op_mode_hw_rf_kill(trans->op_mode, state)) { |
1487 |
if (trans->trans_cfg->gen2) |
1488 |
if (trans->trans_cfg->gen2) |
1488 |
_iwl_trans_pcie_gen2_stop_device(trans); |
1489 |
_iwl_trans_pcie_gen2_stop_device(trans, from_irq); |
1489 |
else |
1490 |
else |
1490 |
_iwl_trans_pcie_stop_device(trans); |
1491 |
_iwl_trans_pcie_stop_device(trans, from_irq); |
1491 |
} |
1492 |
} |
1492 |
} |
1493 |
} |
1493 |
|
1494 |
|
Lines 2887-2893
static ssize_t iwl_dbgfs_rfkill_write(struct file *file,
Link Here
|
2887 |
IWL_WARN(trans, "changing debug rfkill %d->%d\n", |
2888 |
IWL_WARN(trans, "changing debug rfkill %d->%d\n", |
2888 |
trans_pcie->debug_rfkill, new_value); |
2889 |
trans_pcie->debug_rfkill, new_value); |
2889 |
trans_pcie->debug_rfkill = new_value; |
2890 |
trans_pcie->debug_rfkill = new_value; |
2890 |
iwl_pcie_handle_rfkill_irq(trans); |
2891 |
iwl_pcie_handle_rfkill_irq(trans, false); |
2891 |
|
2892 |
|
2892 |
return count; |
2893 |
return count; |
2893 |
} |
2894 |
} |