aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h12
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c8
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c12
-rw-r--r--drivers/net/tun.c15
-rw-r--r--drivers/net/usb/asix.c4
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c2
-rw-r--r--drivers/net/wireless/iwlegacy/3945.c7
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c3
12 files changed, 54 insertions, 28 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 7aee46983be4..99389c8dda21 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -1934,7 +1934,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
1934 } 1934 }
1935 1935
1936 if (bp->port.pmf) 1936 if (bp->port.pmf)
1937 bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 0); 1937 bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_DCB_CONFIGURED, 0);
1938 else 1938 else
1939 bnx2x__link_status_update(bp); 1939 bnx2x__link_status_update(bp);
1940 1940
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index bf27c54ff2e0..4f40f7d7d8c6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -1179,10 +1179,16 @@ static inline int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp,
1179 */ 1179 */
1180static inline u8 bnx2x_stats_id(struct bnx2x_fastpath *fp) 1180static inline u8 bnx2x_stats_id(struct bnx2x_fastpath *fp)
1181{ 1181{
1182 if (!CHIP_IS_E1x(fp->bp)) 1182 struct bnx2x *bp = fp->bp;
1183 if (!CHIP_IS_E1x(bp)) {
1184#ifdef BCM_CNIC
1185 /* there are special statistics counters for FCoE 136..140 */
1186 if (IS_FCOE_FP(fp))
1187 return bp->cnic_base_cl_id + (bp->pf_num >> 1);
1188#endif
1183 return fp->cl_id; 1189 return fp->cl_id;
1184 else 1190 }
1185 return fp->cl_id + BP_PORT(fp->bp) * FP_SB_MAX_E1x; 1191 return fp->cl_id + BP_PORT(bp) * FP_SB_MAX_E1x;
1186} 1192}
1187 1193
1188static inline void bnx2x_init_vlan_mac_fp_objs(struct bnx2x_fastpath *fp, 1194static inline void bnx2x_init_vlan_mac_fp_objs(struct bnx2x_fastpath *fp,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
index 5051cf3deb20..6d82ade4c31c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
@@ -735,7 +735,9 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
735 bp->dcbx_error); 735 bp->dcbx_error);
736 736
737 /* mark DCBX result for PMF migration */ 737 /* mark DCBX result for PMF migration */
738 bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 1); 738 bnx2x_update_drv_flags(bp,
739 1 << DRV_FLAGS_DCB_CONFIGURED,
740 1);
739#ifdef BCM_DCBNL 741#ifdef BCM_DCBNL
740 /* 742 /*
741 * Add new app tlvs to dcbnl 743 * Add new app tlvs to dcbnl
@@ -1020,7 +1022,7 @@ void bnx2x_dcbx_init(struct bnx2x *bp)
1020 DP(NETIF_MSG_LINK, "dcbx_lldp_params_offset 0x%x\n", 1022 DP(NETIF_MSG_LINK, "dcbx_lldp_params_offset 0x%x\n",
1021 dcbx_lldp_params_offset); 1023 dcbx_lldp_params_offset);
1022 1024
1023 bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 0); 1025 bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_DCB_CONFIGURED, 0);
1024 1026
1025 if (SHMEM_LLDP_DCBX_PARAMS_NONE != dcbx_lldp_params_offset) { 1027 if (SHMEM_LLDP_DCBX_PARAMS_NONE != dcbx_lldp_params_offset) {
1026 bnx2x_dcbx_admin_mib_updated_params(bp, 1028 bnx2x_dcbx_admin_mib_updated_params(bp,
@@ -1857,7 +1859,7 @@ void bnx2x_dcbx_pmf_update(struct bnx2x *bp)
1857 * read it from shmem and update bp and netdev accordingly 1859 * read it from shmem and update bp and netdev accordingly
1858 */ 1860 */
1859 if (SHMEM2_HAS(bp, drv_flags) && 1861 if (SHMEM2_HAS(bp, drv_flags) &&
1860 GET_FLAGS(SHMEM2_RD(bp, drv_flags), DRV_FLAGS_DCB_CONFIGURED)) { 1862 GET_FLAGS(SHMEM2_RD(bp, drv_flags), 1 << DRV_FLAGS_DCB_CONFIGURED)) {
1861 /* Read neg results if dcbx is in the FW */ 1863 /* Read neg results if dcbx is in the FW */
1862 if (bnx2x_dcbx_read_shmem_neg_results(bp)) 1864 if (bnx2x_dcbx_read_shmem_neg_results(bp))
1863 return; 1865 return;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index cb6339c35571..94110e9ce51d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -5601,7 +5601,7 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp,
5601 5601
5602 /* Fill the ramrod data with provided parameters */ 5602 /* Fill the ramrod data with provided parameters */
5603 rdata->function_mode = cpu_to_le16(start_params->mf_mode); 5603 rdata->function_mode = cpu_to_le16(start_params->mf_mode);
5604 rdata->sd_vlan_tag = start_params->sd_vlan_tag; 5604 rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag);
5605 rdata->path_id = BP_PATH(bp); 5605 rdata->path_id = BP_PATH(bp);
5606 rdata->network_cos_mode = start_params->network_cos_mode; 5606 rdata->network_cos_mode = start_params->network_cos_mode;
5607 5607
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index 1adef266fcd5..a766b25eec5f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -554,23 +554,11 @@ static void bnx2x_bmac_stats_update(struct bnx2x *bp)
554 UPDATE_STAT64(tx_stat_gtufl, tx_stat_mac_ufl); 554 UPDATE_STAT64(tx_stat_gtufl, tx_stat_mac_ufl);
555 555
556 /* collect PFC stats */ 556 /* collect PFC stats */
557 DIFF_64(diff.hi, new->tx_stat_gtpp_hi,
558 pstats->pfc_frames_tx_hi,
559 diff.lo, new->tx_stat_gtpp_lo,
560 pstats->pfc_frames_tx_lo);
561 pstats->pfc_frames_tx_hi = new->tx_stat_gtpp_hi; 557 pstats->pfc_frames_tx_hi = new->tx_stat_gtpp_hi;
562 pstats->pfc_frames_tx_lo = new->tx_stat_gtpp_lo; 558 pstats->pfc_frames_tx_lo = new->tx_stat_gtpp_lo;
563 ADD_64(pstats->pfc_frames_tx_hi, diff.hi,
564 pstats->pfc_frames_tx_lo, diff.lo);
565 559
566 DIFF_64(diff.hi, new->rx_stat_grpp_hi,
567 pstats->pfc_frames_rx_hi,
568 diff.lo, new->rx_stat_grpp_lo,
569 pstats->pfc_frames_rx_lo);
570 pstats->pfc_frames_rx_hi = new->rx_stat_grpp_hi; 560 pstats->pfc_frames_rx_hi = new->rx_stat_grpp_hi;
571 pstats->pfc_frames_rx_lo = new->rx_stat_grpp_lo; 561 pstats->pfc_frames_rx_lo = new->rx_stat_grpp_lo;
572 ADD_64(pstats->pfc_frames_rx_hi, diff.hi,
573 pstats->pfc_frames_rx_lo, diff.lo);
574 } 562 }
575 563
576 estats->pause_frames_received_hi = 564 estats->pause_frames_received_hi =
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 93c5d72711b0..2d7601dd6660 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -359,7 +359,7 @@ static void tun_free_netdev(struct net_device *dev)
359{ 359{
360 struct tun_struct *tun = netdev_priv(dev); 360 struct tun_struct *tun = netdev_priv(dev);
361 361
362 sock_put(tun->socket.sk); 362 sk_release_kernel(tun->socket.sk);
363} 363}
364 364
365/* Net device open. */ 365/* Net device open. */
@@ -980,10 +980,18 @@ static int tun_recvmsg(struct kiocb *iocb, struct socket *sock,
980 return ret; 980 return ret;
981} 981}
982 982
983static int tun_release(struct socket *sock)
984{
985 if (sock->sk)
986 sock_put(sock->sk);
987 return 0;
988}
989
983/* Ops structure to mimic raw sockets with tun */ 990/* Ops structure to mimic raw sockets with tun */
984static const struct proto_ops tun_socket_ops = { 991static const struct proto_ops tun_socket_ops = {
985 .sendmsg = tun_sendmsg, 992 .sendmsg = tun_sendmsg,
986 .recvmsg = tun_recvmsg, 993 .recvmsg = tun_recvmsg,
994 .release = tun_release,
987}; 995};
988 996
989static struct proto tun_proto = { 997static struct proto tun_proto = {
@@ -1110,10 +1118,11 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1110 tun->vnet_hdr_sz = sizeof(struct virtio_net_hdr); 1118 tun->vnet_hdr_sz = sizeof(struct virtio_net_hdr);
1111 1119
1112 err = -ENOMEM; 1120 err = -ENOMEM;
1113 sk = sk_alloc(net, AF_UNSPEC, GFP_KERNEL, &tun_proto); 1121 sk = sk_alloc(&init_net, AF_UNSPEC, GFP_KERNEL, &tun_proto);
1114 if (!sk) 1122 if (!sk)
1115 goto err_free_dev; 1123 goto err_free_dev;
1116 1124
1125 sk_change_net(sk, net);
1117 tun->socket.wq = &tun->wq; 1126 tun->socket.wq = &tun->wq;
1118 init_waitqueue_head(&tun->wq.wait); 1127 init_waitqueue_head(&tun->wq.wait);
1119 tun->socket.ops = &tun_socket_ops; 1128 tun->socket.ops = &tun_socket_ops;
@@ -1174,7 +1183,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1174 return 0; 1183 return 0;
1175 1184
1176 err_free_sk: 1185 err_free_sk:
1177 sock_put(sk); 1186 tun_free_netdev(dev);
1178 err_free_dev: 1187 err_free_dev:
1179 free_netdev(dev); 1188 free_netdev(dev);
1180 failed: 1189 failed:
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 8e84f5bdd6ca..d6da5eed5453 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -1599,6 +1599,10 @@ static const struct usb_device_id products [] = {
1599 USB_DEVICE (0x6189, 0x182d), 1599 USB_DEVICE (0x6189, 0x182d),
1600 .driver_info = (unsigned long) &ax8817x_info, 1600 .driver_info = (unsigned long) &ax8817x_info,
1601}, { 1601}, {
1602 // Sitecom LN-031 "USB 2.0 10/100/1000 Ethernet adapter"
1603 USB_DEVICE (0x0df6, 0x0056),
1604 .driver_info = (unsigned long) &ax88178_info,
1605}, {
1602 // corega FEther USB2-TX 1606 // corega FEther USB2-TX
1603 USB_DEVICE (0x07aa, 0x0017), 1607 USB_DEVICE (0x07aa, 0x0017),
1604 .driver_info = (unsigned long) &ax8817x_info, 1608 .driver_info = (unsigned long) &ax8817x_info,
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 54b2d391e91a..a7dfba8d164e 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -2475,7 +2475,7 @@ il3945_bg_alive_start(struct work_struct *data)
2475 container_of(data, struct il_priv, alive_start.work); 2475 container_of(data, struct il_priv, alive_start.work);
2476 2476
2477 mutex_lock(&il->mutex); 2477 mutex_lock(&il->mutex);
2478 if (test_bit(S_EXIT_PENDING, &il->status)) 2478 if (test_bit(S_EXIT_PENDING, &il->status) || il->txq == NULL)
2479 goto out; 2479 goto out;
2480 2480
2481 il3945_alive_start(il); 2481 il3945_alive_start(il);
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 1489b1573a6a..c80eb9b31551 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -1870,11 +1870,12 @@ il3945_bg_reg_txpower_periodic(struct work_struct *work)
1870 struct il_priv *il = container_of(work, struct il_priv, 1870 struct il_priv *il = container_of(work, struct il_priv,
1871 _3945.thermal_periodic.work); 1871 _3945.thermal_periodic.work);
1872 1872
1873 if (test_bit(S_EXIT_PENDING, &il->status))
1874 return;
1875
1876 mutex_lock(&il->mutex); 1873 mutex_lock(&il->mutex);
1874 if (test_bit(S_EXIT_PENDING, &il->status) || il->txq == NULL)
1875 goto out;
1876
1877 il3945_reg_txpower_periodic(il); 1877 il3945_reg_txpower_periodic(il);
1878out:
1878 mutex_unlock(&il->mutex); 1879 mutex_unlock(&il->mutex);
1879} 1880}
1880 1881
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index d2a1ea98d0f2..fd356b7c0476 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -426,10 +426,14 @@ void rt2x00lib_txdone(struct queue_entry *entry,
426 /* 426 /*
427 * If the data queue was below the threshold before the txdone 427 * If the data queue was below the threshold before the txdone
428 * handler we must make sure the packet queue in the mac80211 stack 428 * handler we must make sure the packet queue in the mac80211 stack
429 * is reenabled when the txdone handler has finished. 429 * is reenabled when the txdone handler has finished. This has to be
430 * serialized with rt2x00mac_tx(), otherwise we can wake up queue
431 * before it was stopped.
430 */ 432 */
433 spin_lock_bh(&entry->queue->tx_lock);
431 if (!rt2x00queue_threshold(entry->queue)) 434 if (!rt2x00queue_threshold(entry->queue))
432 rt2x00queue_unpause_queue(entry->queue); 435 rt2x00queue_unpause_queue(entry->queue);
436 spin_unlock_bh(&entry->queue->tx_lock);
433} 437}
434EXPORT_SYMBOL_GPL(rt2x00lib_txdone); 438EXPORT_SYMBOL_GPL(rt2x00lib_txdone);
435 439
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index ede3c58e6783..2df2eb6d3e06 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -152,13 +152,22 @@ void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
152 if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false))) 152 if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false)))
153 goto exit_fail; 153 goto exit_fail;
154 154
155 /*
156 * Pausing queue has to be serialized with rt2x00lib_txdone(). Note
157 * we should not use spin_lock_bh variant as bottom halve was already
158 * disabled before ieee80211_xmit() call.
159 */
160 spin_lock(&queue->tx_lock);
155 if (rt2x00queue_threshold(queue)) 161 if (rt2x00queue_threshold(queue))
156 rt2x00queue_pause_queue(queue); 162 rt2x00queue_pause_queue(queue);
163 spin_unlock(&queue->tx_lock);
157 164
158 return; 165 return;
159 166
160 exit_fail: 167 exit_fail:
168 spin_lock(&queue->tx_lock);
161 rt2x00queue_pause_queue(queue); 169 rt2x00queue_pause_queue(queue);
170 spin_unlock(&queue->tx_lock);
162 exit_free_skb: 171 exit_free_skb:
163 ieee80211_free_txskb(hw, skb); 172 ieee80211_free_txskb(hw, skb);
164} 173}
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 5adfb3eab9cd..9b1b2b7a7807 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -619,6 +619,9 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
619 else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags)) 619 else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags))
620 rt2x00queue_align_frame(skb); 620 rt2x00queue_align_frame(skb);
621 621
622 /*
623 * That function must be called with bh disabled.
624 */
622 spin_lock(&queue->tx_lock); 625 spin_lock(&queue->tx_lock);
623 626
624 if (unlikely(rt2x00queue_full(queue))) { 627 if (unlikely(rt2x00queue_full(queue))) {