* txgbe_start_hw - Prepare hardware for Tx/Rx * @hw: pointer to hardware structure * * Starts the hardware by filling the bus info structure and media type, clears * all on chip counters, initializes receive address registers, multicast * table, VLAN filter table, calls routine to set up link and flow control * settings, and leaves transmit and receive units disabled and uninitialized
| 200 | * settings, and leaves transmit and receive units disabled and uninitialized |
| 201 | **/ |
| 202 | s32 txgbe_start_hw(struct txgbe_hw *hw) |
| 203 | { |
| 204 | s32 err; |
| 205 | u16 device_caps; |
| 206 | |
| 207 | /* Set the media type */ |
| 208 | hw->phy.media_type = hw->phy.get_media_type(hw); |
| 209 | |
| 210 | /* Clear the VLAN filter table */ |
| 211 | hw->mac.clear_vfta(hw); |
| 212 | |
| 213 | /* Clear statistics registers */ |
| 214 | hw->mac.clear_hw_cntrs(hw); |
| 215 | |
| 216 | /* Setup flow control */ |
| 217 | err = txgbe_setup_fc(hw); |
| 218 | if (err != 0 && err != TXGBE_NOT_IMPLEMENTED) { |
| 219 | DEBUGOUT("Flow control setup failed, returning %d", err); |
| 220 | return err; |
| 221 | } |
| 222 | |
| 223 | /* Cache bit indicating need for crosstalk fix */ |
| 224 | switch (hw->mac.type) { |
| 225 | case txgbe_mac_raptor: |
| 226 | hw->mac.get_device_caps(hw, &device_caps); |
| 227 | if (device_caps & TXGBE_DEVICE_CAPS_NO_CROSSTALK_WR) |
| 228 | hw->need_crosstalk_fix = false; |
| 229 | else |
| 230 | hw->need_crosstalk_fix = true; |
| 231 | break; |
| 232 | default: |
| 233 | hw->need_crosstalk_fix = false; |
| 234 | break; |
| 235 | } |
| 236 | |
| 237 | /* Clear adapter stopped flag */ |
| 238 | hw->adapter_stopped = false; |
| 239 | |
| 240 | return 0; |
| 241 | } |
| 242 | |
| 243 | /** |
| 244 | * txgbe_start_hw_gen2 - Init sequence for common device family |
no test coverage detected