diff options
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r-- | drivers/net/cxgb3/ael1002.c | 24 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 6 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 6 | ||||
-rw-r--r-- | drivers/net/cxgb3/mc5.c | 2 | ||||
-rw-r--r-- | drivers/net/cxgb3/t3_hw.c | 4 |
5 files changed, 20 insertions, 22 deletions
diff --git a/drivers/net/cxgb3/ael1002.c b/drivers/net/cxgb3/ael1002.c index 35cd36729155..2028da95afa1 100644 --- a/drivers/net/cxgb3/ael1002.c +++ b/drivers/net/cxgb3/ael1002.c | |||
@@ -292,7 +292,7 @@ unknown: | |||
292 | */ | 292 | */ |
293 | static int ael2005_setup_sr_edc(struct cphy *phy) | 293 | static int ael2005_setup_sr_edc(struct cphy *phy) |
294 | { | 294 | { |
295 | static struct reg_val regs[] = { | 295 | static const struct reg_val regs[] = { |
296 | { MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x181 }, | 296 | { MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x181 }, |
297 | { MDIO_MMD_PMAPMD, 0xc010, 0xffff, 0x448a }, | 297 | { MDIO_MMD_PMAPMD, 0xc010, 0xffff, 0x448a }, |
298 | { MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5200 }, | 298 | { MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5200 }, |
@@ -324,11 +324,11 @@ static int ael2005_setup_sr_edc(struct cphy *phy) | |||
324 | 324 | ||
325 | static int ael2005_setup_twinax_edc(struct cphy *phy, int modtype) | 325 | static int ael2005_setup_twinax_edc(struct cphy *phy, int modtype) |
326 | { | 326 | { |
327 | static struct reg_val regs[] = { | 327 | static const struct reg_val regs[] = { |
328 | { MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5a00 }, | 328 | { MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5a00 }, |
329 | { 0, 0, 0, 0 } | 329 | { 0, 0, 0, 0 } |
330 | }; | 330 | }; |
331 | static struct reg_val preemphasis[] = { | 331 | static const struct reg_val preemphasis[] = { |
332 | { MDIO_MMD_PMAPMD, 0xc014, 0xffff, 0xfe16 }, | 332 | { MDIO_MMD_PMAPMD, 0xc014, 0xffff, 0xfe16 }, |
333 | { MDIO_MMD_PMAPMD, 0xc015, 0xffff, 0xa000 }, | 333 | { MDIO_MMD_PMAPMD, 0xc015, 0xffff, 0xa000 }, |
334 | { 0, 0, 0, 0 } | 334 | { 0, 0, 0, 0 } |
@@ -393,7 +393,7 @@ static int ael2005_intr_clear(struct cphy *phy) | |||
393 | 393 | ||
394 | static int ael2005_reset(struct cphy *phy, int wait) | 394 | static int ael2005_reset(struct cphy *phy, int wait) |
395 | { | 395 | { |
396 | static struct reg_val regs0[] = { | 396 | static const struct reg_val regs0[] = { |
397 | { MDIO_MMD_PMAPMD, 0xc001, 0, 1 << 5 }, | 397 | { MDIO_MMD_PMAPMD, 0xc001, 0, 1 << 5 }, |
398 | { MDIO_MMD_PMAPMD, 0xc017, 0, 1 << 5 }, | 398 | { MDIO_MMD_PMAPMD, 0xc017, 0, 1 << 5 }, |
399 | { MDIO_MMD_PMAPMD, 0xc013, 0xffff, 0xf341 }, | 399 | { MDIO_MMD_PMAPMD, 0xc013, 0xffff, 0xf341 }, |
@@ -403,7 +403,7 @@ static int ael2005_reset(struct cphy *phy, int wait) | |||
403 | { MDIO_MMD_PMAPMD, 0xc210, 0xffff, 0 }, | 403 | { MDIO_MMD_PMAPMD, 0xc210, 0xffff, 0 }, |
404 | { 0, 0, 0, 0 } | 404 | { 0, 0, 0, 0 } |
405 | }; | 405 | }; |
406 | static struct reg_val regs1[] = { | 406 | static const struct reg_val regs1[] = { |
407 | { MDIO_MMD_PMAPMD, 0xca00, 0xffff, 0x0080 }, | 407 | { MDIO_MMD_PMAPMD, 0xca00, 0xffff, 0x0080 }, |
408 | { MDIO_MMD_PMAPMD, 0xca12, 0xffff, 0 }, | 408 | { MDIO_MMD_PMAPMD, 0xca12, 0xffff, 0 }, |
409 | { 0, 0, 0, 0 } | 409 | { 0, 0, 0, 0 } |
@@ -522,7 +522,7 @@ int t3_ael2005_phy_prep(struct cphy *phy, struct adapter *adapter, | |||
522 | */ | 522 | */ |
523 | static int ael2020_setup_sr_edc(struct cphy *phy) | 523 | static int ael2020_setup_sr_edc(struct cphy *phy) |
524 | { | 524 | { |
525 | static struct reg_val regs[] = { | 525 | static const struct reg_val regs[] = { |
526 | /* set CDR offset to 10 */ | 526 | /* set CDR offset to 10 */ |
527 | { MDIO_MMD_PMAPMD, 0xcc01, 0xffff, 0x488a }, | 527 | { MDIO_MMD_PMAPMD, 0xcc01, 0xffff, 0x488a }, |
528 | 528 | ||
@@ -551,20 +551,20 @@ static int ael2020_setup_sr_edc(struct cphy *phy) | |||
551 | static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype) | 551 | static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype) |
552 | { | 552 | { |
553 | /* set uC to 40MHz */ | 553 | /* set uC to 40MHz */ |
554 | static struct reg_val uCclock40MHz[] = { | 554 | static const struct reg_val uCclock40MHz[] = { |
555 | { MDIO_MMD_PMAPMD, 0xff28, 0xffff, 0x4001 }, | 555 | { MDIO_MMD_PMAPMD, 0xff28, 0xffff, 0x4001 }, |
556 | { MDIO_MMD_PMAPMD, 0xff2a, 0xffff, 0x0002 }, | 556 | { MDIO_MMD_PMAPMD, 0xff2a, 0xffff, 0x0002 }, |
557 | { 0, 0, 0, 0 } | 557 | { 0, 0, 0, 0 } |
558 | }; | 558 | }; |
559 | 559 | ||
560 | /* activate uC clock */ | 560 | /* activate uC clock */ |
561 | static struct reg_val uCclockActivate[] = { | 561 | static const struct reg_val uCclockActivate[] = { |
562 | { MDIO_MMD_PMAPMD, 0xd000, 0xffff, 0x5200 }, | 562 | { MDIO_MMD_PMAPMD, 0xd000, 0xffff, 0x5200 }, |
563 | { 0, 0, 0, 0 } | 563 | { 0, 0, 0, 0 } |
564 | }; | 564 | }; |
565 | 565 | ||
566 | /* set PC to start of SRAM and activate uC */ | 566 | /* set PC to start of SRAM and activate uC */ |
567 | static struct reg_val uCactivate[] = { | 567 | static const struct reg_val uCactivate[] = { |
568 | { MDIO_MMD_PMAPMD, 0xd080, 0xffff, 0x0100 }, | 568 | { MDIO_MMD_PMAPMD, 0xd080, 0xffff, 0x0100 }, |
569 | { MDIO_MMD_PMAPMD, 0xd092, 0xffff, 0x0000 }, | 569 | { MDIO_MMD_PMAPMD, 0xd092, 0xffff, 0x0000 }, |
570 | { 0, 0, 0, 0 } | 570 | { 0, 0, 0, 0 } |
@@ -624,7 +624,7 @@ static int ael2020_get_module_type(struct cphy *phy, int delay_ms) | |||
624 | */ | 624 | */ |
625 | static int ael2020_intr_enable(struct cphy *phy) | 625 | static int ael2020_intr_enable(struct cphy *phy) |
626 | { | 626 | { |
627 | struct reg_val regs[] = { | 627 | static const struct reg_val regs[] = { |
628 | /* output Module's Loss Of Signal (LOS) to LED */ | 628 | /* output Module's Loss Of Signal (LOS) to LED */ |
629 | { MDIO_MMD_PMAPMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT, | 629 | { MDIO_MMD_PMAPMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT, |
630 | 0xffff, 0x4 }, | 630 | 0xffff, 0x4 }, |
@@ -664,7 +664,7 @@ static int ael2020_intr_enable(struct cphy *phy) | |||
664 | */ | 664 | */ |
665 | static int ael2020_intr_disable(struct cphy *phy) | 665 | static int ael2020_intr_disable(struct cphy *phy) |
666 | { | 666 | { |
667 | struct reg_val regs[] = { | 667 | static const struct reg_val regs[] = { |
668 | /* reset "link status" LED to "off" */ | 668 | /* reset "link status" LED to "off" */ |
669 | { MDIO_MMD_PMAPMD, AEL2020_GPIO_CTRL, | 669 | { MDIO_MMD_PMAPMD, AEL2020_GPIO_CTRL, |
670 | 0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) }, | 670 | 0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) }, |
@@ -701,7 +701,7 @@ static int ael2020_intr_clear(struct cphy *phy) | |||
701 | return err ? err : t3_phy_lasi_intr_clear(phy); | 701 | return err ? err : t3_phy_lasi_intr_clear(phy); |
702 | } | 702 | } |
703 | 703 | ||
704 | static struct reg_val ael2020_reset_regs[] = { | 704 | static const struct reg_val ael2020_reset_regs[] = { |
705 | /* Erratum #2: CDRLOL asserted, causing PMA link down status */ | 705 | /* Erratum #2: CDRLOL asserted, causing PMA link down status */ |
706 | { MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x3101 }, | 706 | { MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x3101 }, |
707 | 707 | ||
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 046d846c652d..4d538a4e9d55 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -1359,6 +1359,7 @@ out: | |||
1359 | static int offload_close(struct t3cdev *tdev) | 1359 | static int offload_close(struct t3cdev *tdev) |
1360 | { | 1360 | { |
1361 | struct adapter *adapter = tdev2adap(tdev); | 1361 | struct adapter *adapter = tdev2adap(tdev); |
1362 | struct t3c_data *td = T3C_DATA(tdev); | ||
1362 | 1363 | ||
1363 | if (!test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) | 1364 | if (!test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) |
1364 | return 0; | 1365 | return 0; |
@@ -1369,7 +1370,7 @@ static int offload_close(struct t3cdev *tdev) | |||
1369 | sysfs_remove_group(&tdev->lldev->dev.kobj, &offload_attr_group); | 1370 | sysfs_remove_group(&tdev->lldev->dev.kobj, &offload_attr_group); |
1370 | 1371 | ||
1371 | /* Flush work scheduled while releasing TIDs */ | 1372 | /* Flush work scheduled while releasing TIDs */ |
1372 | flush_scheduled_work(); | 1373 | flush_work_sync(&td->tid_release_task); |
1373 | 1374 | ||
1374 | tdev->lldev = NULL; | 1375 | tdev->lldev = NULL; |
1375 | cxgb3_set_dummy_ops(tdev); | 1376 | cxgb3_set_dummy_ops(tdev); |
@@ -3006,12 +3007,11 @@ static pci_ers_result_t t3_io_error_detected(struct pci_dev *pdev, | |||
3006 | pci_channel_state_t state) | 3007 | pci_channel_state_t state) |
3007 | { | 3008 | { |
3008 | struct adapter *adapter = pci_get_drvdata(pdev); | 3009 | struct adapter *adapter = pci_get_drvdata(pdev); |
3009 | int ret; | ||
3010 | 3010 | ||
3011 | if (state == pci_channel_io_perm_failure) | 3011 | if (state == pci_channel_io_perm_failure) |
3012 | return PCI_ERS_RESULT_DISCONNECT; | 3012 | return PCI_ERS_RESULT_DISCONNECT; |
3013 | 3013 | ||
3014 | ret = t3_adapter_error(adapter, 0, 0); | 3014 | t3_adapter_error(adapter, 0, 0); |
3015 | 3015 | ||
3016 | /* Request a slot reset. */ | 3016 | /* Request a slot reset. */ |
3017 | return PCI_ERS_RESULT_NEED_RESET; | 3017 | return PCI_ERS_RESULT_NEED_RESET; |
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index bcf07532953d..ef02aa68c926 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -1164,12 +1164,10 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new) | |||
1164 | */ | 1164 | */ |
1165 | void *cxgb_alloc_mem(unsigned long size) | 1165 | void *cxgb_alloc_mem(unsigned long size) |
1166 | { | 1166 | { |
1167 | void *p = kmalloc(size, GFP_KERNEL); | 1167 | void *p = kzalloc(size, GFP_KERNEL); |
1168 | 1168 | ||
1169 | if (!p) | 1169 | if (!p) |
1170 | p = vmalloc(size); | 1170 | p = vzalloc(size); |
1171 | if (p) | ||
1172 | memset(p, 0, size); | ||
1173 | return p; | 1171 | return p; |
1174 | } | 1172 | } |
1175 | 1173 | ||
diff --git a/drivers/net/cxgb3/mc5.c b/drivers/net/cxgb3/mc5.c index a8766fb2f9ab..e13b7fe9d082 100644 --- a/drivers/net/cxgb3/mc5.c +++ b/drivers/net/cxgb3/mc5.c | |||
@@ -318,7 +318,7 @@ static void mc5_dbgi_mode_disable(const struct mc5 *mc5) | |||
318 | 318 | ||
319 | /* | 319 | /* |
320 | * Initialization that requires the OS and protocol layers to already | 320 | * Initialization that requires the OS and protocol layers to already |
321 | * be intialized goes here. | 321 | * be initialized goes here. |
322 | */ | 322 | */ |
323 | int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, | 323 | int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, |
324 | unsigned int nroutes) | 324 | unsigned int nroutes) |
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index 3a6adf0b3e9d..d55db6b38e7b 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
@@ -607,7 +607,7 @@ struct t3_vpd { | |||
607 | * | 607 | * |
608 | * Read a 32-bit word from a location in VPD EEPROM using the card's PCI | 608 | * Read a 32-bit word from a location in VPD EEPROM using the card's PCI |
609 | * VPD ROM capability. A zero is written to the flag bit when the | 609 | * VPD ROM capability. A zero is written to the flag bit when the |
610 | * addres is written to the control register. The hardware device will | 610 | * address is written to the control register. The hardware device will |
611 | * set the flag to 1 when 4 bytes have been read into the data register. | 611 | * set the flag to 1 when 4 bytes have been read into the data register. |
612 | */ | 612 | */ |
613 | int t3_seeprom_read(struct adapter *adapter, u32 addr, __le32 *data) | 613 | int t3_seeprom_read(struct adapter *adapter, u32 addr, __le32 *data) |
@@ -1562,7 +1562,7 @@ static void tp_intr_handler(struct adapter *adapter) | |||
1562 | {0} | 1562 | {0} |
1563 | }; | 1563 | }; |
1564 | 1564 | ||
1565 | static struct intr_info tp_intr_info_t3c[] = { | 1565 | static const struct intr_info tp_intr_info_t3c[] = { |
1566 | {0x1fffffff, "TP parity error", -1, 1}, | 1566 | {0x1fffffff, "TP parity error", -1, 1}, |
1567 | {F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1}, | 1567 | {F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1}, |
1568 | {F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1}, | 1568 | {F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1}, |