* ixgbe_stop_adapter_generic - Generic stop Tx/Rx units * @hw: pointer to hardware structure * * Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts, * disables transmit and receive units. The adapter_stopped flag is used by * the shared code and drivers to determine if the adapter is in a stopped * state and should not touch the hardware. **/
| 1069 | * state and should not touch the hardware. |
| 1070 | **/ |
| 1071 | s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw) |
| 1072 | { |
| 1073 | u32 reg_val; |
| 1074 | u16 i; |
| 1075 | |
| 1076 | DEBUGFUNC("ixgbe_stop_adapter_generic"); |
| 1077 | |
| 1078 | /* |
| 1079 | * Set the adapter_stopped flag so other driver functions stop touching |
| 1080 | * the hardware |
| 1081 | */ |
| 1082 | hw->adapter_stopped = true; |
| 1083 | |
| 1084 | /* Disable the receive unit */ |
| 1085 | ixgbe_disable_rx(hw); |
| 1086 | |
| 1087 | /* Clear interrupt mask to stop interrupts from being generated */ |
| 1088 | IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK); |
| 1089 | |
| 1090 | /* Clear any pending interrupts, flush previous writes */ |
| 1091 | IXGBE_READ_REG(hw, IXGBE_EICR); |
| 1092 | |
| 1093 | /* Disable the transmit unit. Each queue must be disabled. */ |
| 1094 | for (i = 0; i < hw->mac.max_tx_queues; i++) |
| 1095 | IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), IXGBE_TXDCTL_SWFLSH); |
| 1096 | |
| 1097 | /* Disable the receive unit by stopping each queue */ |
| 1098 | for (i = 0; i < hw->mac.max_rx_queues; i++) { |
| 1099 | reg_val = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); |
| 1100 | reg_val &= ~IXGBE_RXDCTL_ENABLE; |
| 1101 | reg_val |= IXGBE_RXDCTL_SWFLSH; |
| 1102 | IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), reg_val); |
| 1103 | } |
| 1104 | |
| 1105 | /* flush all queues disables */ |
| 1106 | IXGBE_WRITE_FLUSH(hw); |
| 1107 | msec_delay(2); |
| 1108 | |
| 1109 | /* |
| 1110 | * Prevent the PCI-E bus from hanging by disabling PCI-E master |
| 1111 | * access and verify no pending requests |
| 1112 | */ |
| 1113 | return ixgbe_disable_pcie_master(hw); |
| 1114 | } |
| 1115 | |
| 1116 | /** |
| 1117 | * ixgbe_init_led_link_act_generic - Store the LED index link/activity. |
nothing calls this directly
no test coverage detected