~ubuntu-branches/ubuntu/trusty/linux-linaro-omap/trusty

« back to all changes in this revision

Viewing changes to drivers/net/ixgbe/ixgbe_82598.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-57i0gl3v99b3lkfg
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#define IXGBE_82598_RAR_ENTRIES   16
38
38
#define IXGBE_82598_MC_TBL_SIZE  128
39
39
#define IXGBE_82598_VFT_TBL_SIZE 128
 
40
#define IXGBE_82598_RX_PB_SIZE   512
40
41
 
41
42
static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw,
42
43
                                         ixgbe_link_speed speed,
197
198
 *  @hw: pointer to hardware structure
198
199
 *
199
200
 *  Starts the hardware using the generic start_hw function.
200
 
 *  Then set pcie completion timeout
 
201
 *  Disables relaxed ordering Then set pcie completion timeout
 
202
 *
201
203
 **/
202
204
static s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw)
203
205
{
 
206
        u32 regval;
 
207
        u32 i;
204
208
        s32 ret_val = 0;
205
209
 
206
210
        ret_val = ixgbe_start_hw_generic(hw);
207
211
 
 
212
        /* Disable relaxed ordering */
 
213
        for (i = 0; ((i < hw->mac.max_tx_queues) &&
 
214
             (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) {
 
215
                regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i));
 
216
                regval &= ~IXGBE_DCA_TXCTRL_TX_WB_RO_EN;
 
217
                IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), regval);
 
218
        }
 
219
 
 
220
        for (i = 0; ((i < hw->mac.max_rx_queues) &&
 
221
             (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) {
 
222
                regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i));
 
223
                regval &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN |
 
224
                            IXGBE_DCA_RXCTRL_DESC_HSRO_EN);
 
225
                IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval);
 
226
        }
 
227
 
 
228
        hw->mac.rx_pb_size = IXGBE_82598_RX_PB_SIZE;
 
229
 
208
230
        /* set the completion timeout for interface */
209
231
        if (ret_val == 0)
210
232
                ixgbe_set_pcie_completion_timeout(hw);
1064
1086
                        sfp_stat = sfp_stat & IXGBE_I2C_EEPROM_STATUS_MASK;
1065
1087
                        if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS)
1066
1088
                                break;
1067
 
                        msleep(10);
 
1089
                        usleep_range(10000, 20000);
1068
1090
                }
1069
1091
 
1070
1092
                if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_PASS) {
1188
1210
        return physical_layer;
1189
1211
}
1190
1212
 
 
1213
/**
 
1214
 *  ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple
 
1215
 *  port devices.
 
1216
 *  @hw: pointer to the HW structure
 
1217
 *
 
1218
 *  Calls common function and corrects issue with some single port devices
 
1219
 *  that enable LAN1 but not LAN0.
 
1220
 **/
 
1221
static void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw)
 
1222
{
 
1223
        struct ixgbe_bus_info *bus = &hw->bus;
 
1224
        u16 pci_gen = 0;
 
1225
        u16 pci_ctrl2 = 0;
 
1226
 
 
1227
        ixgbe_set_lan_id_multi_port_pcie(hw);
 
1228
 
 
1229
        /* check if LAN0 is disabled */
 
1230
        hw->eeprom.ops.read(hw, IXGBE_PCIE_GENERAL_PTR, &pci_gen);
 
1231
        if ((pci_gen != 0) && (pci_gen != 0xFFFF)) {
 
1232
 
 
1233
                hw->eeprom.ops.read(hw, pci_gen + IXGBE_PCIE_CTRL2, &pci_ctrl2);
 
1234
 
 
1235
                /* if LAN0 is completely disabled force function to 0 */
 
1236
                if ((pci_ctrl2 & IXGBE_PCIE_CTRL2_LAN_DISABLE) &&
 
1237
                    !(pci_ctrl2 & IXGBE_PCIE_CTRL2_DISABLE_SELECT) &&
 
1238
                    !(pci_ctrl2 & IXGBE_PCIE_CTRL2_DUMMY_ENABLE)) {
 
1239
 
 
1240
                        bus->func = 0;
 
1241
                }
 
1242
        }
 
1243
}
 
1244
 
1191
1245
static struct ixgbe_mac_operations mac_ops_82598 = {
1192
1246
        .init_hw                = &ixgbe_init_hw_generic,
1193
1247
        .reset_hw               = &ixgbe_reset_hw_82598,
1199
1253
        .get_mac_addr           = &ixgbe_get_mac_addr_generic,
1200
1254
        .stop_adapter           = &ixgbe_stop_adapter_generic,
1201
1255
        .get_bus_info           = &ixgbe_get_bus_info_generic,
1202
 
        .set_lan_id             = &ixgbe_set_lan_id_multi_port_pcie,
 
1256
        .set_lan_id             = &ixgbe_set_lan_id_multi_port_pcie_82598,
1203
1257
        .read_analog_reg8       = &ixgbe_read_analog_reg8_82598,
1204
1258
        .write_analog_reg8      = &ixgbe_write_analog_reg8_82598,
1205
1259
        .setup_link             = &ixgbe_setup_mac_link_82598,
1227
1281
static struct ixgbe_eeprom_operations eeprom_ops_82598 = {
1228
1282
        .init_params            = &ixgbe_init_eeprom_params_generic,
1229
1283
        .read                   = &ixgbe_read_eerd_generic,
 
1284
        .read_buffer            = &ixgbe_read_eerd_buffer_generic,
1230
1285
        .calc_checksum          = &ixgbe_calc_eeprom_checksum_generic,
1231
1286
        .validate_checksum      = &ixgbe_validate_eeprom_checksum_generic,
1232
1287
        .update_checksum        = &ixgbe_update_eeprom_checksum_generic,