diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2.c | 35 | ||||
-rw-r--r-- | drivers/net/bnx2.h | 6 | ||||
-rw-r--r-- | drivers/net/enc28j60.c | 16 | ||||
-rw-r--r-- | drivers/net/netx-eth.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 2 |
8 files changed, 83 insertions, 9 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index d07e3f148951..a1a3d0e5d2b4 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -3144,6 +3144,28 @@ bnx2_has_work(struct bnx2_napi *bnapi) | |||
3144 | return 0; | 3144 | return 0; |
3145 | } | 3145 | } |
3146 | 3146 | ||
3147 | static void | ||
3148 | bnx2_chk_missed_msi(struct bnx2 *bp) | ||
3149 | { | ||
3150 | struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; | ||
3151 | u32 msi_ctrl; | ||
3152 | |||
3153 | if (bnx2_has_work(bnapi)) { | ||
3154 | msi_ctrl = REG_RD(bp, BNX2_PCICFG_MSI_CONTROL); | ||
3155 | if (!(msi_ctrl & BNX2_PCICFG_MSI_CONTROL_ENABLE)) | ||
3156 | return; | ||
3157 | |||
3158 | if (bnapi->last_status_idx == bp->idle_chk_status_idx) { | ||
3159 | REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl & | ||
3160 | ~BNX2_PCICFG_MSI_CONTROL_ENABLE); | ||
3161 | REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl); | ||
3162 | bnx2_msi(bp->irq_tbl[0].vector, bnapi); | ||
3163 | } | ||
3164 | } | ||
3165 | |||
3166 | bp->idle_chk_status_idx = bnapi->last_status_idx; | ||
3167 | } | ||
3168 | |||
3147 | static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi) | 3169 | static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi) |
3148 | { | 3170 | { |
3149 | struct status_block *sblk = bnapi->status_blk.msi; | 3171 | struct status_block *sblk = bnapi->status_blk.msi; |
@@ -3218,14 +3240,15 @@ static int bnx2_poll(struct napi_struct *napi, int budget) | |||
3218 | 3240 | ||
3219 | work_done = bnx2_poll_work(bp, bnapi, work_done, budget); | 3241 | work_done = bnx2_poll_work(bp, bnapi, work_done, budget); |
3220 | 3242 | ||
3221 | if (unlikely(work_done >= budget)) | ||
3222 | break; | ||
3223 | |||
3224 | /* bnapi->last_status_idx is used below to tell the hw how | 3243 | /* bnapi->last_status_idx is used below to tell the hw how |
3225 | * much work has been processed, so we must read it before | 3244 | * much work has been processed, so we must read it before |
3226 | * checking for more work. | 3245 | * checking for more work. |
3227 | */ | 3246 | */ |
3228 | bnapi->last_status_idx = sblk->status_idx; | 3247 | bnapi->last_status_idx = sblk->status_idx; |
3248 | |||
3249 | if (unlikely(work_done >= budget)) | ||
3250 | break; | ||
3251 | |||
3229 | rmb(); | 3252 | rmb(); |
3230 | if (likely(!bnx2_has_work(bnapi))) { | 3253 | if (likely(!bnx2_has_work(bnapi))) { |
3231 | netif_rx_complete(bp->dev, napi); | 3254 | netif_rx_complete(bp->dev, napi); |
@@ -4570,6 +4593,8 @@ bnx2_init_chip(struct bnx2 *bp) | |||
4570 | for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) | 4593 | for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) |
4571 | bp->bnx2_napi[i].last_status_idx = 0; | 4594 | bp->bnx2_napi[i].last_status_idx = 0; |
4572 | 4595 | ||
4596 | bp->idle_chk_status_idx = 0xffff; | ||
4597 | |||
4573 | bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE; | 4598 | bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE; |
4574 | 4599 | ||
4575 | /* Set up how to generate a link change interrupt. */ | 4600 | /* Set up how to generate a link change interrupt. */ |
@@ -5718,6 +5743,10 @@ bnx2_timer(unsigned long data) | |||
5718 | if (atomic_read(&bp->intr_sem) != 0) | 5743 | if (atomic_read(&bp->intr_sem) != 0) |
5719 | goto bnx2_restart_timer; | 5744 | goto bnx2_restart_timer; |
5720 | 5745 | ||
5746 | if ((bp->flags & (BNX2_FLAG_USING_MSI | BNX2_FLAG_ONE_SHOT_MSI)) == | ||
5747 | BNX2_FLAG_USING_MSI) | ||
5748 | bnx2_chk_missed_msi(bp); | ||
5749 | |||
5721 | bnx2_send_heart_beat(bp); | 5750 | bnx2_send_heart_beat(bp); |
5722 | 5751 | ||
5723 | bp->stats_blk->stat_FwRxDrop = | 5752 | bp->stats_blk->stat_FwRxDrop = |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 617d95340160..0b032c3c7b61 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -378,6 +378,9 @@ struct l2_fhdr { | |||
378 | * pci_config_l definition | 378 | * pci_config_l definition |
379 | * offset: 0000 | 379 | * offset: 0000 |
380 | */ | 380 | */ |
381 | #define BNX2_PCICFG_MSI_CONTROL 0x00000058 | ||
382 | #define BNX2_PCICFG_MSI_CONTROL_ENABLE (1L<<16) | ||
383 | |||
381 | #define BNX2_PCICFG_MISC_CONFIG 0x00000068 | 384 | #define BNX2_PCICFG_MISC_CONFIG 0x00000068 |
382 | #define BNX2_PCICFG_MISC_CONFIG_TARGET_BYTE_SWAP (1L<<2) | 385 | #define BNX2_PCICFG_MISC_CONFIG_TARGET_BYTE_SWAP (1L<<2) |
383 | #define BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP (1L<<3) | 386 | #define BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP (1L<<3) |
@@ -6863,6 +6866,9 @@ struct bnx2 { | |||
6863 | 6866 | ||
6864 | u8 num_tx_rings; | 6867 | u8 num_tx_rings; |
6865 | u8 num_rx_rings; | 6868 | u8 num_rx_rings; |
6869 | |||
6870 | u32 idle_chk_status_idx; | ||
6871 | |||
6866 | }; | 6872 | }; |
6867 | 6873 | ||
6868 | #define REG_RD(bp, offset) \ | 6874 | #define REG_RD(bp, offset) \ |
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index e1b441effbbe..c414554ac321 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c | |||
@@ -568,6 +568,17 @@ static u16 erxrdpt_workaround(u16 next_packet_ptr, u16 start, u16 end) | |||
568 | return erxrdpt; | 568 | return erxrdpt; |
569 | } | 569 | } |
570 | 570 | ||
571 | /* | ||
572 | * Calculate wrap around when reading beyond the end of the RX buffer | ||
573 | */ | ||
574 | static u16 rx_packet_start(u16 ptr) | ||
575 | { | ||
576 | if (ptr + RSV_SIZE > RXEND_INIT) | ||
577 | return (ptr + RSV_SIZE) - (RXEND_INIT - RXSTART_INIT + 1); | ||
578 | else | ||
579 | return ptr + RSV_SIZE; | ||
580 | } | ||
581 | |||
571 | static void nolock_rxfifo_init(struct enc28j60_net *priv, u16 start, u16 end) | 582 | static void nolock_rxfifo_init(struct enc28j60_net *priv, u16 start, u16 end) |
572 | { | 583 | { |
573 | u16 erxrdpt; | 584 | u16 erxrdpt; |
@@ -938,8 +949,9 @@ static void enc28j60_hw_rx(struct net_device *ndev) | |||
938 | skb->dev = ndev; | 949 | skb->dev = ndev; |
939 | skb_reserve(skb, NET_IP_ALIGN); | 950 | skb_reserve(skb, NET_IP_ALIGN); |
940 | /* copy the packet from the receive buffer */ | 951 | /* copy the packet from the receive buffer */ |
941 | enc28j60_mem_read(priv, priv->next_pk_ptr + sizeof(rsv), | 952 | enc28j60_mem_read(priv, |
942 | len, skb_put(skb, len)); | 953 | rx_packet_start(priv->next_pk_ptr), |
954 | len, skb_put(skb, len)); | ||
943 | if (netif_msg_pktdata(priv)) | 955 | if (netif_msg_pktdata(priv)) |
944 | dump_packet(__func__, skb->len, skb->data); | 956 | dump_packet(__func__, skb->len, skb->data); |
945 | skb->protocol = eth_type_trans(skb, ndev); | 957 | skb->protocol = eth_type_trans(skb, ndev); |
diff --git a/drivers/net/netx-eth.c b/drivers/net/netx-eth.c index b9bed82e1d21..b289a0a2b945 100644 --- a/drivers/net/netx-eth.c +++ b/drivers/net/netx-eth.c | |||
@@ -401,6 +401,8 @@ static int netx_eth_drv_probe(struct platform_device *pdev) | |||
401 | priv->xmac_base = priv->xc->xmac_base; | 401 | priv->xmac_base = priv->xc->xmac_base; |
402 | priv->sram_base = priv->xc->sram_base; | 402 | priv->sram_base = priv->xc->sram_base; |
403 | 403 | ||
404 | spin_lock_init(&priv->lock); | ||
405 | |||
404 | ret = pfifo_request(PFIFO_MASK(priv->id)); | 406 | ret = pfifo_request(PFIFO_MASK(priv->id)); |
405 | if (ret) { | 407 | if (ret) { |
406 | printk("unable to request PFIFO\n"); | 408 | printk("unable to request PFIFO\n"); |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index dcce3542d5a7..7a9f901d4ff6 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -3897,6 +3897,7 @@ static int ipw_disassociate(void *data) | |||
3897 | if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) | 3897 | if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) |
3898 | return 0; | 3898 | return 0; |
3899 | ipw_send_disassociate(data, 0); | 3899 | ipw_send_disassociate(data, 0); |
3900 | netif_carrier_off(priv->net_dev); | ||
3900 | return 1; | 3901 | return 1; |
3901 | } | 3902 | } |
3902 | 3903 | ||
@@ -10190,6 +10191,9 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, | |||
10190 | u16 remaining_bytes; | 10191 | u16 remaining_bytes; |
10191 | int fc; | 10192 | int fc; |
10192 | 10193 | ||
10194 | if (!(priv->status & STATUS_ASSOCIATED)) | ||
10195 | goto drop; | ||
10196 | |||
10193 | hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); | 10197 | hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); |
10194 | switch (priv->ieee->iw_mode) { | 10198 | switch (priv->ieee->iw_mode) { |
10195 | case IW_MODE_ADHOC: | 10199 | case IW_MODE_ADHOC: |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 4c312c55f90c..01a845851338 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -290,6 +290,9 @@ void iwl_clear_stations_table(struct iwl_priv *priv) | |||
290 | priv->num_stations = 0; | 290 | priv->num_stations = 0; |
291 | memset(priv->stations, 0, sizeof(priv->stations)); | 291 | memset(priv->stations, 0, sizeof(priv->stations)); |
292 | 292 | ||
293 | /* clean ucode key table bit map */ | ||
294 | priv->ucode_key_table = 0; | ||
295 | |||
293 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 296 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
294 | } | 297 | } |
295 | EXPORT_SYMBOL(iwl_clear_stations_table); | 298 | EXPORT_SYMBOL(iwl_clear_stations_table); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 61797f3f8d5c..26f7084d3011 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -475,7 +475,7 @@ static int iwl_get_free_ucode_key_index(struct iwl_priv *priv) | |||
475 | if (!test_and_set_bit(i, &priv->ucode_key_table)) | 475 | if (!test_and_set_bit(i, &priv->ucode_key_table)) |
476 | return i; | 476 | return i; |
477 | 477 | ||
478 | return -1; | 478 | return WEP_INVALID_OFFSET; |
479 | } | 479 | } |
480 | 480 | ||
481 | int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) | 481 | int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) |
@@ -620,6 +620,9 @@ static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv, | |||
620 | /* else, we are overriding an existing key => no need to allocated room | 620 | /* else, we are overriding an existing key => no need to allocated room |
621 | * in uCode. */ | 621 | * in uCode. */ |
622 | 622 | ||
623 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, | ||
624 | "no space for new kew"); | ||
625 | |||
623 | priv->stations[sta_id].sta.key.key_flags = key_flags; | 626 | priv->stations[sta_id].sta.key.key_flags = key_flags; |
624 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 627 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
625 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 628 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
@@ -637,6 +640,7 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv, | |||
637 | { | 640 | { |
638 | unsigned long flags; | 641 | unsigned long flags; |
639 | __le16 key_flags = 0; | 642 | __le16 key_flags = 0; |
643 | int ret; | ||
640 | 644 | ||
641 | key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK); | 645 | key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK); |
642 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | 646 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); |
@@ -664,14 +668,18 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv, | |||
664 | /* else, we are overriding an existing key => no need to allocated room | 668 | /* else, we are overriding an existing key => no need to allocated room |
665 | * in uCode. */ | 669 | * in uCode. */ |
666 | 670 | ||
671 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, | ||
672 | "no space for new kew"); | ||
673 | |||
667 | priv->stations[sta_id].sta.key.key_flags = key_flags; | 674 | priv->stations[sta_id].sta.key.key_flags = key_flags; |
668 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 675 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
669 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 676 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
670 | 677 | ||
678 | ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | ||
679 | |||
671 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 680 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
672 | 681 | ||
673 | IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n"); | 682 | return ret; |
674 | return iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | ||
675 | } | 683 | } |
676 | 684 | ||
677 | static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | 685 | static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, |
@@ -696,6 +704,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | |||
696 | /* else, we are overriding an existing key => no need to allocated room | 704 | /* else, we are overriding an existing key => no need to allocated room |
697 | * in uCode. */ | 705 | * in uCode. */ |
698 | 706 | ||
707 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, | ||
708 | "no space for new kew"); | ||
709 | |||
699 | /* This copy is acutally not needed: we get the key with each TX */ | 710 | /* This copy is acutally not needed: we get the key with each TX */ |
700 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); | 711 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); |
701 | 712 | ||
@@ -734,6 +745,13 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
734 | return 0; | 745 | return 0; |
735 | } | 746 | } |
736 | 747 | ||
748 | if (priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) { | ||
749 | IWL_WARNING("Removing wrong key %d 0x%x\n", | ||
750 | keyconf->keyidx, key_flags); | ||
751 | spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
752 | return 0; | ||
753 | } | ||
754 | |||
737 | if (!test_and_clear_bit(priv->stations[sta_id].sta.key.key_offset, | 755 | if (!test_and_clear_bit(priv->stations[sta_id].sta.key.key_offset, |
738 | &priv->ucode_key_table)) | 756 | &priv->ucode_key_table)) |
739 | IWL_ERROR("index %d not used in uCode key table.\n", | 757 | IWL_ERROR("index %d not used in uCode key table.\n", |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index fe1867b25ff7..cac732f4047f 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -615,7 +615,7 @@ static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr, | |||
615 | struct ieee80211_hdr *tx_hdr; | 615 | struct ieee80211_hdr *tx_hdr; |
616 | 616 | ||
617 | tx_hdr = (struct ieee80211_hdr *)skb->data; | 617 | tx_hdr = (struct ieee80211_hdr *)skb->data; |
618 | if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1))) | 618 | if (likely(!memcmp(tx_hdr->addr2, rx_hdr->addr1, ETH_ALEN))) |
619 | { | 619 | { |
620 | __skb_unlink(skb, q); | 620 | __skb_unlink(skb, q); |
621 | tx_status(hw, skb, IEEE80211_TX_STAT_ACK, stats->signal, 1); | 621 | tx_status(hw, skb, IEEE80211_TX_STAT_ACK, stats->signal, 1); |