diff options
Diffstat (limited to 'drivers/net')
61 files changed, 791 insertions, 481 deletions
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 3b1ff6148702..693d8ffe4653 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c | |||
@@ -1405,10 +1405,10 @@ static int at91_can_remove(struct platform_device *pdev) | |||
1405 | 1405 | ||
1406 | static const struct platform_device_id at91_can_id_table[] = { | 1406 | static const struct platform_device_id at91_can_id_table[] = { |
1407 | { | 1407 | { |
1408 | .name = "at91_can", | 1408 | .name = "at91sam9x5_can", |
1409 | .driver_data = (kernel_ulong_t)&at91_at91sam9x5_data, | 1409 | .driver_data = (kernel_ulong_t)&at91_at91sam9x5_data, |
1410 | }, { | 1410 | }, { |
1411 | .name = "at91sam9x5_can", | 1411 | .name = "at91_can", |
1412 | .driver_data = (kernel_ulong_t)&at91_at91sam9263_data, | 1412 | .driver_data = (kernel_ulong_t)&at91_at91sam9263_data, |
1413 | }, { | 1413 | }, { |
1414 | /* sentinel */ | 1414 | /* sentinel */ |
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index f9cba4123c66..1870c4731a57 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -705,14 +705,14 @@ static size_t can_get_size(const struct net_device *dev) | |||
705 | size_t size; | 705 | size_t size; |
706 | 706 | ||
707 | size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ | 707 | size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ |
708 | size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */ | 708 | size += nla_total_size(sizeof(struct can_ctrlmode)); /* IFLA_CAN_CTRLMODE */ |
709 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ | 709 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ |
710 | size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */ | 710 | size += nla_total_size(sizeof(struct can_bittiming)); /* IFLA_CAN_BITTIMING */ |
711 | size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */ | 711 | size += nla_total_size(sizeof(struct can_clock)); /* IFLA_CAN_CLOCK */ |
712 | if (priv->do_get_berr_counter) /* IFLA_CAN_BERR_COUNTER */ | 712 | if (priv->do_get_berr_counter) /* IFLA_CAN_BERR_COUNTER */ |
713 | size += sizeof(struct can_berr_counter); | 713 | size += nla_total_size(sizeof(struct can_berr_counter)); |
714 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ | 714 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ |
715 | size += sizeof(struct can_bittiming_const); | 715 | size += nla_total_size(sizeof(struct can_bittiming_const)); |
716 | 716 | ||
717 | return size; | 717 | return size; |
718 | } | 718 | } |
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 3f21142138b7..8f5ce747feb5 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -62,7 +62,7 @@ | |||
62 | #define FLEXCAN_MCR_BCC BIT(16) | 62 | #define FLEXCAN_MCR_BCC BIT(16) |
63 | #define FLEXCAN_MCR_LPRIO_EN BIT(13) | 63 | #define FLEXCAN_MCR_LPRIO_EN BIT(13) |
64 | #define FLEXCAN_MCR_AEN BIT(12) | 64 | #define FLEXCAN_MCR_AEN BIT(12) |
65 | #define FLEXCAN_MCR_MAXMB(x) ((x) & 0xf) | 65 | #define FLEXCAN_MCR_MAXMB(x) ((x) & 0x1f) |
66 | #define FLEXCAN_MCR_IDAM_A (0 << 8) | 66 | #define FLEXCAN_MCR_IDAM_A (0 << 8) |
67 | #define FLEXCAN_MCR_IDAM_B (1 << 8) | 67 | #define FLEXCAN_MCR_IDAM_B (1 << 8) |
68 | #define FLEXCAN_MCR_IDAM_C (2 << 8) | 68 | #define FLEXCAN_MCR_IDAM_C (2 << 8) |
@@ -735,9 +735,11 @@ static int flexcan_chip_start(struct net_device *dev) | |||
735 | * | 735 | * |
736 | */ | 736 | */ |
737 | reg_mcr = flexcan_read(®s->mcr); | 737 | reg_mcr = flexcan_read(®s->mcr); |
738 | reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); | ||
738 | reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT | | 739 | reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT | |
739 | FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | | 740 | FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | |
740 | FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS; | 741 | FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS | |
742 | FLEXCAN_MCR_MAXMB(FLEXCAN_TX_BUF_ID); | ||
741 | netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); | 743 | netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); |
742 | flexcan_write(reg_mcr, ®s->mcr); | 744 | flexcan_write(reg_mcr, ®s->mcr); |
743 | 745 | ||
@@ -771,6 +773,10 @@ static int flexcan_chip_start(struct net_device *dev) | |||
771 | netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); | 773 | netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); |
772 | flexcan_write(reg_ctrl, ®s->ctrl); | 774 | flexcan_write(reg_ctrl, ®s->ctrl); |
773 | 775 | ||
776 | /* Abort any pending TX, mark Mailbox as INACTIVE */ | ||
777 | flexcan_write(FLEXCAN_MB_CNT_CODE(0x4), | ||
778 | ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); | ||
779 | |||
774 | /* acceptance mask/acceptance code (accept everything) */ | 780 | /* acceptance mask/acceptance code (accept everything) */ |
775 | flexcan_write(0x0, ®s->rxgmask); | 781 | flexcan_write(0x0, ®s->rxgmask); |
776 | flexcan_write(0x0, ®s->rx14mask); | 782 | flexcan_write(0x0, ®s->rx14mask); |
@@ -979,9 +985,9 @@ static void unregister_flexcandev(struct net_device *dev) | |||
979 | } | 985 | } |
980 | 986 | ||
981 | static const struct of_device_id flexcan_of_match[] = { | 987 | static const struct of_device_id flexcan_of_match[] = { |
982 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, | ||
983 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, | ||
984 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, | 988 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, |
989 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, | ||
990 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, | ||
985 | { /* sentinel */ }, | 991 | { /* sentinel */ }, |
986 | }; | 992 | }; |
987 | MODULE_DEVICE_TABLE(of, flexcan_of_match); | 993 | MODULE_DEVICE_TABLE(of, flexcan_of_match); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index 97b3d32a98bd..c5e375ddd6c0 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -1197,8 +1197,9 @@ union cdu_context { | |||
1197 | /* TM (timers) host DB constants */ | 1197 | /* TM (timers) host DB constants */ |
1198 | #define TM_ILT_PAGE_SZ_HW 0 | 1198 | #define TM_ILT_PAGE_SZ_HW 0 |
1199 | #define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW) /* 4K */ | 1199 | #define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW) /* 4K */ |
1200 | /* #define TM_CONN_NUM (CNIC_STARTING_CID+CNIC_ISCSI_CXT_MAX) */ | 1200 | #define TM_CONN_NUM (BNX2X_FIRST_VF_CID + \ |
1201 | #define TM_CONN_NUM 1024 | 1201 | BNX2X_VF_CIDS + \ |
1202 | CNIC_ISCSI_CID_MAX) | ||
1202 | #define TM_ILT_SZ (8 * TM_CONN_NUM) | 1203 | #define TM_ILT_SZ (8 * TM_CONN_NUM) |
1203 | #define TM_ILT_LINES DIV_ROUND_UP(TM_ILT_SZ, TM_ILT_PAGE_SZ) | 1204 | #define TM_ILT_LINES DIV_ROUND_UP(TM_ILT_SZ, TM_ILT_PAGE_SZ) |
1204 | 1205 | ||
@@ -1527,7 +1528,6 @@ struct bnx2x { | |||
1527 | #define PCI_32BIT_FLAG (1 << 1) | 1528 | #define PCI_32BIT_FLAG (1 << 1) |
1528 | #define ONE_PORT_FLAG (1 << 2) | 1529 | #define ONE_PORT_FLAG (1 << 2) |
1529 | #define NO_WOL_FLAG (1 << 3) | 1530 | #define NO_WOL_FLAG (1 << 3) |
1530 | #define USING_DAC_FLAG (1 << 4) | ||
1531 | #define USING_MSIX_FLAG (1 << 5) | 1531 | #define USING_MSIX_FLAG (1 << 5) |
1532 | #define USING_MSI_FLAG (1 << 6) | 1532 | #define USING_MSI_FLAG (1 << 6) |
1533 | #define DISABLE_MSI_FLAG (1 << 7) | 1533 | #define DISABLE_MSI_FLAG (1 << 7) |
@@ -1621,7 +1621,7 @@ struct bnx2x { | |||
1621 | u16 rx_ticks_int; | 1621 | u16 rx_ticks_int; |
1622 | u16 rx_ticks; | 1622 | u16 rx_ticks; |
1623 | /* Maximal coalescing timeout in us */ | 1623 | /* Maximal coalescing timeout in us */ |
1624 | #define BNX2X_MAX_COALESCE_TOUT (0xf0*12) | 1624 | #define BNX2X_MAX_COALESCE_TOUT (0xff*BNX2X_BTR) |
1625 | 1625 | ||
1626 | u32 lin_cnt; | 1626 | u32 lin_cnt; |
1627 | 1627 | ||
@@ -2072,7 +2072,8 @@ u32 bnx2x_dmae_opcode(struct bnx2x *bp, u8 src_type, u8 dst_type, | |||
2072 | 2072 | ||
2073 | void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, | 2073 | void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, |
2074 | u8 src_type, u8 dst_type); | 2074 | u8 src_type, u8 dst_type); |
2075 | int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae); | 2075 | int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, |
2076 | u32 *comp); | ||
2076 | 2077 | ||
2077 | /* FLR related routines */ | 2078 | /* FLR related routines */ |
2078 | u32 bnx2x_flr_clnup_poll_count(struct bnx2x *bp); | 2079 | u32 bnx2x_flr_clnup_poll_count(struct bnx2x *bp); |
@@ -2498,4 +2499,8 @@ enum bnx2x_pci_bus_speed { | |||
2498 | }; | 2499 | }; |
2499 | 2500 | ||
2500 | void bnx2x_set_local_cmng(struct bnx2x *bp); | 2501 | void bnx2x_set_local_cmng(struct bnx2x *bp); |
2502 | |||
2503 | #define MCPR_SCRATCH_BASE(bp) \ | ||
2504 | (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH) | ||
2505 | |||
2501 | #endif /* bnx2x.h */ | 2506 | #endif /* bnx2x.h */ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index e66beff2704d..4ab4c89c60cd 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -681,6 +681,7 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
681 | } | 681 | } |
682 | } | 682 | } |
683 | #endif | 683 | #endif |
684 | skb_record_rx_queue(skb, fp->rx_queue); | ||
684 | napi_gro_receive(&fp->napi, skb); | 685 | napi_gro_receive(&fp->napi, skb); |
685 | } | 686 | } |
686 | 687 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 324de5f05332..e8efa1c93ffe 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -891,17 +891,8 @@ static void bnx2x_get_regs(struct net_device *dev, | |||
891 | * will re-enable parity attentions right after the dump. | 891 | * will re-enable parity attentions right after the dump. |
892 | */ | 892 | */ |
893 | 893 | ||
894 | /* Disable parity on path 0 */ | ||
895 | bnx2x_pretend_func(bp, 0); | ||
896 | bnx2x_disable_blocks_parity(bp); | 894 | bnx2x_disable_blocks_parity(bp); |
897 | 895 | ||
898 | /* Disable parity on path 1 */ | ||
899 | bnx2x_pretend_func(bp, 1); | ||
900 | bnx2x_disable_blocks_parity(bp); | ||
901 | |||
902 | /* Return to current function */ | ||
903 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
904 | |||
905 | dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1; | 896 | dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1; |
906 | dump_hdr.preset = DUMP_ALL_PRESETS; | 897 | dump_hdr.preset = DUMP_ALL_PRESETS; |
907 | dump_hdr.version = BNX2X_DUMP_VERSION; | 898 | dump_hdr.version = BNX2X_DUMP_VERSION; |
@@ -928,18 +919,9 @@ static void bnx2x_get_regs(struct net_device *dev, | |||
928 | /* Actually read the registers */ | 919 | /* Actually read the registers */ |
929 | __bnx2x_get_regs(bp, p); | 920 | __bnx2x_get_regs(bp, p); |
930 | 921 | ||
931 | /* Re-enable parity attentions on path 0 */ | 922 | /* Re-enable parity attentions */ |
932 | bnx2x_pretend_func(bp, 0); | ||
933 | bnx2x_clear_blocks_parity(bp); | 923 | bnx2x_clear_blocks_parity(bp); |
934 | bnx2x_enable_blocks_parity(bp); | 924 | bnx2x_enable_blocks_parity(bp); |
935 | |||
936 | /* Re-enable parity attentions on path 1 */ | ||
937 | bnx2x_pretend_func(bp, 1); | ||
938 | bnx2x_clear_blocks_parity(bp); | ||
939 | bnx2x_enable_blocks_parity(bp); | ||
940 | |||
941 | /* Return to current function */ | ||
942 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
943 | } | 925 | } |
944 | 926 | ||
945 | static int bnx2x_get_preset_regs_len(struct net_device *dev, u32 preset) | 927 | static int bnx2x_get_preset_regs_len(struct net_device *dev, u32 preset) |
@@ -993,17 +975,8 @@ static int bnx2x_get_dump_data(struct net_device *dev, | |||
993 | * will re-enable parity attentions right after the dump. | 975 | * will re-enable parity attentions right after the dump. |
994 | */ | 976 | */ |
995 | 977 | ||
996 | /* Disable parity on path 0 */ | ||
997 | bnx2x_pretend_func(bp, 0); | ||
998 | bnx2x_disable_blocks_parity(bp); | 978 | bnx2x_disable_blocks_parity(bp); |
999 | 979 | ||
1000 | /* Disable parity on path 1 */ | ||
1001 | bnx2x_pretend_func(bp, 1); | ||
1002 | bnx2x_disable_blocks_parity(bp); | ||
1003 | |||
1004 | /* Return to current function */ | ||
1005 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
1006 | |||
1007 | dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1; | 980 | dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1; |
1008 | dump_hdr.preset = bp->dump_preset_idx; | 981 | dump_hdr.preset = bp->dump_preset_idx; |
1009 | dump_hdr.version = BNX2X_DUMP_VERSION; | 982 | dump_hdr.version = BNX2X_DUMP_VERSION; |
@@ -1032,19 +1005,10 @@ static int bnx2x_get_dump_data(struct net_device *dev, | |||
1032 | /* Actually read the registers */ | 1005 | /* Actually read the registers */ |
1033 | __bnx2x_get_preset_regs(bp, p, dump_hdr.preset); | 1006 | __bnx2x_get_preset_regs(bp, p, dump_hdr.preset); |
1034 | 1007 | ||
1035 | /* Re-enable parity attentions on path 0 */ | 1008 | /* Re-enable parity attentions */ |
1036 | bnx2x_pretend_func(bp, 0); | ||
1037 | bnx2x_clear_blocks_parity(bp); | 1009 | bnx2x_clear_blocks_parity(bp); |
1038 | bnx2x_enable_blocks_parity(bp); | 1010 | bnx2x_enable_blocks_parity(bp); |
1039 | 1011 | ||
1040 | /* Re-enable parity attentions on path 1 */ | ||
1041 | bnx2x_pretend_func(bp, 1); | ||
1042 | bnx2x_clear_blocks_parity(bp); | ||
1043 | bnx2x_enable_blocks_parity(bp); | ||
1044 | |||
1045 | /* Return to current function */ | ||
1046 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
1047 | |||
1048 | return 0; | 1012 | return 0; |
1049 | } | 1013 | } |
1050 | 1014 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h index 76df015f486a..c2dfea7968f4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h | |||
@@ -640,23 +640,35 @@ static const struct { | |||
640 | * [30] MCP Latched ump_tx_parity | 640 | * [30] MCP Latched ump_tx_parity |
641 | * [31] MCP Latched scpad_parity | 641 | * [31] MCP Latched scpad_parity |
642 | */ | 642 | */ |
643 | #define MISC_AEU_ENABLE_MCP_PRTY_BITS \ | 643 | #define MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS \ |
644 | (AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY | \ | 644 | (AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY | \ |
645 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY | \ | 645 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY | \ |
646 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY | \ | 646 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY) |
647 | |||
648 | #define MISC_AEU_ENABLE_MCP_PRTY_BITS \ | ||
649 | (MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS | \ | ||
647 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY) | 650 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY) |
648 | 651 | ||
649 | /* Below registers control the MCP parity attention output. When | 652 | /* Below registers control the MCP parity attention output. When |
650 | * MISC_AEU_ENABLE_MCP_PRTY_BITS are set - attentions are | 653 | * MISC_AEU_ENABLE_MCP_PRTY_BITS are set - attentions are |
651 | * enabled, when cleared - disabled. | 654 | * enabled, when cleared - disabled. |
652 | */ | 655 | */ |
653 | static const u32 mcp_attn_ctl_regs[] = { | 656 | static const struct { |
654 | MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0, | 657 | u32 addr; |
655 | MISC_REG_AEU_ENABLE4_NIG_0, | 658 | u32 bits; |
656 | MISC_REG_AEU_ENABLE4_PXP_0, | 659 | } mcp_attn_ctl_regs[] = { |
657 | MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0, | 660 | { MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0, |
658 | MISC_REG_AEU_ENABLE4_NIG_1, | 661 | MISC_AEU_ENABLE_MCP_PRTY_BITS }, |
659 | MISC_REG_AEU_ENABLE4_PXP_1 | 662 | { MISC_REG_AEU_ENABLE4_NIG_0, |
663 | MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS }, | ||
664 | { MISC_REG_AEU_ENABLE4_PXP_0, | ||
665 | MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS }, | ||
666 | { MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0, | ||
667 | MISC_AEU_ENABLE_MCP_PRTY_BITS }, | ||
668 | { MISC_REG_AEU_ENABLE4_NIG_1, | ||
669 | MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS }, | ||
670 | { MISC_REG_AEU_ENABLE4_PXP_1, | ||
671 | MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS } | ||
660 | }; | 672 | }; |
661 | 673 | ||
662 | static inline void bnx2x_set_mcp_parity(struct bnx2x *bp, u8 enable) | 674 | static inline void bnx2x_set_mcp_parity(struct bnx2x *bp, u8 enable) |
@@ -665,14 +677,14 @@ static inline void bnx2x_set_mcp_parity(struct bnx2x *bp, u8 enable) | |||
665 | u32 reg_val; | 677 | u32 reg_val; |
666 | 678 | ||
667 | for (i = 0; i < ARRAY_SIZE(mcp_attn_ctl_regs); i++) { | 679 | for (i = 0; i < ARRAY_SIZE(mcp_attn_ctl_regs); i++) { |
668 | reg_val = REG_RD(bp, mcp_attn_ctl_regs[i]); | 680 | reg_val = REG_RD(bp, mcp_attn_ctl_regs[i].addr); |
669 | 681 | ||
670 | if (enable) | 682 | if (enable) |
671 | reg_val |= MISC_AEU_ENABLE_MCP_PRTY_BITS; | 683 | reg_val |= mcp_attn_ctl_regs[i].bits; |
672 | else | 684 | else |
673 | reg_val &= ~MISC_AEU_ENABLE_MCP_PRTY_BITS; | 685 | reg_val &= ~mcp_attn_ctl_regs[i].bits; |
674 | 686 | ||
675 | REG_WR(bp, mcp_attn_ctl_regs[i], reg_val); | 687 | REG_WR(bp, mcp_attn_ctl_regs[i].addr, reg_val); |
676 | } | 688 | } |
677 | } | 689 | } |
678 | 690 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 82b658d8c04c..b42f89ce02ef 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -503,9 +503,9 @@ void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, | |||
503 | } | 503 | } |
504 | 504 | ||
505 | /* issue a dmae command over the init-channel and wait for completion */ | 505 | /* issue a dmae command over the init-channel and wait for completion */ |
506 | int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) | 506 | int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, |
507 | u32 *comp) | ||
507 | { | 508 | { |
508 | u32 *wb_comp = bnx2x_sp(bp, wb_comp); | ||
509 | int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 4000; | 509 | int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 4000; |
510 | int rc = 0; | 510 | int rc = 0; |
511 | 511 | ||
@@ -518,14 +518,14 @@ int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) | |||
518 | spin_lock_bh(&bp->dmae_lock); | 518 | spin_lock_bh(&bp->dmae_lock); |
519 | 519 | ||
520 | /* reset completion */ | 520 | /* reset completion */ |
521 | *wb_comp = 0; | 521 | *comp = 0; |
522 | 522 | ||
523 | /* post the command on the channel used for initializations */ | 523 | /* post the command on the channel used for initializations */ |
524 | bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); | 524 | bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); |
525 | 525 | ||
526 | /* wait for completion */ | 526 | /* wait for completion */ |
527 | udelay(5); | 527 | udelay(5); |
528 | while ((*wb_comp & ~DMAE_PCI_ERR_FLAG) != DMAE_COMP_VAL) { | 528 | while ((*comp & ~DMAE_PCI_ERR_FLAG) != DMAE_COMP_VAL) { |
529 | 529 | ||
530 | if (!cnt || | 530 | if (!cnt || |
531 | (bp->recovery_state != BNX2X_RECOVERY_DONE && | 531 | (bp->recovery_state != BNX2X_RECOVERY_DONE && |
@@ -537,7 +537,7 @@ int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) | |||
537 | cnt--; | 537 | cnt--; |
538 | udelay(50); | 538 | udelay(50); |
539 | } | 539 | } |
540 | if (*wb_comp & DMAE_PCI_ERR_FLAG) { | 540 | if (*comp & DMAE_PCI_ERR_FLAG) { |
541 | BNX2X_ERR("DMAE PCI error!\n"); | 541 | BNX2X_ERR("DMAE PCI error!\n"); |
542 | rc = DMAE_PCI_ERROR; | 542 | rc = DMAE_PCI_ERROR; |
543 | } | 543 | } |
@@ -574,7 +574,7 @@ void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr, | |||
574 | dmae.len = len32; | 574 | dmae.len = len32; |
575 | 575 | ||
576 | /* issue the command and wait for completion */ | 576 | /* issue the command and wait for completion */ |
577 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae); | 577 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); |
578 | if (rc) { | 578 | if (rc) { |
579 | BNX2X_ERR("DMAE returned failure %d\n", rc); | 579 | BNX2X_ERR("DMAE returned failure %d\n", rc); |
580 | bnx2x_panic(); | 580 | bnx2x_panic(); |
@@ -611,7 +611,7 @@ void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32) | |||
611 | dmae.len = len32; | 611 | dmae.len = len32; |
612 | 612 | ||
613 | /* issue the command and wait for completion */ | 613 | /* issue the command and wait for completion */ |
614 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae); | 614 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); |
615 | if (rc) { | 615 | if (rc) { |
616 | BNX2X_ERR("DMAE returned failure %d\n", rc); | 616 | BNX2X_ERR("DMAE returned failure %d\n", rc); |
617 | bnx2x_panic(); | 617 | bnx2x_panic(); |
@@ -751,6 +751,10 @@ static int bnx2x_mc_assert(struct bnx2x *bp) | |||
751 | return rc; | 751 | return rc; |
752 | } | 752 | } |
753 | 753 | ||
754 | #define MCPR_TRACE_BUFFER_SIZE (0x800) | ||
755 | #define SCRATCH_BUFFER_SIZE(bp) \ | ||
756 | (CHIP_IS_E1(bp) ? 0x10000 : (CHIP_IS_E1H(bp) ? 0x20000 : 0x28000)) | ||
757 | |||
754 | void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) | 758 | void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) |
755 | { | 759 | { |
756 | u32 addr, val; | 760 | u32 addr, val; |
@@ -775,7 +779,17 @@ void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) | |||
775 | trace_shmem_base = bp->common.shmem_base; | 779 | trace_shmem_base = bp->common.shmem_base; |
776 | else | 780 | else |
777 | trace_shmem_base = SHMEM2_RD(bp, other_shmem_base_addr); | 781 | trace_shmem_base = SHMEM2_RD(bp, other_shmem_base_addr); |
778 | addr = trace_shmem_base - 0x800; | 782 | |
783 | /* sanity */ | ||
784 | if (trace_shmem_base < MCPR_SCRATCH_BASE(bp) + MCPR_TRACE_BUFFER_SIZE || | ||
785 | trace_shmem_base >= MCPR_SCRATCH_BASE(bp) + | ||
786 | SCRATCH_BUFFER_SIZE(bp)) { | ||
787 | BNX2X_ERR("Unable to dump trace buffer (mark %x)\n", | ||
788 | trace_shmem_base); | ||
789 | return; | ||
790 | } | ||
791 | |||
792 | addr = trace_shmem_base - MCPR_TRACE_BUFFER_SIZE; | ||
779 | 793 | ||
780 | /* validate TRCB signature */ | 794 | /* validate TRCB signature */ |
781 | mark = REG_RD(bp, addr); | 795 | mark = REG_RD(bp, addr); |
@@ -787,14 +801,17 @@ void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) | |||
787 | /* read cyclic buffer pointer */ | 801 | /* read cyclic buffer pointer */ |
788 | addr += 4; | 802 | addr += 4; |
789 | mark = REG_RD(bp, addr); | 803 | mark = REG_RD(bp, addr); |
790 | mark = (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH) | 804 | mark = MCPR_SCRATCH_BASE(bp) + ((mark + 0x3) & ~0x3) - 0x08000000; |
791 | + ((mark + 0x3) & ~0x3) - 0x08000000; | 805 | if (mark >= trace_shmem_base || mark < addr + 4) { |
806 | BNX2X_ERR("Mark doesn't fall inside Trace Buffer\n"); | ||
807 | return; | ||
808 | } | ||
792 | printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark); | 809 | printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark); |
793 | 810 | ||
794 | printk("%s", lvl); | 811 | printk("%s", lvl); |
795 | 812 | ||
796 | /* dump buffer after the mark */ | 813 | /* dump buffer after the mark */ |
797 | for (offset = mark; offset <= trace_shmem_base; offset += 0x8*4) { | 814 | for (offset = mark; offset < trace_shmem_base; offset += 0x8*4) { |
798 | for (word = 0; word < 8; word++) | 815 | for (word = 0; word < 8; word++) |
799 | data[word] = htonl(REG_RD(bp, offset + 4*word)); | 816 | data[word] = htonl(REG_RD(bp, offset + 4*word)); |
800 | data[8] = 0x0; | 817 | data[8] = 0x0; |
@@ -4280,65 +4297,60 @@ static void _print_next_block(int idx, const char *blk) | |||
4280 | pr_cont("%s%s", idx ? ", " : "", blk); | 4297 | pr_cont("%s%s", idx ? ", " : "", blk); |
4281 | } | 4298 | } |
4282 | 4299 | ||
4283 | static int bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig, | 4300 | static bool bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig, |
4284 | int par_num, bool print) | 4301 | int *par_num, bool print) |
4285 | { | 4302 | { |
4286 | int i = 0; | 4303 | u32 cur_bit; |
4287 | u32 cur_bit = 0; | 4304 | bool res; |
4305 | int i; | ||
4306 | |||
4307 | res = false; | ||
4308 | |||
4288 | for (i = 0; sig; i++) { | 4309 | for (i = 0; sig; i++) { |
4289 | cur_bit = ((u32)0x1 << i); | 4310 | cur_bit = (0x1UL << i); |
4290 | if (sig & cur_bit) { | 4311 | if (sig & cur_bit) { |
4291 | switch (cur_bit) { | 4312 | res |= true; /* Each bit is real error! */ |
4292 | case AEU_INPUTS_ATTN_BITS_BRB_PARITY_ERROR: | 4313 | |
4293 | if (print) { | 4314 | if (print) { |
4294 | _print_next_block(par_num++, "BRB"); | 4315 | switch (cur_bit) { |
4316 | case AEU_INPUTS_ATTN_BITS_BRB_PARITY_ERROR: | ||
4317 | _print_next_block((*par_num)++, "BRB"); | ||
4295 | _print_parity(bp, | 4318 | _print_parity(bp, |
4296 | BRB1_REG_BRB1_PRTY_STS); | 4319 | BRB1_REG_BRB1_PRTY_STS); |
4297 | } | 4320 | break; |
4298 | break; | 4321 | case AEU_INPUTS_ATTN_BITS_PARSER_PARITY_ERROR: |
4299 | case AEU_INPUTS_ATTN_BITS_PARSER_PARITY_ERROR: | 4322 | _print_next_block((*par_num)++, |
4300 | if (print) { | 4323 | "PARSER"); |
4301 | _print_next_block(par_num++, "PARSER"); | ||
4302 | _print_parity(bp, PRS_REG_PRS_PRTY_STS); | 4324 | _print_parity(bp, PRS_REG_PRS_PRTY_STS); |
4303 | } | 4325 | break; |
4304 | break; | 4326 | case AEU_INPUTS_ATTN_BITS_TSDM_PARITY_ERROR: |
4305 | case AEU_INPUTS_ATTN_BITS_TSDM_PARITY_ERROR: | 4327 | _print_next_block((*par_num)++, "TSDM"); |
4306 | if (print) { | ||
4307 | _print_next_block(par_num++, "TSDM"); | ||
4308 | _print_parity(bp, | 4328 | _print_parity(bp, |
4309 | TSDM_REG_TSDM_PRTY_STS); | 4329 | TSDM_REG_TSDM_PRTY_STS); |
4310 | } | 4330 | break; |
4311 | break; | 4331 | case AEU_INPUTS_ATTN_BITS_SEARCHER_PARITY_ERROR: |
4312 | case AEU_INPUTS_ATTN_BITS_SEARCHER_PARITY_ERROR: | 4332 | _print_next_block((*par_num)++, |
4313 | if (print) { | ||
4314 | _print_next_block(par_num++, | ||
4315 | "SEARCHER"); | 4333 | "SEARCHER"); |
4316 | _print_parity(bp, SRC_REG_SRC_PRTY_STS); | 4334 | _print_parity(bp, SRC_REG_SRC_PRTY_STS); |
4317 | } | 4335 | break; |
4318 | break; | 4336 | case AEU_INPUTS_ATTN_BITS_TCM_PARITY_ERROR: |
4319 | case AEU_INPUTS_ATTN_BITS_TCM_PARITY_ERROR: | 4337 | _print_next_block((*par_num)++, "TCM"); |
4320 | if (print) { | 4338 | _print_parity(bp, TCM_REG_TCM_PRTY_STS); |
4321 | _print_next_block(par_num++, "TCM"); | 4339 | break; |
4322 | _print_parity(bp, | 4340 | case AEU_INPUTS_ATTN_BITS_TSEMI_PARITY_ERROR: |
4323 | TCM_REG_TCM_PRTY_STS); | 4341 | _print_next_block((*par_num)++, |
4324 | } | 4342 | "TSEMI"); |
4325 | break; | ||
4326 | case AEU_INPUTS_ATTN_BITS_TSEMI_PARITY_ERROR: | ||
4327 | if (print) { | ||
4328 | _print_next_block(par_num++, "TSEMI"); | ||
4329 | _print_parity(bp, | 4343 | _print_parity(bp, |
4330 | TSEM_REG_TSEM_PRTY_STS_0); | 4344 | TSEM_REG_TSEM_PRTY_STS_0); |
4331 | _print_parity(bp, | 4345 | _print_parity(bp, |
4332 | TSEM_REG_TSEM_PRTY_STS_1); | 4346 | TSEM_REG_TSEM_PRTY_STS_1); |
4333 | } | 4347 | break; |
4334 | break; | 4348 | case AEU_INPUTS_ATTN_BITS_PBCLIENT_PARITY_ERROR: |
4335 | case AEU_INPUTS_ATTN_BITS_PBCLIENT_PARITY_ERROR: | 4349 | _print_next_block((*par_num)++, "XPB"); |
4336 | if (print) { | ||
4337 | _print_next_block(par_num++, "XPB"); | ||
4338 | _print_parity(bp, GRCBASE_XPB + | 4350 | _print_parity(bp, GRCBASE_XPB + |
4339 | PB_REG_PB_PRTY_STS); | 4351 | PB_REG_PB_PRTY_STS); |
4352 | break; | ||
4340 | } | 4353 | } |
4341 | break; | ||
4342 | } | 4354 | } |
4343 | 4355 | ||
4344 | /* Clear the bit */ | 4356 | /* Clear the bit */ |
@@ -4346,53 +4358,59 @@ static int bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig, | |||
4346 | } | 4358 | } |
4347 | } | 4359 | } |
4348 | 4360 | ||
4349 | return par_num; | 4361 | return res; |
4350 | } | 4362 | } |
4351 | 4363 | ||
4352 | static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | 4364 | static bool bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, |
4353 | int par_num, bool *global, | 4365 | int *par_num, bool *global, |
4354 | bool print) | 4366 | bool print) |
4355 | { | 4367 | { |
4356 | int i = 0; | 4368 | u32 cur_bit; |
4357 | u32 cur_bit = 0; | 4369 | bool res; |
4370 | int i; | ||
4371 | |||
4372 | res = false; | ||
4373 | |||
4358 | for (i = 0; sig; i++) { | 4374 | for (i = 0; sig; i++) { |
4359 | cur_bit = ((u32)0x1 << i); | 4375 | cur_bit = (0x1UL << i); |
4360 | if (sig & cur_bit) { | 4376 | if (sig & cur_bit) { |
4377 | res |= true; /* Each bit is real error! */ | ||
4361 | switch (cur_bit) { | 4378 | switch (cur_bit) { |
4362 | case AEU_INPUTS_ATTN_BITS_PBF_PARITY_ERROR: | 4379 | case AEU_INPUTS_ATTN_BITS_PBF_PARITY_ERROR: |
4363 | if (print) { | 4380 | if (print) { |
4364 | _print_next_block(par_num++, "PBF"); | 4381 | _print_next_block((*par_num)++, "PBF"); |
4365 | _print_parity(bp, PBF_REG_PBF_PRTY_STS); | 4382 | _print_parity(bp, PBF_REG_PBF_PRTY_STS); |
4366 | } | 4383 | } |
4367 | break; | 4384 | break; |
4368 | case AEU_INPUTS_ATTN_BITS_QM_PARITY_ERROR: | 4385 | case AEU_INPUTS_ATTN_BITS_QM_PARITY_ERROR: |
4369 | if (print) { | 4386 | if (print) { |
4370 | _print_next_block(par_num++, "QM"); | 4387 | _print_next_block((*par_num)++, "QM"); |
4371 | _print_parity(bp, QM_REG_QM_PRTY_STS); | 4388 | _print_parity(bp, QM_REG_QM_PRTY_STS); |
4372 | } | 4389 | } |
4373 | break; | 4390 | break; |
4374 | case AEU_INPUTS_ATTN_BITS_TIMERS_PARITY_ERROR: | 4391 | case AEU_INPUTS_ATTN_BITS_TIMERS_PARITY_ERROR: |
4375 | if (print) { | 4392 | if (print) { |
4376 | _print_next_block(par_num++, "TM"); | 4393 | _print_next_block((*par_num)++, "TM"); |
4377 | _print_parity(bp, TM_REG_TM_PRTY_STS); | 4394 | _print_parity(bp, TM_REG_TM_PRTY_STS); |
4378 | } | 4395 | } |
4379 | break; | 4396 | break; |
4380 | case AEU_INPUTS_ATTN_BITS_XSDM_PARITY_ERROR: | 4397 | case AEU_INPUTS_ATTN_BITS_XSDM_PARITY_ERROR: |
4381 | if (print) { | 4398 | if (print) { |
4382 | _print_next_block(par_num++, "XSDM"); | 4399 | _print_next_block((*par_num)++, "XSDM"); |
4383 | _print_parity(bp, | 4400 | _print_parity(bp, |
4384 | XSDM_REG_XSDM_PRTY_STS); | 4401 | XSDM_REG_XSDM_PRTY_STS); |
4385 | } | 4402 | } |
4386 | break; | 4403 | break; |
4387 | case AEU_INPUTS_ATTN_BITS_XCM_PARITY_ERROR: | 4404 | case AEU_INPUTS_ATTN_BITS_XCM_PARITY_ERROR: |
4388 | if (print) { | 4405 | if (print) { |
4389 | _print_next_block(par_num++, "XCM"); | 4406 | _print_next_block((*par_num)++, "XCM"); |
4390 | _print_parity(bp, XCM_REG_XCM_PRTY_STS); | 4407 | _print_parity(bp, XCM_REG_XCM_PRTY_STS); |
4391 | } | 4408 | } |
4392 | break; | 4409 | break; |
4393 | case AEU_INPUTS_ATTN_BITS_XSEMI_PARITY_ERROR: | 4410 | case AEU_INPUTS_ATTN_BITS_XSEMI_PARITY_ERROR: |
4394 | if (print) { | 4411 | if (print) { |
4395 | _print_next_block(par_num++, "XSEMI"); | 4412 | _print_next_block((*par_num)++, |
4413 | "XSEMI"); | ||
4396 | _print_parity(bp, | 4414 | _print_parity(bp, |
4397 | XSEM_REG_XSEM_PRTY_STS_0); | 4415 | XSEM_REG_XSEM_PRTY_STS_0); |
4398 | _print_parity(bp, | 4416 | _print_parity(bp, |
@@ -4401,7 +4419,7 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4401 | break; | 4419 | break; |
4402 | case AEU_INPUTS_ATTN_BITS_DOORBELLQ_PARITY_ERROR: | 4420 | case AEU_INPUTS_ATTN_BITS_DOORBELLQ_PARITY_ERROR: |
4403 | if (print) { | 4421 | if (print) { |
4404 | _print_next_block(par_num++, | 4422 | _print_next_block((*par_num)++, |
4405 | "DOORBELLQ"); | 4423 | "DOORBELLQ"); |
4406 | _print_parity(bp, | 4424 | _print_parity(bp, |
4407 | DORQ_REG_DORQ_PRTY_STS); | 4425 | DORQ_REG_DORQ_PRTY_STS); |
@@ -4409,7 +4427,7 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4409 | break; | 4427 | break; |
4410 | case AEU_INPUTS_ATTN_BITS_NIG_PARITY_ERROR: | 4428 | case AEU_INPUTS_ATTN_BITS_NIG_PARITY_ERROR: |
4411 | if (print) { | 4429 | if (print) { |
4412 | _print_next_block(par_num++, "NIG"); | 4430 | _print_next_block((*par_num)++, "NIG"); |
4413 | if (CHIP_IS_E1x(bp)) { | 4431 | if (CHIP_IS_E1x(bp)) { |
4414 | _print_parity(bp, | 4432 | _print_parity(bp, |
4415 | NIG_REG_NIG_PRTY_STS); | 4433 | NIG_REG_NIG_PRTY_STS); |
@@ -4423,32 +4441,34 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4423 | break; | 4441 | break; |
4424 | case AEU_INPUTS_ATTN_BITS_VAUX_PCI_CORE_PARITY_ERROR: | 4442 | case AEU_INPUTS_ATTN_BITS_VAUX_PCI_CORE_PARITY_ERROR: |
4425 | if (print) | 4443 | if (print) |
4426 | _print_next_block(par_num++, | 4444 | _print_next_block((*par_num)++, |
4427 | "VAUX PCI CORE"); | 4445 | "VAUX PCI CORE"); |
4428 | *global = true; | 4446 | *global = true; |
4429 | break; | 4447 | break; |
4430 | case AEU_INPUTS_ATTN_BITS_DEBUG_PARITY_ERROR: | 4448 | case AEU_INPUTS_ATTN_BITS_DEBUG_PARITY_ERROR: |
4431 | if (print) { | 4449 | if (print) { |
4432 | _print_next_block(par_num++, "DEBUG"); | 4450 | _print_next_block((*par_num)++, |
4451 | "DEBUG"); | ||
4433 | _print_parity(bp, DBG_REG_DBG_PRTY_STS); | 4452 | _print_parity(bp, DBG_REG_DBG_PRTY_STS); |
4434 | } | 4453 | } |
4435 | break; | 4454 | break; |
4436 | case AEU_INPUTS_ATTN_BITS_USDM_PARITY_ERROR: | 4455 | case AEU_INPUTS_ATTN_BITS_USDM_PARITY_ERROR: |
4437 | if (print) { | 4456 | if (print) { |
4438 | _print_next_block(par_num++, "USDM"); | 4457 | _print_next_block((*par_num)++, "USDM"); |
4439 | _print_parity(bp, | 4458 | _print_parity(bp, |
4440 | USDM_REG_USDM_PRTY_STS); | 4459 | USDM_REG_USDM_PRTY_STS); |
4441 | } | 4460 | } |
4442 | break; | 4461 | break; |
4443 | case AEU_INPUTS_ATTN_BITS_UCM_PARITY_ERROR: | 4462 | case AEU_INPUTS_ATTN_BITS_UCM_PARITY_ERROR: |
4444 | if (print) { | 4463 | if (print) { |
4445 | _print_next_block(par_num++, "UCM"); | 4464 | _print_next_block((*par_num)++, "UCM"); |
4446 | _print_parity(bp, UCM_REG_UCM_PRTY_STS); | 4465 | _print_parity(bp, UCM_REG_UCM_PRTY_STS); |
4447 | } | 4466 | } |
4448 | break; | 4467 | break; |
4449 | case AEU_INPUTS_ATTN_BITS_USEMI_PARITY_ERROR: | 4468 | case AEU_INPUTS_ATTN_BITS_USEMI_PARITY_ERROR: |
4450 | if (print) { | 4469 | if (print) { |
4451 | _print_next_block(par_num++, "USEMI"); | 4470 | _print_next_block((*par_num)++, |
4471 | "USEMI"); | ||
4452 | _print_parity(bp, | 4472 | _print_parity(bp, |
4453 | USEM_REG_USEM_PRTY_STS_0); | 4473 | USEM_REG_USEM_PRTY_STS_0); |
4454 | _print_parity(bp, | 4474 | _print_parity(bp, |
@@ -4457,21 +4477,21 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4457 | break; | 4477 | break; |
4458 | case AEU_INPUTS_ATTN_BITS_UPB_PARITY_ERROR: | 4478 | case AEU_INPUTS_ATTN_BITS_UPB_PARITY_ERROR: |
4459 | if (print) { | 4479 | if (print) { |
4460 | _print_next_block(par_num++, "UPB"); | 4480 | _print_next_block((*par_num)++, "UPB"); |
4461 | _print_parity(bp, GRCBASE_UPB + | 4481 | _print_parity(bp, GRCBASE_UPB + |
4462 | PB_REG_PB_PRTY_STS); | 4482 | PB_REG_PB_PRTY_STS); |
4463 | } | 4483 | } |
4464 | break; | 4484 | break; |
4465 | case AEU_INPUTS_ATTN_BITS_CSDM_PARITY_ERROR: | 4485 | case AEU_INPUTS_ATTN_BITS_CSDM_PARITY_ERROR: |
4466 | if (print) { | 4486 | if (print) { |
4467 | _print_next_block(par_num++, "CSDM"); | 4487 | _print_next_block((*par_num)++, "CSDM"); |
4468 | _print_parity(bp, | 4488 | _print_parity(bp, |
4469 | CSDM_REG_CSDM_PRTY_STS); | 4489 | CSDM_REG_CSDM_PRTY_STS); |
4470 | } | 4490 | } |
4471 | break; | 4491 | break; |
4472 | case AEU_INPUTS_ATTN_BITS_CCM_PARITY_ERROR: | 4492 | case AEU_INPUTS_ATTN_BITS_CCM_PARITY_ERROR: |
4473 | if (print) { | 4493 | if (print) { |
4474 | _print_next_block(par_num++, "CCM"); | 4494 | _print_next_block((*par_num)++, "CCM"); |
4475 | _print_parity(bp, CCM_REG_CCM_PRTY_STS); | 4495 | _print_parity(bp, CCM_REG_CCM_PRTY_STS); |
4476 | } | 4496 | } |
4477 | break; | 4497 | break; |
@@ -4482,80 +4502,73 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4482 | } | 4502 | } |
4483 | } | 4503 | } |
4484 | 4504 | ||
4485 | return par_num; | 4505 | return res; |
4486 | } | 4506 | } |
4487 | 4507 | ||
4488 | static int bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig, | 4508 | static bool bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig, |
4489 | int par_num, bool print) | 4509 | int *par_num, bool print) |
4490 | { | 4510 | { |
4491 | int i = 0; | 4511 | u32 cur_bit; |
4492 | u32 cur_bit = 0; | 4512 | bool res; |
4513 | int i; | ||
4514 | |||
4515 | res = false; | ||
4516 | |||
4493 | for (i = 0; sig; i++) { | 4517 | for (i = 0; sig; i++) { |
4494 | cur_bit = ((u32)0x1 << i); | 4518 | cur_bit = (0x1UL << i); |
4495 | if (sig & cur_bit) { | 4519 | if (sig & cur_bit) { |
4496 | switch (cur_bit) { | 4520 | res |= true; /* Each bit is real error! */ |
4497 | case AEU_INPUTS_ATTN_BITS_CSEMI_PARITY_ERROR: | 4521 | if (print) { |
4498 | if (print) { | 4522 | switch (cur_bit) { |
4499 | _print_next_block(par_num++, "CSEMI"); | 4523 | case AEU_INPUTS_ATTN_BITS_CSEMI_PARITY_ERROR: |
4524 | _print_next_block((*par_num)++, | ||
4525 | "CSEMI"); | ||
4500 | _print_parity(bp, | 4526 | _print_parity(bp, |
4501 | CSEM_REG_CSEM_PRTY_STS_0); | 4527 | CSEM_REG_CSEM_PRTY_STS_0); |
4502 | _print_parity(bp, | 4528 | _print_parity(bp, |
4503 | CSEM_REG_CSEM_PRTY_STS_1); | 4529 | CSEM_REG_CSEM_PRTY_STS_1); |
4504 | } | 4530 | break; |
4505 | break; | 4531 | case AEU_INPUTS_ATTN_BITS_PXP_PARITY_ERROR: |
4506 | case AEU_INPUTS_ATTN_BITS_PXP_PARITY_ERROR: | 4532 | _print_next_block((*par_num)++, "PXP"); |
4507 | if (print) { | ||
4508 | _print_next_block(par_num++, "PXP"); | ||
4509 | _print_parity(bp, PXP_REG_PXP_PRTY_STS); | 4533 | _print_parity(bp, PXP_REG_PXP_PRTY_STS); |
4510 | _print_parity(bp, | 4534 | _print_parity(bp, |
4511 | PXP2_REG_PXP2_PRTY_STS_0); | 4535 | PXP2_REG_PXP2_PRTY_STS_0); |
4512 | _print_parity(bp, | 4536 | _print_parity(bp, |
4513 | PXP2_REG_PXP2_PRTY_STS_1); | 4537 | PXP2_REG_PXP2_PRTY_STS_1); |
4514 | } | 4538 | break; |
4515 | break; | 4539 | case AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR: |
4516 | case AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR: | 4540 | _print_next_block((*par_num)++, |
4517 | if (print) | 4541 | "PXPPCICLOCKCLIENT"); |
4518 | _print_next_block(par_num++, | 4542 | break; |
4519 | "PXPPCICLOCKCLIENT"); | 4543 | case AEU_INPUTS_ATTN_BITS_CFC_PARITY_ERROR: |
4520 | break; | 4544 | _print_next_block((*par_num)++, "CFC"); |
4521 | case AEU_INPUTS_ATTN_BITS_CFC_PARITY_ERROR: | ||
4522 | if (print) { | ||
4523 | _print_next_block(par_num++, "CFC"); | ||
4524 | _print_parity(bp, | 4545 | _print_parity(bp, |
4525 | CFC_REG_CFC_PRTY_STS); | 4546 | CFC_REG_CFC_PRTY_STS); |
4526 | } | 4547 | break; |
4527 | break; | 4548 | case AEU_INPUTS_ATTN_BITS_CDU_PARITY_ERROR: |
4528 | case AEU_INPUTS_ATTN_BITS_CDU_PARITY_ERROR: | 4549 | _print_next_block((*par_num)++, "CDU"); |
4529 | if (print) { | ||
4530 | _print_next_block(par_num++, "CDU"); | ||
4531 | _print_parity(bp, CDU_REG_CDU_PRTY_STS); | 4550 | _print_parity(bp, CDU_REG_CDU_PRTY_STS); |
4532 | } | 4551 | break; |
4533 | break; | 4552 | case AEU_INPUTS_ATTN_BITS_DMAE_PARITY_ERROR: |
4534 | case AEU_INPUTS_ATTN_BITS_DMAE_PARITY_ERROR: | 4553 | _print_next_block((*par_num)++, "DMAE"); |
4535 | if (print) { | ||
4536 | _print_next_block(par_num++, "DMAE"); | ||
4537 | _print_parity(bp, | 4554 | _print_parity(bp, |
4538 | DMAE_REG_DMAE_PRTY_STS); | 4555 | DMAE_REG_DMAE_PRTY_STS); |
4539 | } | 4556 | break; |
4540 | break; | 4557 | case AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR: |
4541 | case AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR: | 4558 | _print_next_block((*par_num)++, "IGU"); |
4542 | if (print) { | ||
4543 | _print_next_block(par_num++, "IGU"); | ||
4544 | if (CHIP_IS_E1x(bp)) | 4559 | if (CHIP_IS_E1x(bp)) |
4545 | _print_parity(bp, | 4560 | _print_parity(bp, |
4546 | HC_REG_HC_PRTY_STS); | 4561 | HC_REG_HC_PRTY_STS); |
4547 | else | 4562 | else |
4548 | _print_parity(bp, | 4563 | _print_parity(bp, |
4549 | IGU_REG_IGU_PRTY_STS); | 4564 | IGU_REG_IGU_PRTY_STS); |
4550 | } | 4565 | break; |
4551 | break; | 4566 | case AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR: |
4552 | case AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR: | 4567 | _print_next_block((*par_num)++, "MISC"); |
4553 | if (print) { | ||
4554 | _print_next_block(par_num++, "MISC"); | ||
4555 | _print_parity(bp, | 4568 | _print_parity(bp, |
4556 | MISC_REG_MISC_PRTY_STS); | 4569 | MISC_REG_MISC_PRTY_STS); |
4570 | break; | ||
4557 | } | 4571 | } |
4558 | break; | ||
4559 | } | 4572 | } |
4560 | 4573 | ||
4561 | /* Clear the bit */ | 4574 | /* Clear the bit */ |
@@ -4563,40 +4576,49 @@ static int bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig, | |||
4563 | } | 4576 | } |
4564 | } | 4577 | } |
4565 | 4578 | ||
4566 | return par_num; | 4579 | return res; |
4567 | } | 4580 | } |
4568 | 4581 | ||
4569 | static int bnx2x_check_blocks_with_parity3(u32 sig, int par_num, | 4582 | static bool bnx2x_check_blocks_with_parity3(struct bnx2x *bp, u32 sig, |
4570 | bool *global, bool print) | 4583 | int *par_num, bool *global, |
4584 | bool print) | ||
4571 | { | 4585 | { |
4572 | int i = 0; | 4586 | bool res = false; |
4573 | u32 cur_bit = 0; | 4587 | u32 cur_bit; |
4588 | int i; | ||
4589 | |||
4574 | for (i = 0; sig; i++) { | 4590 | for (i = 0; sig; i++) { |
4575 | cur_bit = ((u32)0x1 << i); | 4591 | cur_bit = (0x1UL << i); |
4576 | if (sig & cur_bit) { | 4592 | if (sig & cur_bit) { |
4577 | switch (cur_bit) { | 4593 | switch (cur_bit) { |
4578 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY: | 4594 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY: |
4579 | if (print) | 4595 | if (print) |
4580 | _print_next_block(par_num++, "MCP ROM"); | 4596 | _print_next_block((*par_num)++, |
4597 | "MCP ROM"); | ||
4581 | *global = true; | 4598 | *global = true; |
4599 | res |= true; | ||
4582 | break; | 4600 | break; |
4583 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY: | 4601 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY: |
4584 | if (print) | 4602 | if (print) |
4585 | _print_next_block(par_num++, | 4603 | _print_next_block((*par_num)++, |
4586 | "MCP UMP RX"); | 4604 | "MCP UMP RX"); |
4587 | *global = true; | 4605 | *global = true; |
4606 | res |= true; | ||
4588 | break; | 4607 | break; |
4589 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY: | 4608 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY: |
4590 | if (print) | 4609 | if (print) |
4591 | _print_next_block(par_num++, | 4610 | _print_next_block((*par_num)++, |
4592 | "MCP UMP TX"); | 4611 | "MCP UMP TX"); |
4593 | *global = true; | 4612 | *global = true; |
4613 | res |= true; | ||
4594 | break; | 4614 | break; |
4595 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY: | 4615 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY: |
4596 | if (print) | 4616 | if (print) |
4597 | _print_next_block(par_num++, | 4617 | _print_next_block((*par_num)++, |
4598 | "MCP SCPAD"); | 4618 | "MCP SCPAD"); |
4599 | *global = true; | 4619 | /* clear latched SCPAD PATIRY from MCP */ |
4620 | REG_WR(bp, MISC_REG_AEU_CLR_LATCH_SIGNAL, | ||
4621 | 1UL << 10); | ||
4600 | break; | 4622 | break; |
4601 | } | 4623 | } |
4602 | 4624 | ||
@@ -4605,45 +4627,50 @@ static int bnx2x_check_blocks_with_parity3(u32 sig, int par_num, | |||
4605 | } | 4627 | } |
4606 | } | 4628 | } |
4607 | 4629 | ||
4608 | return par_num; | 4630 | return res; |
4609 | } | 4631 | } |
4610 | 4632 | ||
4611 | static int bnx2x_check_blocks_with_parity4(struct bnx2x *bp, u32 sig, | 4633 | static bool bnx2x_check_blocks_with_parity4(struct bnx2x *bp, u32 sig, |
4612 | int par_num, bool print) | 4634 | int *par_num, bool print) |
4613 | { | 4635 | { |
4614 | int i = 0; | 4636 | u32 cur_bit; |
4615 | u32 cur_bit = 0; | 4637 | bool res; |
4638 | int i; | ||
4639 | |||
4640 | res = false; | ||
4641 | |||
4616 | for (i = 0; sig; i++) { | 4642 | for (i = 0; sig; i++) { |
4617 | cur_bit = ((u32)0x1 << i); | 4643 | cur_bit = (0x1UL << i); |
4618 | if (sig & cur_bit) { | 4644 | if (sig & cur_bit) { |
4619 | switch (cur_bit) { | 4645 | res |= true; /* Each bit is real error! */ |
4620 | case AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR: | 4646 | if (print) { |
4621 | if (print) { | 4647 | switch (cur_bit) { |
4622 | _print_next_block(par_num++, "PGLUE_B"); | 4648 | case AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR: |
4649 | _print_next_block((*par_num)++, | ||
4650 | "PGLUE_B"); | ||
4623 | _print_parity(bp, | 4651 | _print_parity(bp, |
4624 | PGLUE_B_REG_PGLUE_B_PRTY_STS); | 4652 | PGLUE_B_REG_PGLUE_B_PRTY_STS); |
4625 | } | 4653 | break; |
4626 | break; | 4654 | case AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR: |
4627 | case AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR: | 4655 | _print_next_block((*par_num)++, "ATC"); |
4628 | if (print) { | ||
4629 | _print_next_block(par_num++, "ATC"); | ||
4630 | _print_parity(bp, | 4656 | _print_parity(bp, |
4631 | ATC_REG_ATC_PRTY_STS); | 4657 | ATC_REG_ATC_PRTY_STS); |
4658 | break; | ||
4632 | } | 4659 | } |
4633 | break; | ||
4634 | } | 4660 | } |
4635 | |||
4636 | /* Clear the bit */ | 4661 | /* Clear the bit */ |
4637 | sig &= ~cur_bit; | 4662 | sig &= ~cur_bit; |
4638 | } | 4663 | } |
4639 | } | 4664 | } |
4640 | 4665 | ||
4641 | return par_num; | 4666 | return res; |
4642 | } | 4667 | } |
4643 | 4668 | ||
4644 | static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, | 4669 | static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, |
4645 | u32 *sig) | 4670 | u32 *sig) |
4646 | { | 4671 | { |
4672 | bool res = false; | ||
4673 | |||
4647 | if ((sig[0] & HW_PRTY_ASSERT_SET_0) || | 4674 | if ((sig[0] & HW_PRTY_ASSERT_SET_0) || |
4648 | (sig[1] & HW_PRTY_ASSERT_SET_1) || | 4675 | (sig[1] & HW_PRTY_ASSERT_SET_1) || |
4649 | (sig[2] & HW_PRTY_ASSERT_SET_2) || | 4676 | (sig[2] & HW_PRTY_ASSERT_SET_2) || |
@@ -4660,23 +4687,22 @@ static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, | |||
4660 | if (print) | 4687 | if (print) |
4661 | netdev_err(bp->dev, | 4688 | netdev_err(bp->dev, |
4662 | "Parity errors detected in blocks: "); | 4689 | "Parity errors detected in blocks: "); |
4663 | par_num = bnx2x_check_blocks_with_parity0(bp, | 4690 | res |= bnx2x_check_blocks_with_parity0(bp, |
4664 | sig[0] & HW_PRTY_ASSERT_SET_0, par_num, print); | 4691 | sig[0] & HW_PRTY_ASSERT_SET_0, &par_num, print); |
4665 | par_num = bnx2x_check_blocks_with_parity1(bp, | 4692 | res |= bnx2x_check_blocks_with_parity1(bp, |
4666 | sig[1] & HW_PRTY_ASSERT_SET_1, par_num, global, print); | 4693 | sig[1] & HW_PRTY_ASSERT_SET_1, &par_num, global, print); |
4667 | par_num = bnx2x_check_blocks_with_parity2(bp, | 4694 | res |= bnx2x_check_blocks_with_parity2(bp, |
4668 | sig[2] & HW_PRTY_ASSERT_SET_2, par_num, print); | 4695 | sig[2] & HW_PRTY_ASSERT_SET_2, &par_num, print); |
4669 | par_num = bnx2x_check_blocks_with_parity3( | 4696 | res |= bnx2x_check_blocks_with_parity3(bp, |
4670 | sig[3] & HW_PRTY_ASSERT_SET_3, par_num, global, print); | 4697 | sig[3] & HW_PRTY_ASSERT_SET_3, &par_num, global, print); |
4671 | par_num = bnx2x_check_blocks_with_parity4(bp, | 4698 | res |= bnx2x_check_blocks_with_parity4(bp, |
4672 | sig[4] & HW_PRTY_ASSERT_SET_4, par_num, print); | 4699 | sig[4] & HW_PRTY_ASSERT_SET_4, &par_num, print); |
4673 | 4700 | ||
4674 | if (print) | 4701 | if (print) |
4675 | pr_cont("\n"); | 4702 | pr_cont("\n"); |
4703 | } | ||
4676 | 4704 | ||
4677 | return true; | 4705 | return res; |
4678 | } else | ||
4679 | return false; | ||
4680 | } | 4706 | } |
4681 | 4707 | ||
4682 | /** | 4708 | /** |
@@ -7126,7 +7152,7 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) | |||
7126 | int port = BP_PORT(bp); | 7152 | int port = BP_PORT(bp); |
7127 | int init_phase = port ? PHASE_PORT1 : PHASE_PORT0; | 7153 | int init_phase = port ? PHASE_PORT1 : PHASE_PORT0; |
7128 | u32 low, high; | 7154 | u32 low, high; |
7129 | u32 val; | 7155 | u32 val, reg; |
7130 | 7156 | ||
7131 | DP(NETIF_MSG_HW, "starting port init port %d\n", port); | 7157 | DP(NETIF_MSG_HW, "starting port init port %d\n", port); |
7132 | 7158 | ||
@@ -7271,6 +7297,17 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) | |||
7271 | val |= CHIP_IS_E1(bp) ? 0 : 0x10; | 7297 | val |= CHIP_IS_E1(bp) ? 0 : 0x10; |
7272 | REG_WR(bp, MISC_REG_AEU_MASK_ATTN_FUNC_0 + port*4, val); | 7298 | REG_WR(bp, MISC_REG_AEU_MASK_ATTN_FUNC_0 + port*4, val); |
7273 | 7299 | ||
7300 | /* SCPAD_PARITY should NOT trigger close the gates */ | ||
7301 | reg = port ? MISC_REG_AEU_ENABLE4_NIG_1 : MISC_REG_AEU_ENABLE4_NIG_0; | ||
7302 | REG_WR(bp, reg, | ||
7303 | REG_RD(bp, reg) & | ||
7304 | ~AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY); | ||
7305 | |||
7306 | reg = port ? MISC_REG_AEU_ENABLE4_PXP_1 : MISC_REG_AEU_ENABLE4_PXP_0; | ||
7307 | REG_WR(bp, reg, | ||
7308 | REG_RD(bp, reg) & | ||
7309 | ~AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY); | ||
7310 | |||
7274 | bnx2x_init_block(bp, BLOCK_NIG, init_phase); | 7311 | bnx2x_init_block(bp, BLOCK_NIG, init_phase); |
7275 | 7312 | ||
7276 | if (!CHIP_IS_E1x(bp)) { | 7313 | if (!CHIP_IS_E1x(bp)) { |
@@ -11685,9 +11722,6 @@ static int bnx2x_init_bp(struct bnx2x *bp) | |||
11685 | static int bnx2x_open(struct net_device *dev) | 11722 | static int bnx2x_open(struct net_device *dev) |
11686 | { | 11723 | { |
11687 | struct bnx2x *bp = netdev_priv(dev); | 11724 | struct bnx2x *bp = netdev_priv(dev); |
11688 | bool global = false; | ||
11689 | int other_engine = BP_PATH(bp) ? 0 : 1; | ||
11690 | bool other_load_status, load_status; | ||
11691 | int rc; | 11725 | int rc; |
11692 | 11726 | ||
11693 | bp->stats_init = true; | 11727 | bp->stats_init = true; |
@@ -11703,6 +11737,10 @@ static int bnx2x_open(struct net_device *dev) | |||
11703 | * Parity recovery is only relevant for PF driver. | 11737 | * Parity recovery is only relevant for PF driver. |
11704 | */ | 11738 | */ |
11705 | if (IS_PF(bp)) { | 11739 | if (IS_PF(bp)) { |
11740 | int other_engine = BP_PATH(bp) ? 0 : 1; | ||
11741 | bool other_load_status, load_status; | ||
11742 | bool global = false; | ||
11743 | |||
11706 | other_load_status = bnx2x_get_load_status(bp, other_engine); | 11744 | other_load_status = bnx2x_get_load_status(bp, other_engine); |
11707 | load_status = bnx2x_get_load_status(bp, BP_PATH(bp)); | 11745 | load_status = bnx2x_get_load_status(bp, BP_PATH(bp)); |
11708 | if (!bnx2x_reset_is_done(bp, BP_PATH(bp)) || | 11746 | if (!bnx2x_reset_is_done(bp, BP_PATH(bp)) || |
@@ -12080,7 +12118,6 @@ static int bnx2x_set_coherency_mask(struct bnx2x *bp) | |||
12080 | struct device *dev = &bp->pdev->dev; | 12118 | struct device *dev = &bp->pdev->dev; |
12081 | 12119 | ||
12082 | if (dma_set_mask(dev, DMA_BIT_MASK(64)) == 0) { | 12120 | if (dma_set_mask(dev, DMA_BIT_MASK(64)) == 0) { |
12083 | bp->flags |= USING_DAC_FLAG; | ||
12084 | if (dma_set_coherent_mask(dev, DMA_BIT_MASK(64)) != 0) { | 12121 | if (dma_set_coherent_mask(dev, DMA_BIT_MASK(64)) != 0) { |
12085 | dev_err(dev, "dma_set_coherent_mask failed, aborting\n"); | 12122 | dev_err(dev, "dma_set_coherent_mask failed, aborting\n"); |
12086 | return -EIO; | 12123 | return -EIO; |
@@ -12248,8 +12285,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, | |||
12248 | NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA; | 12285 | NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA; |
12249 | 12286 | ||
12250 | dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX; | 12287 | dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX; |
12251 | if (bp->flags & USING_DAC_FLAG) | 12288 | dev->features |= NETIF_F_HIGHDMA; |
12252 | dev->features |= NETIF_F_HIGHDMA; | ||
12253 | 12289 | ||
12254 | /* Add Loopback capability to the device */ | 12290 | /* Add Loopback capability to the device */ |
12255 | dev->hw_features |= NETIF_F_LOOPBACK; | 12291 | dev->hw_features |= NETIF_F_LOOPBACK; |
@@ -12612,24 +12648,24 @@ static int set_max_cos_est(int chip_id) | |||
12612 | return BNX2X_MULTI_TX_COS_E1X; | 12648 | return BNX2X_MULTI_TX_COS_E1X; |
12613 | case BCM57712: | 12649 | case BCM57712: |
12614 | case BCM57712_MF: | 12650 | case BCM57712_MF: |
12615 | case BCM57712_VF: | ||
12616 | return BNX2X_MULTI_TX_COS_E2_E3A0; | 12651 | return BNX2X_MULTI_TX_COS_E2_E3A0; |
12617 | case BCM57800: | 12652 | case BCM57800: |
12618 | case BCM57800_MF: | 12653 | case BCM57800_MF: |
12619 | case BCM57800_VF: | ||
12620 | case BCM57810: | 12654 | case BCM57810: |
12621 | case BCM57810_MF: | 12655 | case BCM57810_MF: |
12622 | case BCM57840_4_10: | 12656 | case BCM57840_4_10: |
12623 | case BCM57840_2_20: | 12657 | case BCM57840_2_20: |
12624 | case BCM57840_O: | 12658 | case BCM57840_O: |
12625 | case BCM57840_MFO: | 12659 | case BCM57840_MFO: |
12626 | case BCM57810_VF: | ||
12627 | case BCM57840_MF: | 12660 | case BCM57840_MF: |
12628 | case BCM57840_VF: | ||
12629 | case BCM57811: | 12661 | case BCM57811: |
12630 | case BCM57811_MF: | 12662 | case BCM57811_MF: |
12631 | case BCM57811_VF: | ||
12632 | return BNX2X_MULTI_TX_COS_E3B0; | 12663 | return BNX2X_MULTI_TX_COS_E3B0; |
12664 | case BCM57712_VF: | ||
12665 | case BCM57800_VF: | ||
12666 | case BCM57810_VF: | ||
12667 | case BCM57840_VF: | ||
12668 | case BCM57811_VF: | ||
12633 | return 1; | 12669 | return 1; |
12634 | default: | 12670 | default: |
12635 | pr_err("Unknown board_type (%d), aborting\n", chip_id); | 12671 | pr_err("Unknown board_type (%d), aborting\n", chip_id); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 9ad012bdd915..bf08ad68b405 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |||
@@ -470,10 +470,10 @@ static int bnx2x_vfop_qdtor_cmd(struct bnx2x *bp, | |||
470 | bnx2x_vfop_qdtor, cmd->done); | 470 | bnx2x_vfop_qdtor, cmd->done); |
471 | return bnx2x_vfop_transition(bp, vf, bnx2x_vfop_qdtor, | 471 | return bnx2x_vfop_transition(bp, vf, bnx2x_vfop_qdtor, |
472 | cmd->block); | 472 | cmd->block); |
473 | } else { | ||
474 | BNX2X_ERR("VF[%d] failed to add a vfop\n", vf->abs_vfid); | ||
475 | return -ENOMEM; | ||
473 | } | 476 | } |
474 | DP(BNX2X_MSG_IOV, "VF[%d] failed to add a vfop. rc %d\n", | ||
475 | vf->abs_vfid, vfop->rc); | ||
476 | return -ENOMEM; | ||
477 | } | 477 | } |
478 | 478 | ||
479 | static void | 479 | static void |
@@ -3390,14 +3390,16 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac) | |||
3390 | rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true); | 3390 | rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true); |
3391 | if (rc) { | 3391 | if (rc) { |
3392 | BNX2X_ERR("failed to delete eth macs\n"); | 3392 | BNX2X_ERR("failed to delete eth macs\n"); |
3393 | return -EINVAL; | 3393 | rc = -EINVAL; |
3394 | goto out; | ||
3394 | } | 3395 | } |
3395 | 3396 | ||
3396 | /* remove existing uc list macs */ | 3397 | /* remove existing uc list macs */ |
3397 | rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true); | 3398 | rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true); |
3398 | if (rc) { | 3399 | if (rc) { |
3399 | BNX2X_ERR("failed to delete uc_list macs\n"); | 3400 | BNX2X_ERR("failed to delete uc_list macs\n"); |
3400 | return -EINVAL; | 3401 | rc = -EINVAL; |
3402 | goto out; | ||
3401 | } | 3403 | } |
3402 | 3404 | ||
3403 | /* configure the new mac to device */ | 3405 | /* configure the new mac to device */ |
@@ -3405,6 +3407,7 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac) | |||
3405 | bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true, | 3407 | bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true, |
3406 | BNX2X_ETH_MAC, &ramrod_flags); | 3408 | BNX2X_ETH_MAC, &ramrod_flags); |
3407 | 3409 | ||
3410 | out: | ||
3408 | bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC); | 3411 | bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC); |
3409 | } | 3412 | } |
3410 | 3413 | ||
@@ -3467,7 +3470,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) | |||
3467 | &ramrod_flags); | 3470 | &ramrod_flags); |
3468 | if (rc) { | 3471 | if (rc) { |
3469 | BNX2X_ERR("failed to delete vlans\n"); | 3472 | BNX2X_ERR("failed to delete vlans\n"); |
3470 | return -EINVAL; | 3473 | rc = -EINVAL; |
3474 | goto out; | ||
3471 | } | 3475 | } |
3472 | 3476 | ||
3473 | /* send queue update ramrod to configure default vlan and silent | 3477 | /* send queue update ramrod to configure default vlan and silent |
@@ -3501,7 +3505,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) | |||
3501 | rc = bnx2x_config_vlan_mac(bp, &ramrod_param); | 3505 | rc = bnx2x_config_vlan_mac(bp, &ramrod_param); |
3502 | if (rc) { | 3506 | if (rc) { |
3503 | BNX2X_ERR("failed to configure vlan\n"); | 3507 | BNX2X_ERR("failed to configure vlan\n"); |
3504 | return -EINVAL; | 3508 | rc = -EINVAL; |
3509 | goto out; | ||
3505 | } | 3510 | } |
3506 | 3511 | ||
3507 | /* configure default vlan to vf queue and set silent | 3512 | /* configure default vlan to vf queue and set silent |
@@ -3519,18 +3524,18 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) | |||
3519 | rc = bnx2x_queue_state_change(bp, &q_params); | 3524 | rc = bnx2x_queue_state_change(bp, &q_params); |
3520 | if (rc) { | 3525 | if (rc) { |
3521 | BNX2X_ERR("Failed to configure default VLAN\n"); | 3526 | BNX2X_ERR("Failed to configure default VLAN\n"); |
3522 | return rc; | 3527 | goto out; |
3523 | } | 3528 | } |
3524 | 3529 | ||
3525 | /* clear the flag indicating that this VF needs its vlan | 3530 | /* clear the flag indicating that this VF needs its vlan |
3526 | * (will only be set if the HV configured th Vlan before vf was | 3531 | * (will only be set if the HV configured the Vlan before vf was |
3527 | * and we were called because the VF came up later | 3532 | * up and we were called because the VF came up later |
3528 | */ | 3533 | */ |
3534 | out: | ||
3529 | vf->cfg_flags &= ~VF_CFG_VLAN; | 3535 | vf->cfg_flags &= ~VF_CFG_VLAN; |
3530 | |||
3531 | bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN); | 3536 | bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN); |
3532 | } | 3537 | } |
3533 | return 0; | 3538 | return rc; |
3534 | } | 3539 | } |
3535 | 3540 | ||
3536 | /* crc is the first field in the bulletin board. Compute the crc over the | 3541 | /* crc is the first field in the bulletin board. Compute the crc over the |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c index 86436c77af03..3b75070411aa 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | |||
@@ -196,7 +196,7 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp) | |||
196 | 196 | ||
197 | } else if (bp->func_stx) { | 197 | } else if (bp->func_stx) { |
198 | *stats_comp = 0; | 198 | *stats_comp = 0; |
199 | bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); | 199 | bnx2x_issue_dmae_with_comp(bp, dmae, stats_comp); |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c index da16953eb2ec..28757dfacf0d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | |||
@@ -980,7 +980,7 @@ static int bnx2x_copy32_vf_dmae(struct bnx2x *bp, u8 from_vf, | |||
980 | dmae.len = len32; | 980 | dmae.len = len32; |
981 | 981 | ||
982 | /* issue the command and wait for completion */ | 982 | /* issue the command and wait for completion */ |
983 | return bnx2x_issue_dmae_with_comp(bp, &dmae); | 983 | return bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); |
984 | } | 984 | } |
985 | 985 | ||
986 | static void bnx2x_vf_mbx_resp(struct bnx2x *bp, struct bnx2x_virtf *vf) | 986 | static void bnx2x_vf_mbx_resp(struct bnx2x *bp, struct bnx2x_virtf *vf) |
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c index 78d6d6b970e1..48f52882a22b 100644 --- a/drivers/net/ethernet/calxeda/xgmac.c +++ b/drivers/net/ethernet/calxeda/xgmac.c | |||
@@ -106,7 +106,6 @@ | |||
106 | #define XGMAC_DMA_HW_FEATURE 0x00000f58 /* Enabled Hardware Features */ | 106 | #define XGMAC_DMA_HW_FEATURE 0x00000f58 /* Enabled Hardware Features */ |
107 | 107 | ||
108 | #define XGMAC_ADDR_AE 0x80000000 | 108 | #define XGMAC_ADDR_AE 0x80000000 |
109 | #define XGMAC_MAX_FILTER_ADDR 31 | ||
110 | 109 | ||
111 | /* PMT Control and Status */ | 110 | /* PMT Control and Status */ |
112 | #define XGMAC_PMT_POINTER_RESET 0x80000000 | 111 | #define XGMAC_PMT_POINTER_RESET 0x80000000 |
@@ -384,6 +383,7 @@ struct xgmac_priv { | |||
384 | struct device *device; | 383 | struct device *device; |
385 | struct napi_struct napi; | 384 | struct napi_struct napi; |
386 | 385 | ||
386 | int max_macs; | ||
387 | struct xgmac_extra_stats xstats; | 387 | struct xgmac_extra_stats xstats; |
388 | 388 | ||
389 | spinlock_t stats_lock; | 389 | spinlock_t stats_lock; |
@@ -1291,14 +1291,12 @@ static void xgmac_set_rx_mode(struct net_device *dev) | |||
1291 | netdev_dbg(priv->dev, "# mcasts %d, # unicast %d\n", | 1291 | netdev_dbg(priv->dev, "# mcasts %d, # unicast %d\n", |
1292 | netdev_mc_count(dev), netdev_uc_count(dev)); | 1292 | netdev_mc_count(dev), netdev_uc_count(dev)); |
1293 | 1293 | ||
1294 | if (dev->flags & IFF_PROMISC) { | 1294 | if (dev->flags & IFF_PROMISC) |
1295 | writel(XGMAC_FRAME_FILTER_PR, ioaddr + XGMAC_FRAME_FILTER); | 1295 | value |= XGMAC_FRAME_FILTER_PR; |
1296 | return; | ||
1297 | } | ||
1298 | 1296 | ||
1299 | memset(hash_filter, 0, sizeof(hash_filter)); | 1297 | memset(hash_filter, 0, sizeof(hash_filter)); |
1300 | 1298 | ||
1301 | if (netdev_uc_count(dev) > XGMAC_MAX_FILTER_ADDR) { | 1299 | if (netdev_uc_count(dev) > priv->max_macs) { |
1302 | use_hash = true; | 1300 | use_hash = true; |
1303 | value |= XGMAC_FRAME_FILTER_HUC | XGMAC_FRAME_FILTER_HPF; | 1301 | value |= XGMAC_FRAME_FILTER_HUC | XGMAC_FRAME_FILTER_HPF; |
1304 | } | 1302 | } |
@@ -1321,7 +1319,7 @@ static void xgmac_set_rx_mode(struct net_device *dev) | |||
1321 | goto out; | 1319 | goto out; |
1322 | } | 1320 | } |
1323 | 1321 | ||
1324 | if ((netdev_mc_count(dev) + reg - 1) > XGMAC_MAX_FILTER_ADDR) { | 1322 | if ((netdev_mc_count(dev) + reg - 1) > priv->max_macs) { |
1325 | use_hash = true; | 1323 | use_hash = true; |
1326 | value |= XGMAC_FRAME_FILTER_HMC | XGMAC_FRAME_FILTER_HPF; | 1324 | value |= XGMAC_FRAME_FILTER_HMC | XGMAC_FRAME_FILTER_HPF; |
1327 | } else { | 1325 | } else { |
@@ -1342,8 +1340,8 @@ static void xgmac_set_rx_mode(struct net_device *dev) | |||
1342 | } | 1340 | } |
1343 | 1341 | ||
1344 | out: | 1342 | out: |
1345 | for (i = reg; i < XGMAC_MAX_FILTER_ADDR; i++) | 1343 | for (i = reg; i <= priv->max_macs; i++) |
1346 | xgmac_set_mac_addr(ioaddr, NULL, reg); | 1344 | xgmac_set_mac_addr(ioaddr, NULL, i); |
1347 | for (i = 0; i < XGMAC_NUM_HASH; i++) | 1345 | for (i = 0; i < XGMAC_NUM_HASH; i++) |
1348 | writel(hash_filter[i], ioaddr + XGMAC_HASH(i)); | 1346 | writel(hash_filter[i], ioaddr + XGMAC_HASH(i)); |
1349 | 1347 | ||
@@ -1761,6 +1759,13 @@ static int xgmac_probe(struct platform_device *pdev) | |||
1761 | uid = readl(priv->base + XGMAC_VERSION); | 1759 | uid = readl(priv->base + XGMAC_VERSION); |
1762 | netdev_info(ndev, "h/w version is 0x%x\n", uid); | 1760 | netdev_info(ndev, "h/w version is 0x%x\n", uid); |
1763 | 1761 | ||
1762 | /* Figure out how many valid mac address filter registers we have */ | ||
1763 | writel(1, priv->base + XGMAC_ADDR_HIGH(31)); | ||
1764 | if (readl(priv->base + XGMAC_ADDR_HIGH(31)) == 1) | ||
1765 | priv->max_macs = 31; | ||
1766 | else | ||
1767 | priv->max_macs = 7; | ||
1768 | |||
1764 | writel(0, priv->base + XGMAC_DMA_INTR_ENA); | 1769 | writel(0, priv->base + XGMAC_DMA_INTR_ENA); |
1765 | ndev->irq = platform_get_irq(pdev, 0); | 1770 | ndev->irq = platform_get_irq(pdev, 0); |
1766 | if (ndev->irq == -ENXIO) { | 1771 | if (ndev->irq == -ENXIO) { |
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 5f5896e522d2..a7a941b1a655 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c | |||
@@ -158,18 +158,6 @@ static inline board_info_t *to_dm9000_board(struct net_device *dev) | |||
158 | 158 | ||
159 | /* DM9000 network board routine ---------------------------- */ | 159 | /* DM9000 network board routine ---------------------------- */ |
160 | 160 | ||
161 | static void | ||
162 | dm9000_reset(board_info_t * db) | ||
163 | { | ||
164 | dev_dbg(db->dev, "resetting device\n"); | ||
165 | |||
166 | /* RESET device */ | ||
167 | writeb(DM9000_NCR, db->io_addr); | ||
168 | udelay(200); | ||
169 | writeb(NCR_RST, db->io_data); | ||
170 | udelay(200); | ||
171 | } | ||
172 | |||
173 | /* | 161 | /* |
174 | * Read a byte from I/O port | 162 | * Read a byte from I/O port |
175 | */ | 163 | */ |
@@ -191,6 +179,27 @@ iow(board_info_t * db, int reg, int value) | |||
191 | writeb(value, db->io_data); | 179 | writeb(value, db->io_data); |
192 | } | 180 | } |
193 | 181 | ||
182 | static void | ||
183 | dm9000_reset(board_info_t *db) | ||
184 | { | ||
185 | dev_dbg(db->dev, "resetting device\n"); | ||
186 | |||
187 | /* Reset DM9000, see DM9000 Application Notes V1.22 Jun 11, 2004 page 29 | ||
188 | * The essential point is that we have to do a double reset, and the | ||
189 | * instruction is to set LBK into MAC internal loopback mode. | ||
190 | */ | ||
191 | iow(db, DM9000_NCR, 0x03); | ||
192 | udelay(100); /* Application note says at least 20 us */ | ||
193 | if (ior(db, DM9000_NCR) & 1) | ||
194 | dev_err(db->dev, "dm9000 did not respond to first reset\n"); | ||
195 | |||
196 | iow(db, DM9000_NCR, 0); | ||
197 | iow(db, DM9000_NCR, 0x03); | ||
198 | udelay(100); | ||
199 | if (ior(db, DM9000_NCR) & 1) | ||
200 | dev_err(db->dev, "dm9000 did not respond to second reset\n"); | ||
201 | } | ||
202 | |||
194 | /* routines for sending block to chip */ | 203 | /* routines for sending block to chip */ |
195 | 204 | ||
196 | static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) | 205 | static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) |
@@ -744,15 +753,20 @@ static const struct ethtool_ops dm9000_ethtool_ops = { | |||
744 | static void dm9000_show_carrier(board_info_t *db, | 753 | static void dm9000_show_carrier(board_info_t *db, |
745 | unsigned carrier, unsigned nsr) | 754 | unsigned carrier, unsigned nsr) |
746 | { | 755 | { |
756 | int lpa; | ||
747 | struct net_device *ndev = db->ndev; | 757 | struct net_device *ndev = db->ndev; |
758 | struct mii_if_info *mii = &db->mii; | ||
748 | unsigned ncr = dm9000_read_locked(db, DM9000_NCR); | 759 | unsigned ncr = dm9000_read_locked(db, DM9000_NCR); |
749 | 760 | ||
750 | if (carrier) | 761 | if (carrier) { |
751 | dev_info(db->dev, "%s: link up, %dMbps, %s-duplex, no LPA\n", | 762 | lpa = mii->mdio_read(mii->dev, mii->phy_id, MII_LPA); |
763 | dev_info(db->dev, | ||
764 | "%s: link up, %dMbps, %s-duplex, lpa 0x%04X\n", | ||
752 | ndev->name, (nsr & NSR_SPEED) ? 10 : 100, | 765 | ndev->name, (nsr & NSR_SPEED) ? 10 : 100, |
753 | (ncr & NCR_FDX) ? "full" : "half"); | 766 | (ncr & NCR_FDX) ? "full" : "half", lpa); |
754 | else | 767 | } else { |
755 | dev_info(db->dev, "%s: link down\n", ndev->name); | 768 | dev_info(db->dev, "%s: link down\n", ndev->name); |
769 | } | ||
756 | } | 770 | } |
757 | 771 | ||
758 | static void | 772 | static void |
@@ -890,9 +904,15 @@ dm9000_init_dm9000(struct net_device *dev) | |||
890 | (dev->features & NETIF_F_RXCSUM) ? RCSR_CSUM : 0); | 904 | (dev->features & NETIF_F_RXCSUM) ? RCSR_CSUM : 0); |
891 | 905 | ||
892 | iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ | 906 | iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ |
907 | iow(db, DM9000_GPR, 0); | ||
893 | 908 | ||
894 | dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */ | 909 | /* If we are dealing with DM9000B, some extra steps are required: a |
895 | dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); /* Init */ | 910 | * manual phy reset, and setting init params. |
911 | */ | ||
912 | if (db->type == TYPE_DM9000B) { | ||
913 | dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); | ||
914 | dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); | ||
915 | } | ||
896 | 916 | ||
897 | ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; | 917 | ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; |
898 | 918 | ||
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index bd0e0c0bbcd8..c08fd32bb8e5 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -1198,7 +1198,6 @@ int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo) | |||
1198 | 1198 | ||
1199 | if (lancer_chip(adapter)) { | 1199 | if (lancer_chip(adapter)) { |
1200 | req->hdr.version = 1; | 1200 | req->hdr.version = 1; |
1201 | req->if_id = cpu_to_le16(adapter->if_handle); | ||
1202 | } else if (BEx_chip(adapter)) { | 1201 | } else if (BEx_chip(adapter)) { |
1203 | if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) | 1202 | if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) |
1204 | req->hdr.version = 2; | 1203 | req->hdr.version = 2; |
@@ -1206,6 +1205,8 @@ int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo) | |||
1206 | req->hdr.version = 2; | 1205 | req->hdr.version = 2; |
1207 | } | 1206 | } |
1208 | 1207 | ||
1208 | if (req->hdr.version > 0) | ||
1209 | req->if_id = cpu_to_le16(adapter->if_handle); | ||
1209 | req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size); | 1210 | req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size); |
1210 | req->ulp_num = BE_ULP1_NUM; | 1211 | req->ulp_num = BE_ULP1_NUM; |
1211 | req->type = BE_ETH_TX_RING_TYPE_STANDARD; | 1212 | req->type = BE_ETH_TX_RING_TYPE_STANDARD; |
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index c4eaadeb572f..9fbe4dda7a0e 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -88,6 +88,7 @@ | |||
88 | 88 | ||
89 | #include <asm/io.h> | 89 | #include <asm/io.h> |
90 | #include <asm/reg.h> | 90 | #include <asm/reg.h> |
91 | #include <asm/mpc85xx.h> | ||
91 | #include <asm/irq.h> | 92 | #include <asm/irq.h> |
92 | #include <asm/uaccess.h> | 93 | #include <asm/uaccess.h> |
93 | #include <linux/module.h> | 94 | #include <linux/module.h> |
@@ -939,9 +940,8 @@ static void gfar_init_filer_table(struct gfar_private *priv) | |||
939 | } | 940 | } |
940 | } | 941 | } |
941 | 942 | ||
942 | static void gfar_detect_errata(struct gfar_private *priv) | 943 | static void __gfar_detect_errata_83xx(struct gfar_private *priv) |
943 | { | 944 | { |
944 | struct device *dev = &priv->ofdev->dev; | ||
945 | unsigned int pvr = mfspr(SPRN_PVR); | 945 | unsigned int pvr = mfspr(SPRN_PVR); |
946 | unsigned int svr = mfspr(SPRN_SVR); | 946 | unsigned int svr = mfspr(SPRN_SVR); |
947 | unsigned int mod = (svr >> 16) & 0xfff6; /* w/o E suffix */ | 947 | unsigned int mod = (svr >> 16) & 0xfff6; /* w/o E suffix */ |
@@ -957,15 +957,33 @@ static void gfar_detect_errata(struct gfar_private *priv) | |||
957 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) | 957 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) |
958 | priv->errata |= GFAR_ERRATA_76; | 958 | priv->errata |= GFAR_ERRATA_76; |
959 | 959 | ||
960 | /* MPC8313 and MPC837x all rev */ | 960 | /* MPC8313 Rev < 2.0 */ |
961 | if ((pvr == 0x80850010 && mod == 0x80b0) || | 961 | if (pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020) |
962 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) | 962 | priv->errata |= GFAR_ERRATA_12; |
963 | priv->errata |= GFAR_ERRATA_A002; | 963 | } |
964 | 964 | ||
965 | /* MPC8313 Rev < 2.0, MPC8548 rev 2.0 */ | 965 | static void __gfar_detect_errata_85xx(struct gfar_private *priv) |
966 | if ((pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020) || | 966 | { |
967 | (pvr == 0x80210020 && mod == 0x8030 && rev == 0x0020)) | 967 | unsigned int svr = mfspr(SPRN_SVR); |
968 | |||
969 | if ((SVR_SOC_VER(svr) == SVR_8548) && (SVR_REV(svr) == 0x20)) | ||
968 | priv->errata |= GFAR_ERRATA_12; | 970 | priv->errata |= GFAR_ERRATA_12; |
971 | if (((SVR_SOC_VER(svr) == SVR_P2020) && (SVR_REV(svr) < 0x20)) || | ||
972 | ((SVR_SOC_VER(svr) == SVR_P2010) && (SVR_REV(svr) < 0x20))) | ||
973 | priv->errata |= GFAR_ERRATA_76; /* aka eTSEC 20 */ | ||
974 | } | ||
975 | |||
976 | static void gfar_detect_errata(struct gfar_private *priv) | ||
977 | { | ||
978 | struct device *dev = &priv->ofdev->dev; | ||
979 | |||
980 | /* no plans to fix */ | ||
981 | priv->errata |= GFAR_ERRATA_A002; | ||
982 | |||
983 | if (pvr_version_is(PVR_VER_E500V1) || pvr_version_is(PVR_VER_E500V2)) | ||
984 | __gfar_detect_errata_85xx(priv); | ||
985 | else /* non-mpc85xx parts, i.e. e300 core based */ | ||
986 | __gfar_detect_errata_83xx(priv); | ||
969 | 987 | ||
970 | if (priv->errata) | 988 | if (priv->errata) |
971 | dev_info(dev, "enabled errata workarounds, flags: 0x%x\n", | 989 | dev_info(dev, "enabled errata workarounds, flags: 0x%x\n", |
@@ -1599,7 +1617,7 @@ static int __gfar_is_rx_idle(struct gfar_private *priv) | |||
1599 | /* Normaly TSEC should not hang on GRS commands, so we should | 1617 | /* Normaly TSEC should not hang on GRS commands, so we should |
1600 | * actually wait for IEVENT_GRSC flag. | 1618 | * actually wait for IEVENT_GRSC flag. |
1601 | */ | 1619 | */ |
1602 | if (likely(!gfar_has_errata(priv, GFAR_ERRATA_A002))) | 1620 | if (!gfar_has_errata(priv, GFAR_ERRATA_A002)) |
1603 | return 0; | 1621 | return 0; |
1604 | 1622 | ||
1605 | /* Read the eTSEC register at offset 0xD1C. If bits 7-14 are | 1623 | /* Read the eTSEC register at offset 0xD1C. If bits 7-14 are |
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 86d51429a189..151e00cad113 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c | |||
@@ -2655,6 +2655,8 @@ static int igb_set_eee(struct net_device *netdev, | |||
2655 | (hw->phy.media_type != e1000_media_type_copper)) | 2655 | (hw->phy.media_type != e1000_media_type_copper)) |
2656 | return -EOPNOTSUPP; | 2656 | return -EOPNOTSUPP; |
2657 | 2657 | ||
2658 | memset(&eee_curr, 0, sizeof(struct ethtool_eee)); | ||
2659 | |||
2658 | ret_val = igb_get_eee(netdev, &eee_curr); | 2660 | ret_val = igb_get_eee(netdev, &eee_curr); |
2659 | if (ret_val) | 2661 | if (ret_val) |
2660 | return ret_val; | 2662 | return ret_val; |
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 7fb5677451f9..2c210ec35d59 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c | |||
@@ -1131,15 +1131,13 @@ static void mib_counters_update(struct mv643xx_eth_private *mp) | |||
1131 | p->rx_discard += rdlp(mp, RX_DISCARD_FRAME_CNT); | 1131 | p->rx_discard += rdlp(mp, RX_DISCARD_FRAME_CNT); |
1132 | p->rx_overrun += rdlp(mp, RX_OVERRUN_FRAME_CNT); | 1132 | p->rx_overrun += rdlp(mp, RX_OVERRUN_FRAME_CNT); |
1133 | spin_unlock_bh(&mp->mib_counters_lock); | 1133 | spin_unlock_bh(&mp->mib_counters_lock); |
1134 | |||
1135 | mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); | ||
1136 | } | 1134 | } |
1137 | 1135 | ||
1138 | static void mib_counters_timer_wrapper(unsigned long _mp) | 1136 | static void mib_counters_timer_wrapper(unsigned long _mp) |
1139 | { | 1137 | { |
1140 | struct mv643xx_eth_private *mp = (void *)_mp; | 1138 | struct mv643xx_eth_private *mp = (void *)_mp; |
1141 | |||
1142 | mib_counters_update(mp); | 1139 | mib_counters_update(mp); |
1140 | mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); | ||
1143 | } | 1141 | } |
1144 | 1142 | ||
1145 | 1143 | ||
@@ -2237,6 +2235,7 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
2237 | mp->int_mask |= INT_TX_END_0 << i; | 2235 | mp->int_mask |= INT_TX_END_0 << i; |
2238 | } | 2236 | } |
2239 | 2237 | ||
2238 | add_timer(&mp->mib_counters_timer); | ||
2240 | port_start(mp); | 2239 | port_start(mp); |
2241 | 2240 | ||
2242 | wrlp(mp, INT_MASK_EXT, INT_EXT_LINK_PHY | INT_EXT_TX); | 2241 | wrlp(mp, INT_MASK_EXT, INT_EXT_LINK_PHY | INT_EXT_TX); |
@@ -2534,6 +2533,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev, | |||
2534 | if (!ppdev) | 2533 | if (!ppdev) |
2535 | return -ENOMEM; | 2534 | return -ENOMEM; |
2536 | ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 2535 | ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); |
2536 | ppdev->dev.of_node = pnp; | ||
2537 | 2537 | ||
2538 | ret = platform_device_add_resources(ppdev, &res, 1); | 2538 | ret = platform_device_add_resources(ppdev, &res, 1); |
2539 | if (ret) | 2539 | if (ret) |
@@ -2916,7 +2916,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2916 | mp->mib_counters_timer.data = (unsigned long)mp; | 2916 | mp->mib_counters_timer.data = (unsigned long)mp; |
2917 | mp->mib_counters_timer.function = mib_counters_timer_wrapper; | 2917 | mp->mib_counters_timer.function = mib_counters_timer_wrapper; |
2918 | mp->mib_counters_timer.expires = jiffies + 30 * HZ; | 2918 | mp->mib_counters_timer.expires = jiffies + 30 * HZ; |
2919 | add_timer(&mp->mib_counters_timer); | ||
2920 | 2919 | ||
2921 | spin_lock_init(&mp->mib_counters_lock); | 2920 | spin_lock_init(&mp->mib_counters_lock); |
2922 | 2921 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index dec455c8f627..afe2efa69c86 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -70,14 +70,15 @@ static int mlx4_alloc_pages(struct mlx4_en_priv *priv, | |||
70 | put_page(page); | 70 | put_page(page); |
71 | return -ENOMEM; | 71 | return -ENOMEM; |
72 | } | 72 | } |
73 | page_alloc->size = PAGE_SIZE << order; | 73 | page_alloc->page_size = PAGE_SIZE << order; |
74 | page_alloc->page = page; | 74 | page_alloc->page = page; |
75 | page_alloc->dma = dma; | 75 | page_alloc->dma = dma; |
76 | page_alloc->offset = frag_info->frag_align; | 76 | page_alloc->page_offset = frag_info->frag_align; |
77 | /* Not doing get_page() for each frag is a big win | 77 | /* Not doing get_page() for each frag is a big win |
78 | * on asymetric workloads. | 78 | * on asymetric workloads. |
79 | */ | 79 | */ |
80 | atomic_set(&page->_count, page_alloc->size / frag_info->frag_stride); | 80 | atomic_set(&page->_count, |
81 | page_alloc->page_size / frag_info->frag_stride); | ||
81 | return 0; | 82 | return 0; |
82 | } | 83 | } |
83 | 84 | ||
@@ -96,16 +97,19 @@ static int mlx4_en_alloc_frags(struct mlx4_en_priv *priv, | |||
96 | for (i = 0; i < priv->num_frags; i++) { | 97 | for (i = 0; i < priv->num_frags; i++) { |
97 | frag_info = &priv->frag_info[i]; | 98 | frag_info = &priv->frag_info[i]; |
98 | page_alloc[i] = ring_alloc[i]; | 99 | page_alloc[i] = ring_alloc[i]; |
99 | page_alloc[i].offset += frag_info->frag_stride; | 100 | page_alloc[i].page_offset += frag_info->frag_stride; |
100 | if (page_alloc[i].offset + frag_info->frag_stride <= ring_alloc[i].size) | 101 | |
102 | if (page_alloc[i].page_offset + frag_info->frag_stride <= | ||
103 | ring_alloc[i].page_size) | ||
101 | continue; | 104 | continue; |
105 | |||
102 | if (mlx4_alloc_pages(priv, &page_alloc[i], frag_info, gfp)) | 106 | if (mlx4_alloc_pages(priv, &page_alloc[i], frag_info, gfp)) |
103 | goto out; | 107 | goto out; |
104 | } | 108 | } |
105 | 109 | ||
106 | for (i = 0; i < priv->num_frags; i++) { | 110 | for (i = 0; i < priv->num_frags; i++) { |
107 | frags[i] = ring_alloc[i]; | 111 | frags[i] = ring_alloc[i]; |
108 | dma = ring_alloc[i].dma + ring_alloc[i].offset; | 112 | dma = ring_alloc[i].dma + ring_alloc[i].page_offset; |
109 | ring_alloc[i] = page_alloc[i]; | 113 | ring_alloc[i] = page_alloc[i]; |
110 | rx_desc->data[i].addr = cpu_to_be64(dma); | 114 | rx_desc->data[i].addr = cpu_to_be64(dma); |
111 | } | 115 | } |
@@ -117,7 +121,7 @@ out: | |||
117 | frag_info = &priv->frag_info[i]; | 121 | frag_info = &priv->frag_info[i]; |
118 | if (page_alloc[i].page != ring_alloc[i].page) { | 122 | if (page_alloc[i].page != ring_alloc[i].page) { |
119 | dma_unmap_page(priv->ddev, page_alloc[i].dma, | 123 | dma_unmap_page(priv->ddev, page_alloc[i].dma, |
120 | page_alloc[i].size, PCI_DMA_FROMDEVICE); | 124 | page_alloc[i].page_size, PCI_DMA_FROMDEVICE); |
121 | page = page_alloc[i].page; | 125 | page = page_alloc[i].page; |
122 | atomic_set(&page->_count, 1); | 126 | atomic_set(&page->_count, 1); |
123 | put_page(page); | 127 | put_page(page); |
@@ -131,10 +135,12 @@ static void mlx4_en_free_frag(struct mlx4_en_priv *priv, | |||
131 | int i) | 135 | int i) |
132 | { | 136 | { |
133 | const struct mlx4_en_frag_info *frag_info = &priv->frag_info[i]; | 137 | const struct mlx4_en_frag_info *frag_info = &priv->frag_info[i]; |
138 | u32 next_frag_end = frags[i].page_offset + 2 * frag_info->frag_stride; | ||
139 | |||
134 | 140 | ||
135 | if (frags[i].offset + frag_info->frag_stride > frags[i].size) | 141 | if (next_frag_end > frags[i].page_size) |
136 | dma_unmap_page(priv->ddev, frags[i].dma, frags[i].size, | 142 | dma_unmap_page(priv->ddev, frags[i].dma, frags[i].page_size, |
137 | PCI_DMA_FROMDEVICE); | 143 | PCI_DMA_FROMDEVICE); |
138 | 144 | ||
139 | if (frags[i].page) | 145 | if (frags[i].page) |
140 | put_page(frags[i].page); | 146 | put_page(frags[i].page); |
@@ -161,7 +167,7 @@ out: | |||
161 | 167 | ||
162 | page_alloc = &ring->page_alloc[i]; | 168 | page_alloc = &ring->page_alloc[i]; |
163 | dma_unmap_page(priv->ddev, page_alloc->dma, | 169 | dma_unmap_page(priv->ddev, page_alloc->dma, |
164 | page_alloc->size, PCI_DMA_FROMDEVICE); | 170 | page_alloc->page_size, PCI_DMA_FROMDEVICE); |
165 | page = page_alloc->page; | 171 | page = page_alloc->page; |
166 | atomic_set(&page->_count, 1); | 172 | atomic_set(&page->_count, 1); |
167 | put_page(page); | 173 | put_page(page); |
@@ -184,10 +190,11 @@ static void mlx4_en_destroy_allocator(struct mlx4_en_priv *priv, | |||
184 | i, page_count(page_alloc->page)); | 190 | i, page_count(page_alloc->page)); |
185 | 191 | ||
186 | dma_unmap_page(priv->ddev, page_alloc->dma, | 192 | dma_unmap_page(priv->ddev, page_alloc->dma, |
187 | page_alloc->size, PCI_DMA_FROMDEVICE); | 193 | page_alloc->page_size, PCI_DMA_FROMDEVICE); |
188 | while (page_alloc->offset + frag_info->frag_stride < page_alloc->size) { | 194 | while (page_alloc->page_offset + frag_info->frag_stride < |
195 | page_alloc->page_size) { | ||
189 | put_page(page_alloc->page); | 196 | put_page(page_alloc->page); |
190 | page_alloc->offset += frag_info->frag_stride; | 197 | page_alloc->page_offset += frag_info->frag_stride; |
191 | } | 198 | } |
192 | page_alloc->page = NULL; | 199 | page_alloc->page = NULL; |
193 | } | 200 | } |
@@ -478,7 +485,7 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, | |||
478 | /* Save page reference in skb */ | 485 | /* Save page reference in skb */ |
479 | __skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page); | 486 | __skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page); |
480 | skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size); | 487 | skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size); |
481 | skb_frags_rx[nr].page_offset = frags[nr].offset; | 488 | skb_frags_rx[nr].page_offset = frags[nr].page_offset; |
482 | skb->truesize += frag_info->frag_stride; | 489 | skb->truesize += frag_info->frag_stride; |
483 | frags[nr].page = NULL; | 490 | frags[nr].page = NULL; |
484 | } | 491 | } |
@@ -517,7 +524,7 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv, | |||
517 | 524 | ||
518 | /* Get pointer to first fragment so we could copy the headers into the | 525 | /* Get pointer to first fragment so we could copy the headers into the |
519 | * (linear part of the) skb */ | 526 | * (linear part of the) skb */ |
520 | va = page_address(frags[0].page) + frags[0].offset; | 527 | va = page_address(frags[0].page) + frags[0].page_offset; |
521 | 528 | ||
522 | if (length <= SMALL_PACKET_SIZE) { | 529 | if (length <= SMALL_PACKET_SIZE) { |
523 | /* We are copying all relevant data to the skb - temporarily | 530 | /* We are copying all relevant data to the skb - temporarily |
@@ -645,7 +652,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
645 | dma_sync_single_for_cpu(priv->ddev, dma, sizeof(*ethh), | 652 | dma_sync_single_for_cpu(priv->ddev, dma, sizeof(*ethh), |
646 | DMA_FROM_DEVICE); | 653 | DMA_FROM_DEVICE); |
647 | ethh = (struct ethhdr *)(page_address(frags[0].page) + | 654 | ethh = (struct ethhdr *)(page_address(frags[0].page) + |
648 | frags[0].offset); | 655 | frags[0].page_offset); |
649 | 656 | ||
650 | if (is_multicast_ether_addr(ethh->h_dest)) { | 657 | if (is_multicast_ether_addr(ethh->h_dest)) { |
651 | struct mlx4_mac_entry *entry; | 658 | struct mlx4_mac_entry *entry; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 5e0aa569306a..bf06e3610d27 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -237,8 +237,8 @@ struct mlx4_en_tx_desc { | |||
237 | struct mlx4_en_rx_alloc { | 237 | struct mlx4_en_rx_alloc { |
238 | struct page *page; | 238 | struct page *page; |
239 | dma_addr_t dma; | 239 | dma_addr_t dma; |
240 | u32 offset; | 240 | u32 page_offset; |
241 | u32 size; | 241 | u32 page_size; |
242 | }; | 242 | }; |
243 | 243 | ||
244 | struct mlx4_en_tx_ring { | 244 | struct mlx4_en_tx_ring { |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 5472cbd34028..6ca30739625f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c | |||
@@ -180,28 +180,32 @@ static int verify_block_sig(struct mlx5_cmd_prot_block *block) | |||
180 | return 0; | 180 | return 0; |
181 | } | 181 | } |
182 | 182 | ||
183 | static void calc_block_sig(struct mlx5_cmd_prot_block *block, u8 token) | 183 | static void calc_block_sig(struct mlx5_cmd_prot_block *block, u8 token, |
184 | int csum) | ||
184 | { | 185 | { |
185 | block->token = token; | 186 | block->token = token; |
186 | block->ctrl_sig = ~xor8_buf(block->rsvd0, sizeof(*block) - sizeof(block->data) - 2); | 187 | if (csum) { |
187 | block->sig = ~xor8_buf(block, sizeof(*block) - 1); | 188 | block->ctrl_sig = ~xor8_buf(block->rsvd0, sizeof(*block) - |
189 | sizeof(block->data) - 2); | ||
190 | block->sig = ~xor8_buf(block, sizeof(*block) - 1); | ||
191 | } | ||
188 | } | 192 | } |
189 | 193 | ||
190 | static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token) | 194 | static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token, int csum) |
191 | { | 195 | { |
192 | struct mlx5_cmd_mailbox *next = msg->next; | 196 | struct mlx5_cmd_mailbox *next = msg->next; |
193 | 197 | ||
194 | while (next) { | 198 | while (next) { |
195 | calc_block_sig(next->buf, token); | 199 | calc_block_sig(next->buf, token, csum); |
196 | next = next->next; | 200 | next = next->next; |
197 | } | 201 | } |
198 | } | 202 | } |
199 | 203 | ||
200 | static void set_signature(struct mlx5_cmd_work_ent *ent) | 204 | static void set_signature(struct mlx5_cmd_work_ent *ent, int csum) |
201 | { | 205 | { |
202 | ent->lay->sig = ~xor8_buf(ent->lay, sizeof(*ent->lay)); | 206 | ent->lay->sig = ~xor8_buf(ent->lay, sizeof(*ent->lay)); |
203 | calc_chain_sig(ent->in, ent->token); | 207 | calc_chain_sig(ent->in, ent->token, csum); |
204 | calc_chain_sig(ent->out, ent->token); | 208 | calc_chain_sig(ent->out, ent->token, csum); |
205 | } | 209 | } |
206 | 210 | ||
207 | static void poll_timeout(struct mlx5_cmd_work_ent *ent) | 211 | static void poll_timeout(struct mlx5_cmd_work_ent *ent) |
@@ -539,8 +543,7 @@ static void cmd_work_handler(struct work_struct *work) | |||
539 | lay->type = MLX5_PCI_CMD_XPORT; | 543 | lay->type = MLX5_PCI_CMD_XPORT; |
540 | lay->token = ent->token; | 544 | lay->token = ent->token; |
541 | lay->status_own = CMD_OWNER_HW; | 545 | lay->status_own = CMD_OWNER_HW; |
542 | if (!cmd->checksum_disabled) | 546 | set_signature(ent, !cmd->checksum_disabled); |
543 | set_signature(ent); | ||
544 | dump_command(dev, ent, 1); | 547 | dump_command(dev, ent, 1); |
545 | ktime_get_ts(&ent->ts1); | 548 | ktime_get_ts(&ent->ts1); |
546 | 549 | ||
@@ -773,8 +776,6 @@ static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size) | |||
773 | 776 | ||
774 | copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE); | 777 | copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE); |
775 | block = next->buf; | 778 | block = next->buf; |
776 | if (xor8_buf(block, sizeof(*block)) != 0xff) | ||
777 | return -EINVAL; | ||
778 | 779 | ||
779 | memcpy(to, block->data, copy); | 780 | memcpy(to, block->data, copy); |
780 | to += copy; | 781 | to += copy; |
@@ -1361,6 +1362,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) | |||
1361 | goto err_map; | 1362 | goto err_map; |
1362 | } | 1363 | } |
1363 | 1364 | ||
1365 | cmd->checksum_disabled = 1; | ||
1364 | cmd->max_reg_cmds = (1 << cmd->log_sz) - 1; | 1366 | cmd->max_reg_cmds = (1 << cmd->log_sz) - 1; |
1365 | cmd->bitmask = (1 << cmd->max_reg_cmds) - 1; | 1367 | cmd->bitmask = (1 << cmd->max_reg_cmds) - 1; |
1366 | 1368 | ||
@@ -1510,7 +1512,7 @@ int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr) | |||
1510 | case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: return -EIO; | 1512 | case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: return -EIO; |
1511 | case MLX5_CMD_STAT_BAD_RES_ERR: return -EINVAL; | 1513 | case MLX5_CMD_STAT_BAD_RES_ERR: return -EINVAL; |
1512 | case MLX5_CMD_STAT_RES_BUSY: return -EBUSY; | 1514 | case MLX5_CMD_STAT_RES_BUSY: return -EBUSY; |
1513 | case MLX5_CMD_STAT_LIM_ERR: return -EINVAL; | 1515 | case MLX5_CMD_STAT_LIM_ERR: return -ENOMEM; |
1514 | case MLX5_CMD_STAT_BAD_RES_STATE_ERR: return -EINVAL; | 1516 | case MLX5_CMD_STAT_BAD_RES_STATE_ERR: return -EINVAL; |
1515 | case MLX5_CMD_STAT_IX_ERR: return -EINVAL; | 1517 | case MLX5_CMD_STAT_IX_ERR: return -EINVAL; |
1516 | case MLX5_CMD_STAT_NO_RES_ERR: return -EAGAIN; | 1518 | case MLX5_CMD_STAT_NO_RES_ERR: return -EAGAIN; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 443cc4d7b024..2231d93cc7ad 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c | |||
@@ -366,9 +366,11 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, | |||
366 | goto err_in; | 366 | goto err_in; |
367 | } | 367 | } |
368 | 368 | ||
369 | snprintf(eq->name, MLX5_MAX_EQ_NAME, "%s@pci:%s", | ||
370 | name, pci_name(dev->pdev)); | ||
369 | eq->eqn = out.eq_number; | 371 | eq->eqn = out.eq_number; |
370 | err = request_irq(table->msix_arr[vecidx].vector, mlx5_msix_handler, 0, | 372 | err = request_irq(table->msix_arr[vecidx].vector, mlx5_msix_handler, 0, |
371 | name, eq); | 373 | eq->name, eq); |
372 | if (err) | 374 | if (err) |
373 | goto err_eq; | 375 | goto err_eq; |
374 | 376 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index b47739b0b5f6..bc0f5fb66e24 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
@@ -165,9 +165,7 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) | |||
165 | struct mlx5_cmd_set_hca_cap_mbox_in *set_ctx = NULL; | 165 | struct mlx5_cmd_set_hca_cap_mbox_in *set_ctx = NULL; |
166 | struct mlx5_cmd_query_hca_cap_mbox_in query_ctx; | 166 | struct mlx5_cmd_query_hca_cap_mbox_in query_ctx; |
167 | struct mlx5_cmd_set_hca_cap_mbox_out set_out; | 167 | struct mlx5_cmd_set_hca_cap_mbox_out set_out; |
168 | struct mlx5_profile *prof = dev->profile; | ||
169 | u64 flags; | 168 | u64 flags; |
170 | int csum = 1; | ||
171 | int err; | 169 | int err; |
172 | 170 | ||
173 | memset(&query_ctx, 0, sizeof(query_ctx)); | 171 | memset(&query_ctx, 0, sizeof(query_ctx)); |
@@ -197,20 +195,14 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) | |||
197 | memcpy(&set_ctx->hca_cap, &query_out->hca_cap, | 195 | memcpy(&set_ctx->hca_cap, &query_out->hca_cap, |
198 | sizeof(set_ctx->hca_cap)); | 196 | sizeof(set_ctx->hca_cap)); |
199 | 197 | ||
200 | if (prof->mask & MLX5_PROF_MASK_CMDIF_CSUM) { | ||
201 | csum = !!prof->cmdif_csum; | ||
202 | flags = be64_to_cpu(set_ctx->hca_cap.flags); | ||
203 | if (csum) | ||
204 | flags |= MLX5_DEV_CAP_FLAG_CMDIF_CSUM; | ||
205 | else | ||
206 | flags &= ~MLX5_DEV_CAP_FLAG_CMDIF_CSUM; | ||
207 | |||
208 | set_ctx->hca_cap.flags = cpu_to_be64(flags); | ||
209 | } | ||
210 | |||
211 | if (dev->profile->mask & MLX5_PROF_MASK_QP_SIZE) | 198 | if (dev->profile->mask & MLX5_PROF_MASK_QP_SIZE) |
212 | set_ctx->hca_cap.log_max_qp = dev->profile->log_max_qp; | 199 | set_ctx->hca_cap.log_max_qp = dev->profile->log_max_qp; |
213 | 200 | ||
201 | flags = be64_to_cpu(query_out->hca_cap.flags); | ||
202 | /* disable checksum */ | ||
203 | flags &= ~MLX5_DEV_CAP_FLAG_CMDIF_CSUM; | ||
204 | |||
205 | set_ctx->hca_cap.flags = cpu_to_be64(flags); | ||
214 | memset(&set_out, 0, sizeof(set_out)); | 206 | memset(&set_out, 0, sizeof(set_out)); |
215 | set_ctx->hca_cap.log_uar_page_sz = cpu_to_be16(PAGE_SHIFT - 12); | 207 | set_ctx->hca_cap.log_uar_page_sz = cpu_to_be16(PAGE_SHIFT - 12); |
216 | set_ctx->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_SET_HCA_CAP); | 208 | set_ctx->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_SET_HCA_CAP); |
@@ -225,9 +217,6 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) | |||
225 | if (err) | 217 | if (err) |
226 | goto query_ex; | 218 | goto query_ex; |
227 | 219 | ||
228 | if (!csum) | ||
229 | dev->cmd.checksum_disabled = 1; | ||
230 | |||
231 | query_ex: | 220 | query_ex: |
232 | kfree(query_out); | 221 | kfree(query_out); |
233 | kfree(set_ctx); | 222 | kfree(set_ctx); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c index 3a2408d44820..7b12acf210f8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | |||
@@ -90,6 +90,10 @@ struct mlx5_manage_pages_outbox { | |||
90 | __be64 pas[0]; | 90 | __be64 pas[0]; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | enum { | ||
94 | MAX_RECLAIM_TIME_MSECS = 5000, | ||
95 | }; | ||
96 | |||
93 | static int insert_page(struct mlx5_core_dev *dev, u64 addr, struct page *page, u16 func_id) | 97 | static int insert_page(struct mlx5_core_dev *dev, u64 addr, struct page *page, u16 func_id) |
94 | { | 98 | { |
95 | struct rb_root *root = &dev->priv.page_root; | 99 | struct rb_root *root = &dev->priv.page_root; |
@@ -279,6 +283,9 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u32 func_id, int npages, | |||
279 | int err; | 283 | int err; |
280 | int i; | 284 | int i; |
281 | 285 | ||
286 | if (nclaimed) | ||
287 | *nclaimed = 0; | ||
288 | |||
282 | memset(&in, 0, sizeof(in)); | 289 | memset(&in, 0, sizeof(in)); |
283 | outlen = sizeof(*out) + npages * sizeof(out->pas[0]); | 290 | outlen = sizeof(*out) + npages * sizeof(out->pas[0]); |
284 | out = mlx5_vzalloc(outlen); | 291 | out = mlx5_vzalloc(outlen); |
@@ -388,20 +395,25 @@ static int optimal_reclaimed_pages(void) | |||
388 | 395 | ||
389 | int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) | 396 | int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) |
390 | { | 397 | { |
391 | unsigned long end = jiffies + msecs_to_jiffies(5000); | 398 | unsigned long end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); |
392 | struct fw_page *fwp; | 399 | struct fw_page *fwp; |
393 | struct rb_node *p; | 400 | struct rb_node *p; |
401 | int nclaimed = 0; | ||
394 | int err; | 402 | int err; |
395 | 403 | ||
396 | do { | 404 | do { |
397 | p = rb_first(&dev->priv.page_root); | 405 | p = rb_first(&dev->priv.page_root); |
398 | if (p) { | 406 | if (p) { |
399 | fwp = rb_entry(p, struct fw_page, rb_node); | 407 | fwp = rb_entry(p, struct fw_page, rb_node); |
400 | err = reclaim_pages(dev, fwp->func_id, optimal_reclaimed_pages(), NULL); | 408 | err = reclaim_pages(dev, fwp->func_id, |
409 | optimal_reclaimed_pages(), | ||
410 | &nclaimed); | ||
401 | if (err) { | 411 | if (err) { |
402 | mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", err); | 412 | mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", err); |
403 | return err; | 413 | return err; |
404 | } | 414 | } |
415 | if (nclaimed) | ||
416 | end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); | ||
405 | } | 417 | } |
406 | if (time_after(jiffies, end)) { | 418 | if (time_after(jiffies, end)) { |
407 | mlx5_core_warn(dev, "FW did not return all pages. giving up...\n"); | 419 | mlx5_core_warn(dev, "FW did not return all pages. giving up...\n"); |
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c index bd1a2d2bc2ae..ea54d95e5b9f 100644 --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c | |||
@@ -448,7 +448,8 @@ static int moxart_mac_probe(struct platform_device *pdev) | |||
448 | irq = irq_of_parse_and_map(node, 0); | 448 | irq = irq_of_parse_and_map(node, 0); |
449 | if (irq <= 0) { | 449 | if (irq <= 0) { |
450 | netdev_err(ndev, "irq_of_parse_and_map failed\n"); | 450 | netdev_err(ndev, "irq_of_parse_and_map failed\n"); |
451 | return -EINVAL; | 451 | ret = -EINVAL; |
452 | goto irq_map_fail; | ||
452 | } | 453 | } |
453 | 454 | ||
454 | priv = netdev_priv(ndev); | 455 | priv = netdev_priv(ndev); |
@@ -472,24 +473,32 @@ static int moxart_mac_probe(struct platform_device *pdev) | |||
472 | priv->tx_desc_base = dma_alloc_coherent(NULL, TX_REG_DESC_SIZE * | 473 | priv->tx_desc_base = dma_alloc_coherent(NULL, TX_REG_DESC_SIZE * |
473 | TX_DESC_NUM, &priv->tx_base, | 474 | TX_DESC_NUM, &priv->tx_base, |
474 | GFP_DMA | GFP_KERNEL); | 475 | GFP_DMA | GFP_KERNEL); |
475 | if (priv->tx_desc_base == NULL) | 476 | if (priv->tx_desc_base == NULL) { |
477 | ret = -ENOMEM; | ||
476 | goto init_fail; | 478 | goto init_fail; |
479 | } | ||
477 | 480 | ||
478 | priv->rx_desc_base = dma_alloc_coherent(NULL, RX_REG_DESC_SIZE * | 481 | priv->rx_desc_base = dma_alloc_coherent(NULL, RX_REG_DESC_SIZE * |
479 | RX_DESC_NUM, &priv->rx_base, | 482 | RX_DESC_NUM, &priv->rx_base, |
480 | GFP_DMA | GFP_KERNEL); | 483 | GFP_DMA | GFP_KERNEL); |
481 | if (priv->rx_desc_base == NULL) | 484 | if (priv->rx_desc_base == NULL) { |
485 | ret = -ENOMEM; | ||
482 | goto init_fail; | 486 | goto init_fail; |
487 | } | ||
483 | 488 | ||
484 | priv->tx_buf_base = kmalloc(priv->tx_buf_size * TX_DESC_NUM, | 489 | priv->tx_buf_base = kmalloc(priv->tx_buf_size * TX_DESC_NUM, |
485 | GFP_ATOMIC); | 490 | GFP_ATOMIC); |
486 | if (!priv->tx_buf_base) | 491 | if (!priv->tx_buf_base) { |
492 | ret = -ENOMEM; | ||
487 | goto init_fail; | 493 | goto init_fail; |
494 | } | ||
488 | 495 | ||
489 | priv->rx_buf_base = kmalloc(priv->rx_buf_size * RX_DESC_NUM, | 496 | priv->rx_buf_base = kmalloc(priv->rx_buf_size * RX_DESC_NUM, |
490 | GFP_ATOMIC); | 497 | GFP_ATOMIC); |
491 | if (!priv->rx_buf_base) | 498 | if (!priv->rx_buf_base) { |
499 | ret = -ENOMEM; | ||
492 | goto init_fail; | 500 | goto init_fail; |
501 | } | ||
493 | 502 | ||
494 | platform_set_drvdata(pdev, ndev); | 503 | platform_set_drvdata(pdev, ndev); |
495 | 504 | ||
@@ -522,7 +531,8 @@ static int moxart_mac_probe(struct platform_device *pdev) | |||
522 | init_fail: | 531 | init_fail: |
523 | netdev_err(ndev, "init failed\n"); | 532 | netdev_err(ndev, "init failed\n"); |
524 | moxart_mac_free_memory(ndev); | 533 | moxart_mac_free_memory(ndev); |
525 | 534 | irq_map_fail: | |
535 | free_netdev(ndev); | ||
526 | return ret; | 536 | return ret; |
527 | } | 537 | } |
528 | 538 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index ebe4c86e5230..ff83a9fcd4c5 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -665,7 +665,7 @@ static int qlcnic_set_channels(struct net_device *dev, | |||
665 | return err; | 665 | return err; |
666 | } | 666 | } |
667 | 667 | ||
668 | if (channel->tx_count) { | 668 | if (qlcnic_82xx_check(adapter) && channel->tx_count) { |
669 | err = qlcnic_validate_max_tx_rings(adapter, channel->tx_count); | 669 | err = qlcnic_validate_max_tx_rings(adapter, channel->tx_count); |
670 | if (err) | 670 | if (err) |
671 | return err; | 671 | return err; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 21d00a0449a1..9e61eb867452 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -2257,7 +2257,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2257 | 2257 | ||
2258 | err = qlcnic_alloc_adapter_resources(adapter); | 2258 | err = qlcnic_alloc_adapter_resources(adapter); |
2259 | if (err) | 2259 | if (err) |
2260 | goto err_out_free_netdev; | 2260 | goto err_out_free_wq; |
2261 | 2261 | ||
2262 | adapter->dev_rst_time = jiffies; | 2262 | adapter->dev_rst_time = jiffies; |
2263 | adapter->ahw->revision_id = pdev->revision; | 2263 | adapter->ahw->revision_id = pdev->revision; |
@@ -2396,6 +2396,9 @@ err_out_disable_msi: | |||
2396 | err_out_free_hw: | 2396 | err_out_free_hw: |
2397 | qlcnic_free_adapter_resources(adapter); | 2397 | qlcnic_free_adapter_resources(adapter); |
2398 | 2398 | ||
2399 | err_out_free_wq: | ||
2400 | destroy_workqueue(adapter->qlcnic_wq); | ||
2401 | |||
2399 | err_out_free_netdev: | 2402 | err_out_free_netdev: |
2400 | free_netdev(netdev); | 2403 | free_netdev(netdev); |
2401 | 2404 | ||
@@ -3648,11 +3651,6 @@ int qlcnic_validate_max_tx_rings(struct qlcnic_adapter *adapter, u32 txq) | |||
3648 | u8 max_hw = QLCNIC_MAX_TX_RINGS; | 3651 | u8 max_hw = QLCNIC_MAX_TX_RINGS; |
3649 | u32 max_allowed; | 3652 | u32 max_allowed; |
3650 | 3653 | ||
3651 | if (!qlcnic_82xx_check(adapter)) { | ||
3652 | netdev_err(netdev, "No Multi TX-Q support\n"); | ||
3653 | return -EINVAL; | ||
3654 | } | ||
3655 | |||
3656 | if (!qlcnic_use_msi_x && !qlcnic_use_msi) { | 3654 | if (!qlcnic_use_msi_x && !qlcnic_use_msi) { |
3657 | netdev_err(netdev, "No Multi TX-Q support in INT-x mode\n"); | 3655 | netdev_err(netdev, "No Multi TX-Q support in INT-x mode\n"); |
3658 | return -EINVAL; | 3656 | return -EINVAL; |
@@ -3692,8 +3690,7 @@ int qlcnic_validate_max_rss(struct qlcnic_adapter *adapter, | |||
3692 | u8 max_hw = adapter->ahw->max_rx_ques; | 3690 | u8 max_hw = adapter->ahw->max_rx_ques; |
3693 | u32 max_allowed; | 3691 | u32 max_allowed; |
3694 | 3692 | ||
3695 | if (qlcnic_82xx_check(adapter) && !qlcnic_use_msi_x && | 3693 | if (!qlcnic_use_msi_x && !qlcnic_use_msi) { |
3696 | !qlcnic_use_msi) { | ||
3697 | netdev_err(netdev, "No RSS support in INT-x mode\n"); | 3694 | netdev_err(netdev, "No RSS support in INT-x mode\n"); |
3698 | return -EINVAL; | 3695 | return -EINVAL; |
3699 | } | 3696 | } |
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 5cd831ebfa83..b57c278d3b46 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -688,12 +688,16 @@ static struct sh_eth_cpu_data r8a7740_data = { | |||
688 | .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | | 688 | .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | |
689 | EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE | | 689 | EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE | |
690 | EESR_TDE | EESR_ECI, | 690 | EESR_TDE | EESR_ECI, |
691 | .fdr_value = 0x0000070f, | ||
692 | .rmcr_value = 0x00000001, | ||
691 | 693 | ||
692 | .apr = 1, | 694 | .apr = 1, |
693 | .mpr = 1, | 695 | .mpr = 1, |
694 | .tpauser = 1, | 696 | .tpauser = 1, |
695 | .bculr = 1, | 697 | .bculr = 1, |
696 | .hw_swap = 1, | 698 | .hw_swap = 1, |
699 | .rpadir = 1, | ||
700 | .rpadir_value = 2 << 16, | ||
697 | .no_trimd = 1, | 701 | .no_trimd = 1, |
698 | .no_ade = 1, | 702 | .no_ade = 1, |
699 | .tsu = 1, | 703 | .tsu = 1, |
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 9f18ae984f9e..21f9ad6392e9 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -444,6 +444,18 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = { | |||
444 | EF10_DMA_STAT(rx_align_error, RX_ALIGN_ERROR_PKTS), | 444 | EF10_DMA_STAT(rx_align_error, RX_ALIGN_ERROR_PKTS), |
445 | EF10_DMA_STAT(rx_length_error, RX_LENGTH_ERROR_PKTS), | 445 | EF10_DMA_STAT(rx_length_error, RX_LENGTH_ERROR_PKTS), |
446 | EF10_DMA_STAT(rx_nodesc_drops, RX_NODESC_DROPS), | 446 | EF10_DMA_STAT(rx_nodesc_drops, RX_NODESC_DROPS), |
447 | EF10_DMA_STAT(rx_pm_trunc_bb_overflow, PM_TRUNC_BB_OVERFLOW), | ||
448 | EF10_DMA_STAT(rx_pm_discard_bb_overflow, PM_DISCARD_BB_OVERFLOW), | ||
449 | EF10_DMA_STAT(rx_pm_trunc_vfifo_full, PM_TRUNC_VFIFO_FULL), | ||
450 | EF10_DMA_STAT(rx_pm_discard_vfifo_full, PM_DISCARD_VFIFO_FULL), | ||
451 | EF10_DMA_STAT(rx_pm_trunc_qbb, PM_TRUNC_QBB), | ||
452 | EF10_DMA_STAT(rx_pm_discard_qbb, PM_DISCARD_QBB), | ||
453 | EF10_DMA_STAT(rx_pm_discard_mapping, PM_DISCARD_MAPPING), | ||
454 | EF10_DMA_STAT(rx_dp_q_disabled_packets, RXDP_Q_DISABLED_PKTS), | ||
455 | EF10_DMA_STAT(rx_dp_di_dropped_packets, RXDP_DI_DROPPED_PKTS), | ||
456 | EF10_DMA_STAT(rx_dp_streaming_packets, RXDP_STREAMING_PKTS), | ||
457 | EF10_DMA_STAT(rx_dp_emerg_fetch, RXDP_EMERGENCY_FETCH_CONDITIONS), | ||
458 | EF10_DMA_STAT(rx_dp_emerg_wait, RXDP_EMERGENCY_WAIT_CONDITIONS), | ||
447 | }; | 459 | }; |
448 | 460 | ||
449 | #define HUNT_COMMON_STAT_MASK ((1ULL << EF10_STAT_tx_bytes) | \ | 461 | #define HUNT_COMMON_STAT_MASK ((1ULL << EF10_STAT_tx_bytes) | \ |
@@ -498,44 +510,72 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = { | |||
498 | #define HUNT_40G_EXTRA_STAT_MASK ((1ULL << EF10_STAT_rx_align_error) | \ | 510 | #define HUNT_40G_EXTRA_STAT_MASK ((1ULL << EF10_STAT_rx_align_error) | \ |
499 | (1ULL << EF10_STAT_rx_length_error)) | 511 | (1ULL << EF10_STAT_rx_length_error)) |
500 | 512 | ||
501 | #if BITS_PER_LONG == 64 | 513 | /* These statistics are only provided if the firmware supports the |
502 | #define STAT_MASK_BITMAP(bits) (bits) | 514 | * capability PM_AND_RXDP_COUNTERS. |
503 | #else | 515 | */ |
504 | #define STAT_MASK_BITMAP(bits) (bits) & 0xffffffff, (bits) >> 32 | 516 | #define HUNT_PM_AND_RXDP_STAT_MASK ( \ |
505 | #endif | 517 | (1ULL << EF10_STAT_rx_pm_trunc_bb_overflow) | \ |
506 | 518 | (1ULL << EF10_STAT_rx_pm_discard_bb_overflow) | \ | |
507 | static const unsigned long *efx_ef10_stat_mask(struct efx_nic *efx) | 519 | (1ULL << EF10_STAT_rx_pm_trunc_vfifo_full) | \ |
508 | { | 520 | (1ULL << EF10_STAT_rx_pm_discard_vfifo_full) | \ |
509 | static const unsigned long hunt_40g_stat_mask[] = { | 521 | (1ULL << EF10_STAT_rx_pm_trunc_qbb) | \ |
510 | STAT_MASK_BITMAP(HUNT_COMMON_STAT_MASK | | 522 | (1ULL << EF10_STAT_rx_pm_discard_qbb) | \ |
511 | HUNT_40G_EXTRA_STAT_MASK) | 523 | (1ULL << EF10_STAT_rx_pm_discard_mapping) | \ |
512 | }; | 524 | (1ULL << EF10_STAT_rx_dp_q_disabled_packets) | \ |
513 | static const unsigned long hunt_10g_only_stat_mask[] = { | 525 | (1ULL << EF10_STAT_rx_dp_di_dropped_packets) | \ |
514 | STAT_MASK_BITMAP(HUNT_COMMON_STAT_MASK | | 526 | (1ULL << EF10_STAT_rx_dp_streaming_packets) | \ |
515 | HUNT_10G_ONLY_STAT_MASK) | 527 | (1ULL << EF10_STAT_rx_dp_emerg_fetch) | \ |
516 | }; | 528 | (1ULL << EF10_STAT_rx_dp_emerg_wait)) |
529 | |||
530 | static u64 efx_ef10_raw_stat_mask(struct efx_nic *efx) | ||
531 | { | ||
532 | u64 raw_mask = HUNT_COMMON_STAT_MASK; | ||
517 | u32 port_caps = efx_mcdi_phy_get_caps(efx); | 533 | u32 port_caps = efx_mcdi_phy_get_caps(efx); |
534 | struct efx_ef10_nic_data *nic_data = efx->nic_data; | ||
518 | 535 | ||
519 | if (port_caps & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) | 536 | if (port_caps & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) |
520 | return hunt_40g_stat_mask; | 537 | raw_mask |= HUNT_40G_EXTRA_STAT_MASK; |
521 | else | 538 | else |
522 | return hunt_10g_only_stat_mask; | 539 | raw_mask |= HUNT_10G_ONLY_STAT_MASK; |
540 | |||
541 | if (nic_data->datapath_caps & | ||
542 | (1 << MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN)) | ||
543 | raw_mask |= HUNT_PM_AND_RXDP_STAT_MASK; | ||
544 | |||
545 | return raw_mask; | ||
546 | } | ||
547 | |||
548 | static void efx_ef10_get_stat_mask(struct efx_nic *efx, unsigned long *mask) | ||
549 | { | ||
550 | u64 raw_mask = efx_ef10_raw_stat_mask(efx); | ||
551 | |||
552 | #if BITS_PER_LONG == 64 | ||
553 | mask[0] = raw_mask; | ||
554 | #else | ||
555 | mask[0] = raw_mask & 0xffffffff; | ||
556 | mask[1] = raw_mask >> 32; | ||
557 | #endif | ||
523 | } | 558 | } |
524 | 559 | ||
525 | static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names) | 560 | static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names) |
526 | { | 561 | { |
562 | DECLARE_BITMAP(mask, EF10_STAT_COUNT); | ||
563 | |||
564 | efx_ef10_get_stat_mask(efx, mask); | ||
527 | return efx_nic_describe_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, | 565 | return efx_nic_describe_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, |
528 | efx_ef10_stat_mask(efx), names); | 566 | mask, names); |
529 | } | 567 | } |
530 | 568 | ||
531 | static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) | 569 | static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) |
532 | { | 570 | { |
533 | struct efx_ef10_nic_data *nic_data = efx->nic_data; | 571 | struct efx_ef10_nic_data *nic_data = efx->nic_data; |
534 | const unsigned long *stats_mask = efx_ef10_stat_mask(efx); | 572 | DECLARE_BITMAP(mask, EF10_STAT_COUNT); |
535 | __le64 generation_start, generation_end; | 573 | __le64 generation_start, generation_end; |
536 | u64 *stats = nic_data->stats; | 574 | u64 *stats = nic_data->stats; |
537 | __le64 *dma_stats; | 575 | __le64 *dma_stats; |
538 | 576 | ||
577 | efx_ef10_get_stat_mask(efx, mask); | ||
578 | |||
539 | dma_stats = efx->stats_buffer.addr; | 579 | dma_stats = efx->stats_buffer.addr; |
540 | nic_data = efx->nic_data; | 580 | nic_data = efx->nic_data; |
541 | 581 | ||
@@ -543,8 +583,9 @@ static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) | |||
543 | if (generation_end == EFX_MC_STATS_GENERATION_INVALID) | 583 | if (generation_end == EFX_MC_STATS_GENERATION_INVALID) |
544 | return 0; | 584 | return 0; |
545 | rmb(); | 585 | rmb(); |
546 | efx_nic_update_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, stats_mask, | 586 | efx_nic_update_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, mask, |
547 | stats, efx->stats_buffer.addr, false); | 587 | stats, efx->stats_buffer.addr, false); |
588 | rmb(); | ||
548 | generation_start = dma_stats[MC_CMD_MAC_GENERATION_START]; | 589 | generation_start = dma_stats[MC_CMD_MAC_GENERATION_START]; |
549 | if (generation_end != generation_start) | 590 | if (generation_end != generation_start) |
550 | return -EAGAIN; | 591 | return -EAGAIN; |
@@ -563,12 +604,14 @@ static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) | |||
563 | static size_t efx_ef10_update_stats(struct efx_nic *efx, u64 *full_stats, | 604 | static size_t efx_ef10_update_stats(struct efx_nic *efx, u64 *full_stats, |
564 | struct rtnl_link_stats64 *core_stats) | 605 | struct rtnl_link_stats64 *core_stats) |
565 | { | 606 | { |
566 | const unsigned long *mask = efx_ef10_stat_mask(efx); | 607 | DECLARE_BITMAP(mask, EF10_STAT_COUNT); |
567 | struct efx_ef10_nic_data *nic_data = efx->nic_data; | 608 | struct efx_ef10_nic_data *nic_data = efx->nic_data; |
568 | u64 *stats = nic_data->stats; | 609 | u64 *stats = nic_data->stats; |
569 | size_t stats_count = 0, index; | 610 | size_t stats_count = 0, index; |
570 | int retry; | 611 | int retry; |
571 | 612 | ||
613 | efx_ef10_get_stat_mask(efx, mask); | ||
614 | |||
572 | /* If we're unlucky enough to read statistics during the DMA, wait | 615 | /* If we're unlucky enough to read statistics during the DMA, wait |
573 | * up to 10ms for it to finish (typically takes <500us) | 616 | * up to 10ms for it to finish (typically takes <500us) |
574 | */ | 617 | */ |
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index c082562dbf4e..366c8e3e3784 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c | |||
@@ -963,7 +963,7 @@ static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, | |||
963 | bool *was_attached) | 963 | bool *was_attached) |
964 | { | 964 | { |
965 | MCDI_DECLARE_BUF(inbuf, MC_CMD_DRV_ATTACH_IN_LEN); | 965 | MCDI_DECLARE_BUF(inbuf, MC_CMD_DRV_ATTACH_IN_LEN); |
966 | MCDI_DECLARE_BUF(outbuf, MC_CMD_DRV_ATTACH_OUT_LEN); | 966 | MCDI_DECLARE_BUF(outbuf, MC_CMD_DRV_ATTACH_EXT_OUT_LEN); |
967 | size_t outlen; | 967 | size_t outlen; |
968 | int rc; | 968 | int rc; |
969 | 969 | ||
@@ -981,6 +981,22 @@ static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, | |||
981 | goto fail; | 981 | goto fail; |
982 | } | 982 | } |
983 | 983 | ||
984 | /* We currently assume we have control of the external link | ||
985 | * and are completely trusted by firmware. Abort probing | ||
986 | * if that's not true for this function. | ||
987 | */ | ||
988 | if (driver_operating && | ||
989 | outlen >= MC_CMD_DRV_ATTACH_EXT_OUT_LEN && | ||
990 | (MCDI_DWORD(outbuf, DRV_ATTACH_EXT_OUT_FUNC_FLAGS) & | ||
991 | (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL | | ||
992 | 1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)) != | ||
993 | (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL | | ||
994 | 1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)) { | ||
995 | netif_err(efx, probe, efx->net_dev, | ||
996 | "This driver version only supports one function per port\n"); | ||
997 | return -ENODEV; | ||
998 | } | ||
999 | |||
984 | if (was_attached != NULL) | 1000 | if (was_attached != NULL) |
985 | *was_attached = MCDI_DWORD(outbuf, DRV_ATTACH_OUT_OLD_STATE); | 1001 | *was_attached = MCDI_DWORD(outbuf, DRV_ATTACH_OUT_OLD_STATE); |
986 | return 0; | 1002 | return 0; |
diff --git a/drivers/net/ethernet/sfc/mcdi_pcol.h b/drivers/net/ethernet/sfc/mcdi_pcol.h index b5cf62492f8e..e0a63ddb7a6c 100644 --- a/drivers/net/ethernet/sfc/mcdi_pcol.h +++ b/drivers/net/ethernet/sfc/mcdi_pcol.h | |||
@@ -2574,8 +2574,58 @@ | |||
2574 | #define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */ | 2574 | #define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */ |
2575 | #define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */ | 2575 | #define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */ |
2576 | #define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */ | 2576 | #define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */ |
2577 | #define MC_CMD_GMAC_DMABUF_START 0x40 /* enum */ | 2577 | /* enum: PM trunc_bb_overflow counter. Valid for EF10 with PM_AND_RXDP_COUNTERS |
2578 | #define MC_CMD_GMAC_DMABUF_END 0x5f /* enum */ | 2578 | * capability only. |
2579 | */ | ||
2580 | #define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c | ||
2581 | /* enum: PM discard_bb_overflow counter. Valid for EF10 with | ||
2582 | * PM_AND_RXDP_COUNTERS capability only. | ||
2583 | */ | ||
2584 | #define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d | ||
2585 | /* enum: PM trunc_vfifo_full counter. Valid for EF10 with PM_AND_RXDP_COUNTERS | ||
2586 | * capability only. | ||
2587 | */ | ||
2588 | #define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e | ||
2589 | /* enum: PM discard_vfifo_full counter. Valid for EF10 with | ||
2590 | * PM_AND_RXDP_COUNTERS capability only. | ||
2591 | */ | ||
2592 | #define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f | ||
2593 | /* enum: PM trunc_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS | ||
2594 | * capability only. | ||
2595 | */ | ||
2596 | #define MC_CMD_MAC_PM_TRUNC_QBB 0x40 | ||
2597 | /* enum: PM discard_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS | ||
2598 | * capability only. | ||
2599 | */ | ||
2600 | #define MC_CMD_MAC_PM_DISCARD_QBB 0x41 | ||
2601 | /* enum: PM discard_mapping counter. Valid for EF10 with PM_AND_RXDP_COUNTERS | ||
2602 | * capability only. | ||
2603 | */ | ||
2604 | #define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42 | ||
2605 | /* enum: RXDP counter: Number of packets dropped due to the queue being | ||
2606 | * disabled. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. | ||
2607 | */ | ||
2608 | #define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43 | ||
2609 | /* enum: RXDP counter: Number of packets dropped by the DICPU. Valid for EF10 | ||
2610 | * with PM_AND_RXDP_COUNTERS capability only. | ||
2611 | */ | ||
2612 | #define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45 | ||
2613 | /* enum: RXDP counter: Number of non-host packets. Valid for EF10 with | ||
2614 | * PM_AND_RXDP_COUNTERS capability only. | ||
2615 | */ | ||
2616 | #define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46 | ||
2617 | /* enum: RXDP counter: Number of times an emergency descriptor fetch was | ||
2618 | * performed. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. | ||
2619 | */ | ||
2620 | #define MC_CMD_MAC_RXDP_EMERGENCY_FETCH_CONDITIONS 0x47 | ||
2621 | /* enum: RXDP counter: Number of times the DPCPU waited for an existing | ||
2622 | * descriptor fetch. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. | ||
2623 | */ | ||
2624 | #define MC_CMD_MAC_RXDP_EMERGENCY_WAIT_CONDITIONS 0x48 | ||
2625 | /* enum: Start of GMAC stats buffer space, for Siena only. */ | ||
2626 | #define MC_CMD_GMAC_DMABUF_START 0x40 | ||
2627 | /* enum: End of GMAC stats buffer space, for Siena only. */ | ||
2628 | #define MC_CMD_GMAC_DMABUF_END 0x5f | ||
2579 | #define MC_CMD_MAC_GENERATION_END 0x60 /* enum */ | 2629 | #define MC_CMD_MAC_GENERATION_END 0x60 /* enum */ |
2580 | #define MC_CMD_MAC_NSTATS 0x61 /* enum */ | 2630 | #define MC_CMD_MAC_NSTATS 0x61 /* enum */ |
2581 | 2631 | ||
@@ -5065,6 +5115,8 @@ | |||
5065 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1 | 5115 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1 |
5066 | #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26 | 5116 | #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26 |
5067 | #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1 | 5117 | #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1 |
5118 | #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN 27 | ||
5119 | #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1 | ||
5068 | /* RxDPCPU firmware id. */ | 5120 | /* RxDPCPU firmware id. */ |
5069 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4 | 5121 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4 |
5070 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2 | 5122 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2 |
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c index e7dbd2dd202e..9826594c8a48 100644 --- a/drivers/net/ethernet/sfc/nic.c +++ b/drivers/net/ethernet/sfc/nic.c | |||
@@ -469,8 +469,7 @@ size_t efx_nic_describe_stats(const struct efx_hw_stat_desc *desc, size_t count, | |||
469 | * @count: Length of the @desc array | 469 | * @count: Length of the @desc array |
470 | * @mask: Bitmask of which elements of @desc are enabled | 470 | * @mask: Bitmask of which elements of @desc are enabled |
471 | * @stats: Buffer to update with the converted statistics. The length | 471 | * @stats: Buffer to update with the converted statistics. The length |
472 | * of this array must be at least the number of set bits in the | 472 | * of this array must be at least @count. |
473 | * first @count bits of @mask. | ||
474 | * @dma_buf: DMA buffer containing hardware statistics | 473 | * @dma_buf: DMA buffer containing hardware statistics |
475 | * @accumulate: If set, the converted values will be added rather than | 474 | * @accumulate: If set, the converted values will be added rather than |
476 | * directly stored to the corresponding elements of @stats | 475 | * directly stored to the corresponding elements of @stats |
@@ -503,11 +502,9 @@ void efx_nic_update_stats(const struct efx_hw_stat_desc *desc, size_t count, | |||
503 | } | 502 | } |
504 | 503 | ||
505 | if (accumulate) | 504 | if (accumulate) |
506 | *stats += val; | 505 | stats[index] += val; |
507 | else | 506 | else |
508 | *stats = val; | 507 | stats[index] = val; |
509 | } | 508 | } |
510 | |||
511 | ++stats; | ||
512 | } | 509 | } |
513 | } | 510 | } |
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h index fda29d39032f..890bbbe8320e 100644 --- a/drivers/net/ethernet/sfc/nic.h +++ b/drivers/net/ethernet/sfc/nic.h | |||
@@ -386,6 +386,18 @@ enum { | |||
386 | EF10_STAT_rx_align_error, | 386 | EF10_STAT_rx_align_error, |
387 | EF10_STAT_rx_length_error, | 387 | EF10_STAT_rx_length_error, |
388 | EF10_STAT_rx_nodesc_drops, | 388 | EF10_STAT_rx_nodesc_drops, |
389 | EF10_STAT_rx_pm_trunc_bb_overflow, | ||
390 | EF10_STAT_rx_pm_discard_bb_overflow, | ||
391 | EF10_STAT_rx_pm_trunc_vfifo_full, | ||
392 | EF10_STAT_rx_pm_discard_vfifo_full, | ||
393 | EF10_STAT_rx_pm_trunc_qbb, | ||
394 | EF10_STAT_rx_pm_discard_qbb, | ||
395 | EF10_STAT_rx_pm_discard_mapping, | ||
396 | EF10_STAT_rx_dp_q_disabled_packets, | ||
397 | EF10_STAT_rx_dp_di_dropped_packets, | ||
398 | EF10_STAT_rx_dp_streaming_packets, | ||
399 | EF10_STAT_rx_dp_emerg_fetch, | ||
400 | EF10_STAT_rx_dp_emerg_wait, | ||
389 | EF10_STAT_COUNT | 401 | EF10_STAT_COUNT |
390 | }; | 402 | }; |
391 | 403 | ||
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h index 5730fe2445a6..98eedb90cdc3 100644 --- a/drivers/net/ethernet/smsc/smc91x.h +++ b/drivers/net/ethernet/smsc/smc91x.h | |||
@@ -1124,8 +1124,7 @@ static const char * chip_ids[ 16 ] = { | |||
1124 | void __iomem *__ioaddr = ioaddr; \ | 1124 | void __iomem *__ioaddr = ioaddr; \ |
1125 | if (__len >= 2 && (unsigned long)__ptr & 2) { \ | 1125 | if (__len >= 2 && (unsigned long)__ptr & 2) { \ |
1126 | __len -= 2; \ | 1126 | __len -= 2; \ |
1127 | SMC_outw(*(u16 *)__ptr, ioaddr, \ | 1127 | SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \ |
1128 | DATA_REG(lp)); \ | ||
1129 | __ptr += 2; \ | 1128 | __ptr += 2; \ |
1130 | } \ | 1129 | } \ |
1131 | if (SMC_CAN_USE_DATACS && lp->datacs) \ | 1130 | if (SMC_CAN_USE_DATACS && lp->datacs) \ |
@@ -1133,8 +1132,7 @@ static const char * chip_ids[ 16 ] = { | |||
1133 | SMC_outsl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \ | 1132 | SMC_outsl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \ |
1134 | if (__len & 2) { \ | 1133 | if (__len & 2) { \ |
1135 | __ptr += (__len & ~3); \ | 1134 | __ptr += (__len & ~3); \ |
1136 | SMC_outw(*((u16 *)__ptr), ioaddr, \ | 1135 | SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \ |
1137 | DATA_REG(lp)); \ | ||
1138 | } \ | 1136 | } \ |
1139 | } else if (SMC_16BIT(lp)) \ | 1137 | } else if (SMC_16BIT(lp)) \ |
1140 | SMC_outsw(ioaddr, DATA_REG(lp), p, (l) >> 1); \ | 1138 | SMC_outsw(ioaddr, DATA_REG(lp), p, (l) >> 1); \ |
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 79974e31187a..cc3ce557e4aa 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -639,13 +639,6 @@ void cpsw_rx_handler(void *token, int len, int status) | |||
639 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) | 639 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) |
640 | { | 640 | { |
641 | struct cpsw_priv *priv = dev_id; | 641 | struct cpsw_priv *priv = dev_id; |
642 | u32 rx, tx, rx_thresh; | ||
643 | |||
644 | rx_thresh = __raw_readl(&priv->wr_regs->rx_thresh_stat); | ||
645 | rx = __raw_readl(&priv->wr_regs->rx_stat); | ||
646 | tx = __raw_readl(&priv->wr_regs->tx_stat); | ||
647 | if (!rx_thresh && !rx && !tx) | ||
648 | return IRQ_NONE; | ||
649 | 642 | ||
650 | cpsw_intr_disable(priv); | 643 | cpsw_intr_disable(priv); |
651 | if (priv->irq_enabled == true) { | 644 | if (priv->irq_enabled == true) { |
@@ -1169,9 +1162,9 @@ static int cpsw_ndo_open(struct net_device *ndev) | |||
1169 | } | 1162 | } |
1170 | } | 1163 | } |
1171 | 1164 | ||
1165 | napi_enable(&priv->napi); | ||
1172 | cpdma_ctlr_start(priv->dma); | 1166 | cpdma_ctlr_start(priv->dma); |
1173 | cpsw_intr_enable(priv); | 1167 | cpsw_intr_enable(priv); |
1174 | napi_enable(&priv->napi); | ||
1175 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | 1168 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); |
1176 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | 1169 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); |
1177 | 1170 | ||
@@ -1771,8 +1764,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1771 | } | 1764 | } |
1772 | data->mac_control = prop; | 1765 | data->mac_control = prop; |
1773 | 1766 | ||
1774 | if (!of_property_read_u32(node, "dual_emac", &prop)) | 1767 | if (of_property_read_bool(node, "dual_emac")) |
1775 | data->dual_emac = prop; | 1768 | data->dual_emac = 1; |
1776 | 1769 | ||
1777 | /* | 1770 | /* |
1778 | * Populate all the child nodes here... | 1771 | * Populate all the child nodes here... |
@@ -1782,7 +1775,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1782 | if (ret) | 1775 | if (ret) |
1783 | pr_warn("Doesn't have any child node\n"); | 1776 | pr_warn("Doesn't have any child node\n"); |
1784 | 1777 | ||
1785 | for_each_node_by_name(slave_node, "slave") { | 1778 | for_each_child_of_node(node, slave_node) { |
1786 | struct cpsw_slave_data *slave_data = data->slave_data + i; | 1779 | struct cpsw_slave_data *slave_data = data->slave_data + i; |
1787 | const void *mac_addr = NULL; | 1780 | const void *mac_addr = NULL; |
1788 | u32 phyid; | 1781 | u32 phyid; |
@@ -1791,6 +1784,10 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1791 | struct device_node *mdio_node; | 1784 | struct device_node *mdio_node; |
1792 | struct platform_device *mdio; | 1785 | struct platform_device *mdio; |
1793 | 1786 | ||
1787 | /* This is no slave child node, continue */ | ||
1788 | if (strcmp(slave_node->name, "slave")) | ||
1789 | continue; | ||
1790 | |||
1794 | parp = of_get_property(slave_node, "phy_id", &lenp); | 1791 | parp = of_get_property(slave_node, "phy_id", &lenp); |
1795 | if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { | 1792 | if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { |
1796 | pr_err("Missing slave[%d] phy_id property\n", i); | 1793 | pr_err("Missing slave[%d] phy_id property\n", i); |
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 67df09ea9d04..6a32ef9d63ae 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
@@ -876,8 +876,7 @@ static void emac_dev_mcast_set(struct net_device *ndev) | |||
876 | netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) { | 876 | netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) { |
877 | mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); | 877 | mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); |
878 | emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL); | 878 | emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL); |
879 | } | 879 | } else if (!netdev_mc_empty(ndev)) { |
880 | if (!netdev_mc_empty(ndev)) { | ||
881 | struct netdev_hw_addr *ha; | 880 | struct netdev_hw_addr *ha; |
882 | 881 | ||
883 | mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); | 882 | mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); |
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 0721e72f9299..5af1c3e5032a 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c | |||
@@ -975,7 +975,6 @@ static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
975 | return -EINVAL; /* Cannot change this parameter when up */ | 975 | return -EINVAL; /* Cannot change this parameter when up */ |
976 | if ((ym = kmalloc(sizeof(struct yamdrv_ioctl_mcs), GFP_KERNEL)) == NULL) | 976 | if ((ym = kmalloc(sizeof(struct yamdrv_ioctl_mcs), GFP_KERNEL)) == NULL) |
977 | return -ENOBUFS; | 977 | return -ENOBUFS; |
978 | ym->bitrate = 9600; | ||
979 | if (copy_from_user(ym, ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs))) { | 978 | if (copy_from_user(ym, ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs))) { |
980 | kfree(ym); | 979 | kfree(ym); |
981 | return -EFAULT; | 980 | return -EFAULT; |
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c index 42e6deee6db5..0632d34905c7 100644 --- a/drivers/net/ieee802154/mrf24j40.c +++ b/drivers/net/ieee802154/mrf24j40.c | |||
@@ -82,7 +82,6 @@ struct mrf24j40 { | |||
82 | 82 | ||
83 | struct mutex buffer_mutex; /* only used to protect buf */ | 83 | struct mutex buffer_mutex; /* only used to protect buf */ |
84 | struct completion tx_complete; | 84 | struct completion tx_complete; |
85 | struct work_struct irqwork; | ||
86 | u8 *buf; /* 3 bytes. Used for SPI single-register transfers. */ | 85 | u8 *buf; /* 3 bytes. Used for SPI single-register transfers. */ |
87 | }; | 86 | }; |
88 | 87 | ||
@@ -344,6 +343,8 @@ static int mrf24j40_tx(struct ieee802154_dev *dev, struct sk_buff *skb) | |||
344 | if (ret) | 343 | if (ret) |
345 | goto err; | 344 | goto err; |
346 | 345 | ||
346 | INIT_COMPLETION(devrec->tx_complete); | ||
347 | |||
347 | /* Set TXNTRIG bit of TXNCON to send packet */ | 348 | /* Set TXNTRIG bit of TXNCON to send packet */ |
348 | ret = read_short_reg(devrec, REG_TXNCON, &val); | 349 | ret = read_short_reg(devrec, REG_TXNCON, &val); |
349 | if (ret) | 350 | if (ret) |
@@ -354,8 +355,6 @@ static int mrf24j40_tx(struct ieee802154_dev *dev, struct sk_buff *skb) | |||
354 | val |= 0x4; | 355 | val |= 0x4; |
355 | write_short_reg(devrec, REG_TXNCON, val); | 356 | write_short_reg(devrec, REG_TXNCON, val); |
356 | 357 | ||
357 | INIT_COMPLETION(devrec->tx_complete); | ||
358 | |||
359 | /* Wait for the device to send the TX complete interrupt. */ | 358 | /* Wait for the device to send the TX complete interrupt. */ |
360 | ret = wait_for_completion_interruptible_timeout( | 359 | ret = wait_for_completion_interruptible_timeout( |
361 | &devrec->tx_complete, | 360 | &devrec->tx_complete, |
@@ -590,17 +589,6 @@ static struct ieee802154_ops mrf24j40_ops = { | |||
590 | static irqreturn_t mrf24j40_isr(int irq, void *data) | 589 | static irqreturn_t mrf24j40_isr(int irq, void *data) |
591 | { | 590 | { |
592 | struct mrf24j40 *devrec = data; | 591 | struct mrf24j40 *devrec = data; |
593 | |||
594 | disable_irq_nosync(irq); | ||
595 | |||
596 | schedule_work(&devrec->irqwork); | ||
597 | |||
598 | return IRQ_HANDLED; | ||
599 | } | ||
600 | |||
601 | static void mrf24j40_isrwork(struct work_struct *work) | ||
602 | { | ||
603 | struct mrf24j40 *devrec = container_of(work, struct mrf24j40, irqwork); | ||
604 | u8 intstat; | 592 | u8 intstat; |
605 | int ret; | 593 | int ret; |
606 | 594 | ||
@@ -618,7 +606,7 @@ static void mrf24j40_isrwork(struct work_struct *work) | |||
618 | mrf24j40_handle_rx(devrec); | 606 | mrf24j40_handle_rx(devrec); |
619 | 607 | ||
620 | out: | 608 | out: |
621 | enable_irq(devrec->spi->irq); | 609 | return IRQ_HANDLED; |
622 | } | 610 | } |
623 | 611 | ||
624 | static int mrf24j40_probe(struct spi_device *spi) | 612 | static int mrf24j40_probe(struct spi_device *spi) |
@@ -642,7 +630,6 @@ static int mrf24j40_probe(struct spi_device *spi) | |||
642 | 630 | ||
643 | mutex_init(&devrec->buffer_mutex); | 631 | mutex_init(&devrec->buffer_mutex); |
644 | init_completion(&devrec->tx_complete); | 632 | init_completion(&devrec->tx_complete); |
645 | INIT_WORK(&devrec->irqwork, mrf24j40_isrwork); | ||
646 | devrec->spi = spi; | 633 | devrec->spi = spi; |
647 | spi_set_drvdata(spi, devrec); | 634 | spi_set_drvdata(spi, devrec); |
648 | 635 | ||
@@ -688,11 +675,12 @@ static int mrf24j40_probe(struct spi_device *spi) | |||
688 | val &= ~0x3; /* Clear RX mode (normal) */ | 675 | val &= ~0x3; /* Clear RX mode (normal) */ |
689 | write_short_reg(devrec, REG_RXMCR, val); | 676 | write_short_reg(devrec, REG_RXMCR, val); |
690 | 677 | ||
691 | ret = request_irq(spi->irq, | 678 | ret = request_threaded_irq(spi->irq, |
692 | mrf24j40_isr, | 679 | NULL, |
693 | IRQF_TRIGGER_FALLING, | 680 | mrf24j40_isr, |
694 | dev_name(&spi->dev), | 681 | IRQF_TRIGGER_LOW|IRQF_ONESHOT, |
695 | devrec); | 682 | dev_name(&spi->dev), |
683 | devrec); | ||
696 | 684 | ||
697 | if (ret) { | 685 | if (ret) { |
698 | dev_err(printdev(devrec), "Unable to get IRQ"); | 686 | dev_err(printdev(devrec), "Unable to get IRQ"); |
@@ -721,7 +709,6 @@ static int mrf24j40_remove(struct spi_device *spi) | |||
721 | dev_dbg(printdev(devrec), "remove\n"); | 709 | dev_dbg(printdev(devrec), "remove\n"); |
722 | 710 | ||
723 | free_irq(spi->irq, devrec); | 711 | free_irq(spi->irq, devrec); |
724 | flush_work(&devrec->irqwork); /* TODO: Is this the right call? */ | ||
725 | ieee802154_unregister_device(devrec->dev); | 712 | ieee802154_unregister_device(devrec->dev); |
726 | ieee802154_free_device(devrec->dev); | 713 | ieee802154_free_device(devrec->dev); |
727 | /* TODO: Will ieee802154_free_device() wait until ->xmit() is | 714 | /* TODO: Will ieee802154_free_device() wait until ->xmit() is |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 807815fc9968..7cb105c103fe 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1293,7 +1293,8 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile, | |||
1293 | if (unlikely(!noblock)) | 1293 | if (unlikely(!noblock)) |
1294 | add_wait_queue(&tfile->wq.wait, &wait); | 1294 | add_wait_queue(&tfile->wq.wait, &wait); |
1295 | while (len) { | 1295 | while (len) { |
1296 | current->state = TASK_INTERRUPTIBLE; | 1296 | if (unlikely(!noblock)) |
1297 | current->state = TASK_INTERRUPTIBLE; | ||
1297 | 1298 | ||
1298 | /* Read frames from the queue */ | 1299 | /* Read frames from the queue */ |
1299 | if (!(skb = skb_dequeue(&tfile->socket.sk->sk_receive_queue))) { | 1300 | if (!(skb = skb_dequeue(&tfile->socket.sk->sk_receive_queue))) { |
@@ -1320,9 +1321,10 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile, | |||
1320 | break; | 1321 | break; |
1321 | } | 1322 | } |
1322 | 1323 | ||
1323 | current->state = TASK_RUNNING; | 1324 | if (unlikely(!noblock)) { |
1324 | if (unlikely(!noblock)) | 1325 | current->state = TASK_RUNNING; |
1325 | remove_wait_queue(&tfile->wq.wait, &wait); | 1326 | remove_wait_queue(&tfile->wq.wait, &wait); |
1327 | } | ||
1326 | 1328 | ||
1327 | return ret; | 1329 | return ret; |
1328 | } | 1330 | } |
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 3569293df872..846cc19c04f2 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c | |||
@@ -36,8 +36,8 @@ | |||
36 | #define AX_RXHDR_L4_TYPE_TCP 16 | 36 | #define AX_RXHDR_L4_TYPE_TCP 16 |
37 | #define AX_RXHDR_L3CSUM_ERR 2 | 37 | #define AX_RXHDR_L3CSUM_ERR 2 |
38 | #define AX_RXHDR_L4CSUM_ERR 1 | 38 | #define AX_RXHDR_L4CSUM_ERR 1 |
39 | #define AX_RXHDR_CRC_ERR ((u32)BIT(31)) | 39 | #define AX_RXHDR_CRC_ERR ((u32)BIT(29)) |
40 | #define AX_RXHDR_DROP_ERR ((u32)BIT(30)) | 40 | #define AX_RXHDR_DROP_ERR ((u32)BIT(31)) |
41 | #define AX_ACCESS_MAC 0x01 | 41 | #define AX_ACCESS_MAC 0x01 |
42 | #define AX_ACCESS_PHY 0x02 | 42 | #define AX_ACCESS_PHY 0x02 |
43 | #define AX_ACCESS_EEPROM 0x04 | 43 | #define AX_ACCESS_EEPROM 0x04 |
@@ -1406,6 +1406,19 @@ static const struct driver_info sitecom_info = { | |||
1406 | .tx_fixup = ax88179_tx_fixup, | 1406 | .tx_fixup = ax88179_tx_fixup, |
1407 | }; | 1407 | }; |
1408 | 1408 | ||
1409 | static const struct driver_info samsung_info = { | ||
1410 | .description = "Samsung USB Ethernet Adapter", | ||
1411 | .bind = ax88179_bind, | ||
1412 | .unbind = ax88179_unbind, | ||
1413 | .status = ax88179_status, | ||
1414 | .link_reset = ax88179_link_reset, | ||
1415 | .reset = ax88179_reset, | ||
1416 | .stop = ax88179_stop, | ||
1417 | .flags = FLAG_ETHER | FLAG_FRAMING_AX, | ||
1418 | .rx_fixup = ax88179_rx_fixup, | ||
1419 | .tx_fixup = ax88179_tx_fixup, | ||
1420 | }; | ||
1421 | |||
1409 | static const struct usb_device_id products[] = { | 1422 | static const struct usb_device_id products[] = { |
1410 | { | 1423 | { |
1411 | /* ASIX AX88179 10/100/1000 */ | 1424 | /* ASIX AX88179 10/100/1000 */ |
@@ -1418,7 +1431,11 @@ static const struct usb_device_id products[] = { | |||
1418 | }, { | 1431 | }, { |
1419 | /* Sitecom USB 3.0 to Gigabit Adapter */ | 1432 | /* Sitecom USB 3.0 to Gigabit Adapter */ |
1420 | USB_DEVICE(0x0df6, 0x0072), | 1433 | USB_DEVICE(0x0df6, 0x0072), |
1421 | .driver_info = (unsigned long) &sitecom_info, | 1434 | .driver_info = (unsigned long)&sitecom_info, |
1435 | }, { | ||
1436 | /* Samsung USB Ethernet Adapter */ | ||
1437 | USB_DEVICE(0x04e8, 0xa100), | ||
1438 | .driver_info = (unsigned long)&samsung_info, | ||
1422 | }, | 1439 | }, |
1423 | { }, | 1440 | { }, |
1424 | }; | 1441 | }; |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 3d6aaf79d8b2..818ce90185b5 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -714,6 +714,7 @@ static const struct usb_device_id products[] = { | |||
714 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ | 714 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ |
715 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ | 715 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ |
716 | {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ | 716 | {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ |
717 | {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */ | ||
717 | {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */ | 718 | {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */ |
718 | 719 | ||
719 | /* 4. Gobi 1000 devices */ | 720 | /* 4. Gobi 1000 devices */ |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index bf94e10a37c8..90a429b7ebad 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1688,8 +1688,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1688 | if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) && | 1688 | if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) && |
1689 | !(info->flags & FLAG_MULTI_PACKET)) { | 1689 | !(info->flags & FLAG_MULTI_PACKET)) { |
1690 | dev->padding_pkt = kzalloc(1, GFP_KERNEL); | 1690 | dev->padding_pkt = kzalloc(1, GFP_KERNEL); |
1691 | if (!dev->padding_pkt) | 1691 | if (!dev->padding_pkt) { |
1692 | status = -ENOMEM; | ||
1692 | goto out4; | 1693 | goto out4; |
1694 | } | ||
1693 | } | 1695 | } |
1694 | 1696 | ||
1695 | status = register_netdev (net); | 1697 | status = register_netdev (net); |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index defec2b3c5a4..9fbdfcd1e1a0 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -938,7 +938,9 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) | |||
938 | return -EINVAL; | 938 | return -EINVAL; |
939 | } else { | 939 | } else { |
940 | vi->curr_queue_pairs = queue_pairs; | 940 | vi->curr_queue_pairs = queue_pairs; |
941 | schedule_delayed_work(&vi->refill, 0); | 941 | /* virtnet_open() will refill when device is going to up. */ |
942 | if (dev->flags & IFF_UP) | ||
943 | schedule_delayed_work(&vi->refill, 0); | ||
942 | } | 944 | } |
943 | 945 | ||
944 | return 0; | 946 | return 0; |
@@ -1116,6 +1118,11 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, | |||
1116 | { | 1118 | { |
1117 | struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); | 1119 | struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); |
1118 | 1120 | ||
1121 | mutex_lock(&vi->config_lock); | ||
1122 | |||
1123 | if (!vi->config_enable) | ||
1124 | goto done; | ||
1125 | |||
1119 | switch(action & ~CPU_TASKS_FROZEN) { | 1126 | switch(action & ~CPU_TASKS_FROZEN) { |
1120 | case CPU_ONLINE: | 1127 | case CPU_ONLINE: |
1121 | case CPU_DOWN_FAILED: | 1128 | case CPU_DOWN_FAILED: |
@@ -1128,6 +1135,9 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, | |||
1128 | default: | 1135 | default: |
1129 | break; | 1136 | break; |
1130 | } | 1137 | } |
1138 | |||
1139 | done: | ||
1140 | mutex_unlock(&vi->config_lock); | ||
1131 | return NOTIFY_OK; | 1141 | return NOTIFY_OK; |
1132 | } | 1142 | } |
1133 | 1143 | ||
@@ -1733,7 +1743,9 @@ static int virtnet_restore(struct virtio_device *vdev) | |||
1733 | vi->config_enable = true; | 1743 | vi->config_enable = true; |
1734 | mutex_unlock(&vi->config_lock); | 1744 | mutex_unlock(&vi->config_lock); |
1735 | 1745 | ||
1746 | rtnl_lock(); | ||
1736 | virtnet_set_queues(vi, vi->curr_queue_pairs); | 1747 | virtnet_set_queues(vi, vi->curr_queue_pairs); |
1748 | rtnl_unlock(); | ||
1737 | 1749 | ||
1738 | return 0; | 1750 | return 0; |
1739 | } | 1751 | } |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 3f0c4f268751..bcfff0d62de4 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -1972,6 +1972,7 @@ fst_get_iface(struct fst_card_info *card, struct fst_port_info *port, | |||
1972 | } | 1972 | } |
1973 | 1973 | ||
1974 | i = port->index; | 1974 | i = port->index; |
1975 | memset(&sync, 0, sizeof(sync)); | ||
1975 | sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed); | 1976 | sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed); |
1976 | /* Lucky card and linux use same encoding here */ | 1977 | /* Lucky card and linux use same encoding here */ |
1977 | sync.clock_type = FST_RDB(card, portConfig[i].internalClock) == | 1978 | sync.clock_type = FST_RDB(card, portConfig[i].internalClock) == |
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 6a24a5a70cc7..4c0a69779b89 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c | |||
@@ -355,6 +355,7 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
355 | ifr->ifr_settings.size = size; /* data size wanted */ | 355 | ifr->ifr_settings.size = size; /* data size wanted */ |
356 | return -ENOBUFS; | 356 | return -ENOBUFS; |
357 | } | 357 | } |
358 | memset(&line, 0, sizeof(line)); | ||
358 | line.clock_type = get_status(port)->clocking; | 359 | line.clock_type = get_status(port)->clocking; |
359 | line.clock_rate = 0; | 360 | line.clock_rate = 0; |
360 | line.loopback = 0; | 361 | line.loopback = 0; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index e4f65900132d..709301f88dcd 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -208,6 +208,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) | |||
208 | struct ath_hw *ah = sc->sc_ah; | 208 | struct ath_hw *ah = sc->sc_ah; |
209 | struct ath_common *common = ath9k_hw_common(ah); | 209 | struct ath_common *common = ath9k_hw_common(ah); |
210 | unsigned long flags; | 210 | unsigned long flags; |
211 | int i; | ||
211 | 212 | ||
212 | if (ath_startrecv(sc) != 0) { | 213 | if (ath_startrecv(sc) != 0) { |
213 | ath_err(common, "Unable to restart recv logic\n"); | 214 | ath_err(common, "Unable to restart recv logic\n"); |
@@ -235,6 +236,15 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) | |||
235 | } | 236 | } |
236 | work: | 237 | work: |
237 | ath_restart_work(sc); | 238 | ath_restart_work(sc); |
239 | |||
240 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { | ||
241 | if (!ATH_TXQ_SETUP(sc, i)) | ||
242 | continue; | ||
243 | |||
244 | spin_lock_bh(&sc->tx.txq[i].axq_lock); | ||
245 | ath_txq_schedule(sc, &sc->tx.txq[i]); | ||
246 | spin_unlock_bh(&sc->tx.txq[i].axq_lock); | ||
247 | } | ||
238 | } | 248 | } |
239 | 249 | ||
240 | ieee80211_wake_queues(sc->hw); | 250 | ieee80211_wake_queues(sc->hw); |
@@ -539,21 +549,10 @@ chip_reset: | |||
539 | 549 | ||
540 | static int ath_reset(struct ath_softc *sc) | 550 | static int ath_reset(struct ath_softc *sc) |
541 | { | 551 | { |
542 | int i, r; | 552 | int r; |
543 | 553 | ||
544 | ath9k_ps_wakeup(sc); | 554 | ath9k_ps_wakeup(sc); |
545 | |||
546 | r = ath_reset_internal(sc, NULL); | 555 | r = ath_reset_internal(sc, NULL); |
547 | |||
548 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { | ||
549 | if (!ATH_TXQ_SETUP(sc, i)) | ||
550 | continue; | ||
551 | |||
552 | spin_lock_bh(&sc->tx.txq[i].axq_lock); | ||
553 | ath_txq_schedule(sc, &sc->tx.txq[i]); | ||
554 | spin_unlock_bh(&sc->tx.txq[i].axq_lock); | ||
555 | } | ||
556 | |||
557 | ath9k_ps_restore(sc); | 556 | ath9k_ps_restore(sc); |
558 | 557 | ||
559 | return r; | 558 | return r; |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 5ac713d2ff5d..dd30452df966 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1969,15 +1969,18 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, | |||
1969 | static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, | 1969 | static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, |
1970 | struct ath_atx_tid *tid, struct sk_buff *skb) | 1970 | struct ath_atx_tid *tid, struct sk_buff *skb) |
1971 | { | 1971 | { |
1972 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | ||
1972 | struct ath_frame_info *fi = get_frame_info(skb); | 1973 | struct ath_frame_info *fi = get_frame_info(skb); |
1973 | struct list_head bf_head; | 1974 | struct list_head bf_head; |
1974 | struct ath_buf *bf; | 1975 | struct ath_buf *bf = fi->bf; |
1975 | |||
1976 | bf = fi->bf; | ||
1977 | 1976 | ||
1978 | INIT_LIST_HEAD(&bf_head); | 1977 | INIT_LIST_HEAD(&bf_head); |
1979 | list_add_tail(&bf->list, &bf_head); | 1978 | list_add_tail(&bf->list, &bf_head); |
1980 | bf->bf_state.bf_type = 0; | 1979 | bf->bf_state.bf_type = 0; |
1980 | if (tid && (tx_info->flags & IEEE80211_TX_CTL_AMPDU)) { | ||
1981 | bf->bf_state.bf_type = BUF_AMPDU; | ||
1982 | ath_tx_addto_baw(sc, tid, bf); | ||
1983 | } | ||
1981 | 1984 | ||
1982 | bf->bf_next = NULL; | 1985 | bf->bf_next = NULL; |
1983 | bf->bf_lastbf = bf; | 1986 | bf->bf_lastbf = bf; |
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c index 899cad34ccd3..755a0c8edfe1 100644 --- a/drivers/net/wireless/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/cw1200/cw1200_spi.c | |||
@@ -237,7 +237,9 @@ static irqreturn_t cw1200_spi_irq_handler(int irq, void *dev_id) | |||
237 | struct hwbus_priv *self = dev_id; | 237 | struct hwbus_priv *self = dev_id; |
238 | 238 | ||
239 | if (self->core) { | 239 | if (self->core) { |
240 | cw1200_spi_lock(self); | ||
240 | cw1200_irq_handler(self->core); | 241 | cw1200_irq_handler(self->core); |
242 | cw1200_spi_unlock(self); | ||
241 | return IRQ_HANDLED; | 243 | return IRQ_HANDLED; |
242 | } else { | 244 | } else { |
243 | return IRQ_NONE; | 245 | return IRQ_NONE; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 30d45e2fc193..8ac305be68f4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -240,6 +240,12 @@ const struct iwl_cfg iwl6035_2agn_cfg = { | |||
240 | .ht_params = &iwl6000_ht_params, | 240 | .ht_params = &iwl6000_ht_params, |
241 | }; | 241 | }; |
242 | 242 | ||
243 | const struct iwl_cfg iwl6035_2agn_sff_cfg = { | ||
244 | .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN", | ||
245 | IWL_DEVICE_6035, | ||
246 | .ht_params = &iwl6000_ht_params, | ||
247 | }; | ||
248 | |||
243 | const struct iwl_cfg iwl1030_bgn_cfg = { | 249 | const struct iwl_cfg iwl1030_bgn_cfg = { |
244 | .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN", | 250 | .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN", |
245 | IWL_DEVICE_6030, | 251 | IWL_DEVICE_6030, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index e4d370bff306..b03c25e14903 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h | |||
@@ -280,6 +280,7 @@ extern const struct iwl_cfg iwl2000_2bgn_cfg; | |||
280 | extern const struct iwl_cfg iwl2000_2bgn_d_cfg; | 280 | extern const struct iwl_cfg iwl2000_2bgn_d_cfg; |
281 | extern const struct iwl_cfg iwl2030_2bgn_cfg; | 281 | extern const struct iwl_cfg iwl2030_2bgn_cfg; |
282 | extern const struct iwl_cfg iwl6035_2agn_cfg; | 282 | extern const struct iwl_cfg iwl6035_2agn_cfg; |
283 | extern const struct iwl_cfg iwl6035_2agn_sff_cfg; | ||
283 | extern const struct iwl_cfg iwl105_bgn_cfg; | 284 | extern const struct iwl_cfg iwl105_bgn_cfg; |
284 | extern const struct iwl_cfg iwl105_bgn_d_cfg; | 285 | extern const struct iwl_cfg iwl105_bgn_d_cfg; |
285 | extern const struct iwl_cfg iwl135_bgn_cfg; | 286 | extern const struct iwl_cfg iwl135_bgn_cfg; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index dd57a36ecb10..80b47508647c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -601,8 +601,10 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans, | |||
601 | { | 601 | { |
602 | int ret; | 602 | int ret; |
603 | 603 | ||
604 | WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, | 604 | if (trans->state != IWL_TRANS_FW_ALIVE) { |
605 | "%s bad state = %d", __func__, trans->state); | 605 | IWL_ERR(trans, "%s bad state = %d", __func__, trans->state); |
606 | return -EIO; | ||
607 | } | ||
606 | 608 | ||
607 | if (!(cmd->flags & CMD_ASYNC)) | 609 | if (!(cmd->flags & CMD_ASYNC)) |
608 | lock_map_acquire_read(&trans->sync_cmd_lockdep_map); | 610 | lock_map_acquire_read(&trans->sync_cmd_lockdep_map); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c index 21407a353a3b..d58e393324ef 100644 --- a/drivers/net/wireless/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/iwlwifi/mvm/power.c | |||
@@ -273,7 +273,10 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, | |||
273 | if (!mvmvif->queue_params[ac].uapsd) | 273 | if (!mvmvif->queue_params[ac].uapsd) |
274 | continue; | 274 | continue; |
275 | 275 | ||
276 | cmd->flags |= cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK); | 276 | if (mvm->cur_ucode != IWL_UCODE_WOWLAN) |
277 | cmd->flags |= | ||
278 | cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK); | ||
279 | |||
277 | cmd->uapsd_ac_flags |= BIT(ac); | 280 | cmd->uapsd_ac_flags |= BIT(ac); |
278 | 281 | ||
279 | /* QNDP TID - the highest TID with no admission control */ | 282 | /* QNDP TID - the highest TID with no admission control */ |
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index 9a7ab8495300..621fb71f282a 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -394,6 +394,11 @@ static bool iwl_mvm_scan_abort_notif(struct iwl_notif_wait_data *notif_wait, | |||
394 | return false; | 394 | return false; |
395 | } | 395 | } |
396 | 396 | ||
397 | /* | ||
398 | * If scan cannot be aborted, it means that we had a | ||
399 | * SCAN_COMPLETE_NOTIFICATION in the pipe and it called | ||
400 | * ieee80211_scan_completed already. | ||
401 | */ | ||
397 | IWL_DEBUG_SCAN(mvm, "Scan cannot be aborted, exit now: %d\n", | 402 | IWL_DEBUG_SCAN(mvm, "Scan cannot be aborted, exit now: %d\n", |
398 | *resp); | 403 | *resp); |
399 | return true; | 404 | return true; |
@@ -417,14 +422,19 @@ void iwl_mvm_cancel_scan(struct iwl_mvm *mvm) | |||
417 | SCAN_COMPLETE_NOTIFICATION }; | 422 | SCAN_COMPLETE_NOTIFICATION }; |
418 | int ret; | 423 | int ret; |
419 | 424 | ||
425 | if (mvm->scan_status == IWL_MVM_SCAN_NONE) | ||
426 | return; | ||
427 | |||
420 | iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_abort, | 428 | iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_abort, |
421 | scan_abort_notif, | 429 | scan_abort_notif, |
422 | ARRAY_SIZE(scan_abort_notif), | 430 | ARRAY_SIZE(scan_abort_notif), |
423 | iwl_mvm_scan_abort_notif, NULL); | 431 | iwl_mvm_scan_abort_notif, NULL); |
424 | 432 | ||
425 | ret = iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_CMD, CMD_SYNC, 0, NULL); | 433 | ret = iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_CMD, |
434 | CMD_SYNC | CMD_SEND_IN_RFKILL, 0, NULL); | ||
426 | if (ret) { | 435 | if (ret) { |
427 | IWL_ERR(mvm, "Couldn't send SCAN_ABORT_CMD: %d\n", ret); | 436 | IWL_ERR(mvm, "Couldn't send SCAN_ABORT_CMD: %d\n", ret); |
437 | /* mac80211's state will be cleaned in the fw_restart flow */ | ||
428 | goto out_remove_notif; | 438 | goto out_remove_notif; |
429 | } | 439 | } |
430 | 440 | ||
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index dc02cb9792af..26108a1a29fa 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c | |||
@@ -139,13 +139,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
139 | 139 | ||
140 | /* 6x00 Series */ | 140 | /* 6x00 Series */ |
141 | {IWL_PCI_DEVICE(0x422B, 0x1101, iwl6000_3agn_cfg)}, | 141 | {IWL_PCI_DEVICE(0x422B, 0x1101, iwl6000_3agn_cfg)}, |
142 | {IWL_PCI_DEVICE(0x422B, 0x1108, iwl6000_3agn_cfg)}, | ||
142 | {IWL_PCI_DEVICE(0x422B, 0x1121, iwl6000_3agn_cfg)}, | 143 | {IWL_PCI_DEVICE(0x422B, 0x1121, iwl6000_3agn_cfg)}, |
144 | {IWL_PCI_DEVICE(0x422B, 0x1128, iwl6000_3agn_cfg)}, | ||
143 | {IWL_PCI_DEVICE(0x422C, 0x1301, iwl6000i_2agn_cfg)}, | 145 | {IWL_PCI_DEVICE(0x422C, 0x1301, iwl6000i_2agn_cfg)}, |
144 | {IWL_PCI_DEVICE(0x422C, 0x1306, iwl6000i_2abg_cfg)}, | 146 | {IWL_PCI_DEVICE(0x422C, 0x1306, iwl6000i_2abg_cfg)}, |
145 | {IWL_PCI_DEVICE(0x422C, 0x1307, iwl6000i_2bg_cfg)}, | 147 | {IWL_PCI_DEVICE(0x422C, 0x1307, iwl6000i_2bg_cfg)}, |
146 | {IWL_PCI_DEVICE(0x422C, 0x1321, iwl6000i_2agn_cfg)}, | 148 | {IWL_PCI_DEVICE(0x422C, 0x1321, iwl6000i_2agn_cfg)}, |
147 | {IWL_PCI_DEVICE(0x422C, 0x1326, iwl6000i_2abg_cfg)}, | 149 | {IWL_PCI_DEVICE(0x422C, 0x1326, iwl6000i_2abg_cfg)}, |
148 | {IWL_PCI_DEVICE(0x4238, 0x1111, iwl6000_3agn_cfg)}, | 150 | {IWL_PCI_DEVICE(0x4238, 0x1111, iwl6000_3agn_cfg)}, |
151 | {IWL_PCI_DEVICE(0x4238, 0x1118, iwl6000_3agn_cfg)}, | ||
149 | {IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)}, | 152 | {IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)}, |
150 | {IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)}, | 153 | {IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)}, |
151 | 154 | ||
@@ -153,12 +156,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
153 | {IWL_PCI_DEVICE(0x0082, 0x1301, iwl6005_2agn_cfg)}, | 156 | {IWL_PCI_DEVICE(0x0082, 0x1301, iwl6005_2agn_cfg)}, |
154 | {IWL_PCI_DEVICE(0x0082, 0x1306, iwl6005_2abg_cfg)}, | 157 | {IWL_PCI_DEVICE(0x0082, 0x1306, iwl6005_2abg_cfg)}, |
155 | {IWL_PCI_DEVICE(0x0082, 0x1307, iwl6005_2bg_cfg)}, | 158 | {IWL_PCI_DEVICE(0x0082, 0x1307, iwl6005_2bg_cfg)}, |
159 | {IWL_PCI_DEVICE(0x0082, 0x1308, iwl6005_2agn_cfg)}, | ||
156 | {IWL_PCI_DEVICE(0x0082, 0x1321, iwl6005_2agn_cfg)}, | 160 | {IWL_PCI_DEVICE(0x0082, 0x1321, iwl6005_2agn_cfg)}, |
157 | {IWL_PCI_DEVICE(0x0082, 0x1326, iwl6005_2abg_cfg)}, | 161 | {IWL_PCI_DEVICE(0x0082, 0x1326, iwl6005_2abg_cfg)}, |
162 | {IWL_PCI_DEVICE(0x0082, 0x1328, iwl6005_2agn_cfg)}, | ||
158 | {IWL_PCI_DEVICE(0x0085, 0x1311, iwl6005_2agn_cfg)}, | 163 | {IWL_PCI_DEVICE(0x0085, 0x1311, iwl6005_2agn_cfg)}, |
164 | {IWL_PCI_DEVICE(0x0085, 0x1318, iwl6005_2agn_cfg)}, | ||
159 | {IWL_PCI_DEVICE(0x0085, 0x1316, iwl6005_2abg_cfg)}, | 165 | {IWL_PCI_DEVICE(0x0085, 0x1316, iwl6005_2abg_cfg)}, |
160 | {IWL_PCI_DEVICE(0x0082, 0xC020, iwl6005_2agn_sff_cfg)}, | 166 | {IWL_PCI_DEVICE(0x0082, 0xC020, iwl6005_2agn_sff_cfg)}, |
161 | {IWL_PCI_DEVICE(0x0085, 0xC220, iwl6005_2agn_sff_cfg)}, | 167 | {IWL_PCI_DEVICE(0x0085, 0xC220, iwl6005_2agn_sff_cfg)}, |
168 | {IWL_PCI_DEVICE(0x0085, 0xC228, iwl6005_2agn_sff_cfg)}, | ||
162 | {IWL_PCI_DEVICE(0x0082, 0x4820, iwl6005_2agn_d_cfg)}, | 169 | {IWL_PCI_DEVICE(0x0082, 0x4820, iwl6005_2agn_d_cfg)}, |
163 | {IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_2agn_mow1_cfg)},/* low 5GHz active */ | 170 | {IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_2agn_mow1_cfg)},/* low 5GHz active */ |
164 | {IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_2agn_mow2_cfg)},/* high 5GHz active */ | 171 | {IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_2agn_mow2_cfg)},/* high 5GHz active */ |
@@ -240,8 +247,11 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
240 | 247 | ||
241 | /* 6x35 Series */ | 248 | /* 6x35 Series */ |
242 | {IWL_PCI_DEVICE(0x088E, 0x4060, iwl6035_2agn_cfg)}, | 249 | {IWL_PCI_DEVICE(0x088E, 0x4060, iwl6035_2agn_cfg)}, |
250 | {IWL_PCI_DEVICE(0x088E, 0x406A, iwl6035_2agn_sff_cfg)}, | ||
243 | {IWL_PCI_DEVICE(0x088F, 0x4260, iwl6035_2agn_cfg)}, | 251 | {IWL_PCI_DEVICE(0x088F, 0x4260, iwl6035_2agn_cfg)}, |
252 | {IWL_PCI_DEVICE(0x088F, 0x426A, iwl6035_2agn_sff_cfg)}, | ||
244 | {IWL_PCI_DEVICE(0x088E, 0x4460, iwl6035_2agn_cfg)}, | 253 | {IWL_PCI_DEVICE(0x088E, 0x4460, iwl6035_2agn_cfg)}, |
254 | {IWL_PCI_DEVICE(0x088E, 0x446A, iwl6035_2agn_sff_cfg)}, | ||
245 | {IWL_PCI_DEVICE(0x088E, 0x4860, iwl6035_2agn_cfg)}, | 255 | {IWL_PCI_DEVICE(0x088E, 0x4860, iwl6035_2agn_cfg)}, |
246 | {IWL_PCI_DEVICE(0x088F, 0x5260, iwl6035_2agn_cfg)}, | 256 | {IWL_PCI_DEVICE(0x088F, 0x5260, iwl6035_2agn_cfg)}, |
247 | 257 | ||
@@ -260,54 +270,86 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
260 | #if IS_ENABLED(CONFIG_IWLMVM) | 270 | #if IS_ENABLED(CONFIG_IWLMVM) |
261 | /* 7000 Series */ | 271 | /* 7000 Series */ |
262 | {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)}, | 272 | {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)}, |
273 | {IWL_PCI_DEVICE(0x08B1, 0x4072, iwl7260_2ac_cfg)}, | ||
263 | {IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)}, | 274 | {IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)}, |
264 | {IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)}, | 275 | {IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)}, |
276 | {IWL_PCI_DEVICE(0x08B1, 0x406A, iwl7260_2n_cfg)}, | ||
265 | {IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)}, | 277 | {IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)}, |
266 | {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)}, | 278 | {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)}, |
267 | {IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)}, | 279 | {IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)}, |
268 | {IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)}, | 280 | {IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)}, |
281 | {IWL_PCI_DEVICE(0x08B2, 0x4272, iwl7260_2ac_cfg)}, | ||
269 | {IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)}, | 282 | {IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)}, |
283 | {IWL_PCI_DEVICE(0x08B2, 0x426A, iwl7260_2n_cfg)}, | ||
270 | {IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)}, | 284 | {IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)}, |
271 | {IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)}, | 285 | {IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)}, |
286 | {IWL_PCI_DEVICE(0x08B1, 0x4472, iwl7260_2ac_cfg)}, | ||
272 | {IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)}, | 287 | {IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)}, |
288 | {IWL_PCI_DEVICE(0x08B1, 0x446A, iwl7260_2n_cfg)}, | ||
273 | {IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)}, | 289 | {IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)}, |
274 | {IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)}, | 290 | {IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)}, |
275 | {IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)}, | 291 | {IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)}, |
276 | {IWL_PCI_DEVICE(0x08B1, 0x4A70, iwl7260_2ac_cfg_high_temp)}, | 292 | {IWL_PCI_DEVICE(0x08B1, 0x4A70, iwl7260_2ac_cfg_high_temp)}, |
277 | {IWL_PCI_DEVICE(0x08B1, 0x4A6E, iwl7260_2ac_cfg_high_temp)}, | 293 | {IWL_PCI_DEVICE(0x08B1, 0x4A6E, iwl7260_2ac_cfg_high_temp)}, |
278 | {IWL_PCI_DEVICE(0x08B1, 0x4A6C, iwl7260_2ac_cfg_high_temp)}, | 294 | {IWL_PCI_DEVICE(0x08B1, 0x4A6C, iwl7260_2ac_cfg_high_temp)}, |
295 | {IWL_PCI_DEVICE(0x08B1, 0x4570, iwl7260_2ac_cfg)}, | ||
296 | {IWL_PCI_DEVICE(0x08B1, 0x4560, iwl7260_2n_cfg)}, | ||
297 | {IWL_PCI_DEVICE(0x08B2, 0x4370, iwl7260_2ac_cfg)}, | ||
298 | {IWL_PCI_DEVICE(0x08B2, 0x4360, iwl7260_2n_cfg)}, | ||
299 | {IWL_PCI_DEVICE(0x08B1, 0x5070, iwl7260_2ac_cfg)}, | ||
279 | {IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)}, | 300 | {IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)}, |
301 | {IWL_PCI_DEVICE(0x08B1, 0x402A, iwl7260_2n_cfg)}, | ||
280 | {IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)}, | 302 | {IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)}, |
281 | {IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)}, | 303 | {IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)}, |
282 | {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)}, | 304 | {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)}, |
305 | {IWL_PCI_DEVICE(0x08B1, 0xC072, iwl7260_2ac_cfg)}, | ||
283 | {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)}, | 306 | {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)}, |
284 | {IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)}, | 307 | {IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)}, |
308 | {IWL_PCI_DEVICE(0x08B1, 0xC06A, iwl7260_2n_cfg)}, | ||
285 | {IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)}, | 309 | {IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)}, |
286 | {IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)}, | 310 | {IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)}, |
287 | {IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)}, | 311 | {IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)}, |
312 | {IWL_PCI_DEVICE(0x08B1, 0xC770, iwl7260_2ac_cfg)}, | ||
313 | {IWL_PCI_DEVICE(0x08B1, 0xC760, iwl7260_2n_cfg)}, | ||
288 | {IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)}, | 314 | {IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)}, |
315 | {IWL_PCI_DEVICE(0x08B2, 0xC272, iwl7260_2ac_cfg)}, | ||
289 | {IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)}, | 316 | {IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)}, |
317 | {IWL_PCI_DEVICE(0x08B2, 0xC26A, iwl7260_n_cfg)}, | ||
290 | {IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)}, | 318 | {IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)}, |
291 | {IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)}, | 319 | {IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)}, |
320 | {IWL_PCI_DEVICE(0x08B1, 0xC472, iwl7260_2ac_cfg)}, | ||
292 | {IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)}, | 321 | {IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)}, |
293 | {IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)}, | 322 | {IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)}, |
323 | {IWL_PCI_DEVICE(0x08B1, 0xC570, iwl7260_2ac_cfg)}, | ||
324 | {IWL_PCI_DEVICE(0x08B1, 0xC560, iwl7260_2n_cfg)}, | ||
325 | {IWL_PCI_DEVICE(0x08B2, 0xC370, iwl7260_2ac_cfg)}, | ||
326 | {IWL_PCI_DEVICE(0x08B1, 0xC360, iwl7260_2n_cfg)}, | ||
294 | {IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)}, | 327 | {IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)}, |
328 | {IWL_PCI_DEVICE(0x08B1, 0xC02A, iwl7260_2n_cfg)}, | ||
295 | {IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)}, | 329 | {IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)}, |
296 | {IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)}, | 330 | {IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)}, |
297 | 331 | ||
298 | /* 3160 Series */ | 332 | /* 3160 Series */ |
299 | {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)}, | 333 | {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)}, |
334 | {IWL_PCI_DEVICE(0x08B3, 0x0072, iwl3160_2ac_cfg)}, | ||
300 | {IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)}, | 335 | {IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)}, |
336 | {IWL_PCI_DEVICE(0x08B3, 0x0172, iwl3160_2ac_cfg)}, | ||
301 | {IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)}, | 337 | {IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)}, |
302 | {IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)}, | 338 | {IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)}, |
303 | {IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)}, | 339 | {IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)}, |
340 | {IWL_PCI_DEVICE(0x08B4, 0x0272, iwl3160_2ac_cfg)}, | ||
304 | {IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)}, | 341 | {IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)}, |
342 | {IWL_PCI_DEVICE(0x08B3, 0x0472, iwl3160_2ac_cfg)}, | ||
343 | {IWL_PCI_DEVICE(0x08B4, 0x0370, iwl3160_2ac_cfg)}, | ||
305 | {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)}, | 344 | {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)}, |
345 | {IWL_PCI_DEVICE(0x08B3, 0x8072, iwl3160_2ac_cfg)}, | ||
306 | {IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)}, | 346 | {IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)}, |
347 | {IWL_PCI_DEVICE(0x08B3, 0x8172, iwl3160_2ac_cfg)}, | ||
307 | {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)}, | 348 | {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)}, |
308 | {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)}, | 349 | {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)}, |
309 | {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)}, | 350 | {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)}, |
310 | {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)}, | 351 | {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)}, |
352 | {IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)}, | ||
311 | #endif /* CONFIG_IWLMVM */ | 353 | #endif /* CONFIG_IWLMVM */ |
312 | 354 | ||
313 | {0} | 355 | {0} |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index bad95d28d50d..c3f904d422b0 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -1401,6 +1401,10 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, | |||
1401 | spin_lock_init(&trans_pcie->reg_lock); | 1401 | spin_lock_init(&trans_pcie->reg_lock); |
1402 | init_waitqueue_head(&trans_pcie->ucode_write_waitq); | 1402 | init_waitqueue_head(&trans_pcie->ucode_write_waitq); |
1403 | 1403 | ||
1404 | err = pci_enable_device(pdev); | ||
1405 | if (err) | ||
1406 | goto out_no_pci; | ||
1407 | |||
1404 | if (!cfg->base_params->pcie_l1_allowed) { | 1408 | if (!cfg->base_params->pcie_l1_allowed) { |
1405 | /* | 1409 | /* |
1406 | * W/A - seems to solve weird behavior. We need to remove this | 1410 | * W/A - seems to solve weird behavior. We need to remove this |
@@ -1412,10 +1416,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, | |||
1412 | PCIE_LINK_STATE_CLKPM); | 1416 | PCIE_LINK_STATE_CLKPM); |
1413 | } | 1417 | } |
1414 | 1418 | ||
1415 | err = pci_enable_device(pdev); | ||
1416 | if (err) | ||
1417 | goto out_no_pci; | ||
1418 | |||
1419 | pci_set_master(pdev); | 1419 | pci_set_master(pdev); |
1420 | 1420 | ||
1421 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36)); | 1421 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36)); |
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index f45eb29c2ede..1424335163b9 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
@@ -1102,6 +1102,8 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo, | |||
1102 | * non-AGG queue. | 1102 | * non-AGG queue. |
1103 | */ | 1103 | */ |
1104 | iwl_clear_bits_prph(trans, SCD_AGGR_SEL, BIT(txq_id)); | 1104 | iwl_clear_bits_prph(trans, SCD_AGGR_SEL, BIT(txq_id)); |
1105 | |||
1106 | ssn = trans_pcie->txq[txq_id].q.read_ptr; | ||
1105 | } | 1107 | } |
1106 | 1108 | ||
1107 | /* Place first TFD at index corresponding to start sequence number. | 1109 | /* Place first TFD at index corresponding to start sequence number. |
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 9d7c0e6c4fc7..37f873bb342f 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c | |||
@@ -1422,13 +1422,19 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) | |||
1422 | */ | 1422 | */ |
1423 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) | 1423 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) |
1424 | { | 1424 | { |
1425 | int ret = 0; | ||
1426 | |||
1425 | if (!priv->media_connected) | 1427 | if (!priv->media_connected) |
1426 | return 0; | 1428 | return 0; |
1427 | 1429 | ||
1428 | switch (priv->bss_mode) { | 1430 | switch (priv->bss_mode) { |
1429 | case NL80211_IFTYPE_STATION: | 1431 | case NL80211_IFTYPE_STATION: |
1430 | case NL80211_IFTYPE_P2P_CLIENT: | 1432 | case NL80211_IFTYPE_P2P_CLIENT: |
1431 | return mwifiex_deauthenticate_infra(priv, mac); | 1433 | ret = mwifiex_deauthenticate_infra(priv, mac); |
1434 | if (ret) | ||
1435 | cfg80211_disconnected(priv->netdev, 0, NULL, 0, | ||
1436 | GFP_KERNEL); | ||
1437 | break; | ||
1432 | case NL80211_IFTYPE_ADHOC: | 1438 | case NL80211_IFTYPE_ADHOC: |
1433 | return mwifiex_send_cmd_sync(priv, | 1439 | return mwifiex_send_cmd_sync(priv, |
1434 | HostCmd_CMD_802_11_AD_HOC_STOP, | 1440 | HostCmd_CMD_802_11_AD_HOC_STOP, |
@@ -1440,7 +1446,7 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) | |||
1440 | break; | 1446 | break; |
1441 | } | 1447 | } |
1442 | 1448 | ||
1443 | return 0; | 1449 | return ret; |
1444 | } | 1450 | } |
1445 | EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); | 1451 | EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); |
1446 | 1452 | ||
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index fd778337deee..c2b91f566e05 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -358,10 +358,12 @@ process_start: | |||
358 | } | 358 | } |
359 | } while (true); | 359 | } while (true); |
360 | 360 | ||
361 | if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) | 361 | spin_lock_irqsave(&adapter->main_proc_lock, flags); |
362 | if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) { | ||
363 | spin_unlock_irqrestore(&adapter->main_proc_lock, flags); | ||
362 | goto process_start; | 364 | goto process_start; |
365 | } | ||
363 | 366 | ||
364 | spin_lock_irqsave(&adapter->main_proc_lock, flags); | ||
365 | adapter->mwifiex_processing = false; | 367 | adapter->mwifiex_processing = false; |
366 | spin_unlock_irqrestore(&adapter->main_proc_lock, flags); | 368 | spin_unlock_irqrestore(&adapter->main_proc_lock, flags); |
367 | 369 | ||
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index 8b057524b252..8c351f71f72f 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -118,7 +118,8 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code) | |||
118 | dev_dbg(adapter->dev, | 118 | dev_dbg(adapter->dev, |
119 | "info: successfully disconnected from %pM: reason code %d\n", | 119 | "info: successfully disconnected from %pM: reason code %d\n", |
120 | priv->cfg_bssid, reason_code); | 120 | priv->cfg_bssid, reason_code); |
121 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { | 121 | if (priv->bss_mode == NL80211_IFTYPE_STATION || |
122 | priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { | ||
122 | cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, | 123 | cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, |
123 | GFP_KERNEL); | 124 | GFP_KERNEL); |
124 | } | 125 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 76d95deb274b..dc49e525ae5e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -105,13 +105,11 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct rt2x00_ops *ops) | |||
105 | goto exit_release_regions; | 105 | goto exit_release_regions; |
106 | } | 106 | } |
107 | 107 | ||
108 | pci_enable_msi(pci_dev); | ||
109 | |||
110 | hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw); | 108 | hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw); |
111 | if (!hw) { | 109 | if (!hw) { |
112 | rt2x00_probe_err("Failed to allocate hardware\n"); | 110 | rt2x00_probe_err("Failed to allocate hardware\n"); |
113 | retval = -ENOMEM; | 111 | retval = -ENOMEM; |
114 | goto exit_disable_msi; | 112 | goto exit_release_regions; |
115 | } | 113 | } |
116 | 114 | ||
117 | pci_set_drvdata(pci_dev, hw); | 115 | pci_set_drvdata(pci_dev, hw); |
@@ -152,9 +150,6 @@ exit_free_reg: | |||
152 | exit_free_device: | 150 | exit_free_device: |
153 | ieee80211_free_hw(hw); | 151 | ieee80211_free_hw(hw); |
154 | 152 | ||
155 | exit_disable_msi: | ||
156 | pci_disable_msi(pci_dev); | ||
157 | |||
158 | exit_release_regions: | 153 | exit_release_regions: |
159 | pci_release_regions(pci_dev); | 154 | pci_release_regions(pci_dev); |
160 | 155 | ||
@@ -179,8 +174,6 @@ void rt2x00pci_remove(struct pci_dev *pci_dev) | |||
179 | rt2x00pci_free_reg(rt2x00dev); | 174 | rt2x00pci_free_reg(rt2x00dev); |
180 | ieee80211_free_hw(hw); | 175 | ieee80211_free_hw(hw); |
181 | 176 | ||
182 | pci_disable_msi(pci_dev); | ||
183 | |||
184 | /* | 177 | /* |
185 | * Free the PCI device data. | 178 | * Free the PCI device data. |
186 | */ | 179 | */ |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index 763cf1defab5..5a060e537fbe 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | |||
@@ -343,7 +343,8 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, | |||
343 | (bool)GET_RX_DESC_PAGGR(pdesc)); | 343 | (bool)GET_RX_DESC_PAGGR(pdesc)); |
344 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); | 344 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); |
345 | if (phystatus) { | 345 | if (phystatus) { |
346 | p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE); | 346 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + |
347 | stats->rx_bufshift); | ||
347 | rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, | 348 | rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, |
348 | p_drvinfo); | 349 | p_drvinfo); |
349 | } | 350 | } |
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index b45bce20ad76..1b08d8798372 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -39,11 +39,15 @@ static int connect_rings(struct backend_info *); | |||
39 | static void connect(struct backend_info *); | 39 | static void connect(struct backend_info *); |
40 | static void backend_create_xenvif(struct backend_info *be); | 40 | static void backend_create_xenvif(struct backend_info *be); |
41 | static void unregister_hotplug_status_watch(struct backend_info *be); | 41 | static void unregister_hotplug_status_watch(struct backend_info *be); |
42 | static void set_backend_state(struct backend_info *be, | ||
43 | enum xenbus_state state); | ||
42 | 44 | ||
43 | static int netback_remove(struct xenbus_device *dev) | 45 | static int netback_remove(struct xenbus_device *dev) |
44 | { | 46 | { |
45 | struct backend_info *be = dev_get_drvdata(&dev->dev); | 47 | struct backend_info *be = dev_get_drvdata(&dev->dev); |
46 | 48 | ||
49 | set_backend_state(be, XenbusStateClosed); | ||
50 | |||
47 | unregister_hotplug_status_watch(be); | 51 | unregister_hotplug_status_watch(be); |
48 | if (be->vif) { | 52 | if (be->vif) { |
49 | kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); | 53 | kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); |