aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-09-07 16:12:54 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-10 15:30:41 -0400
commit15e473046cb6e5d18a4d0057e61d76315230382b (patch)
tree893d2df5d46a6ce156933ac57a1398f0ad22b889 /drivers/net/wireless/mac80211_hwsim.c
parent9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e (diff)
netlink: Rename pid to portid to avoid confusion
It is a frequent mistake to confuse the netlink port identifier with a process identifier. Try to reduce this confusion by renaming fields that hold port identifiers portid instead of pid. I have carefully avoided changing the structures exported to userspace to avoid changing the userspace API. I have successfully built an allyesconfig kernel with this change. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 72b0456e41bf..9d45b3bb974c 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -38,7 +38,7 @@ MODULE_AUTHOR("Jouni Malinen");
38MODULE_DESCRIPTION("Software simulator of 802.11 radio(s) for mac80211"); 38MODULE_DESCRIPTION("Software simulator of 802.11 radio(s) for mac80211");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40 40
41static u32 wmediumd_pid; 41static u32 wmediumd_portid;
42 42
43static int radios = 2; 43static int radios = 2;
44module_param(radios, int, 0444); 44module_param(radios, int, 0444);
@@ -545,7 +545,7 @@ static bool mac80211_hwsim_addr_match(struct mac80211_hwsim_data *data,
545 545
546static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw, 546static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
547 struct sk_buff *my_skb, 547 struct sk_buff *my_skb,
548 int dst_pid) 548 int dst_portid)
549{ 549{
550 struct sk_buff *skb; 550 struct sk_buff *skb;
551 struct mac80211_hwsim_data *data = hw->priv; 551 struct mac80211_hwsim_data *data = hw->priv;
@@ -619,7 +619,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
619 goto nla_put_failure; 619 goto nla_put_failure;
620 620
621 genlmsg_end(skb, msg_head); 621 genlmsg_end(skb, msg_head);
622 genlmsg_unicast(&init_net, skb, dst_pid); 622 genlmsg_unicast(&init_net, skb, dst_portid);
623 623
624 /* Enqueue the packet */ 624 /* Enqueue the packet */
625 skb_queue_tail(&data->pending, my_skb); 625 skb_queue_tail(&data->pending, my_skb);
@@ -715,7 +715,7 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
715{ 715{
716 bool ack; 716 bool ack;
717 struct ieee80211_tx_info *txi; 717 struct ieee80211_tx_info *txi;
718 u32 _pid; 718 u32 _portid;
719 719
720 mac80211_hwsim_monitor_rx(hw, skb); 720 mac80211_hwsim_monitor_rx(hw, skb);
721 721
@@ -726,10 +726,10 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
726 } 726 }
727 727
728 /* wmediumd mode check */ 728 /* wmediumd mode check */
729 _pid = ACCESS_ONCE(wmediumd_pid); 729 _portid = ACCESS_ONCE(wmediumd_portid);
730 730
731 if (_pid) 731 if (_portid)
732 return mac80211_hwsim_tx_frame_nl(hw, skb, _pid); 732 return mac80211_hwsim_tx_frame_nl(hw, skb, _portid);
733 733
734 /* NO wmediumd detected, perfect medium simulation */ 734 /* NO wmediumd detected, perfect medium simulation */
735 ack = mac80211_hwsim_tx_frame_no_nl(hw, skb); 735 ack = mac80211_hwsim_tx_frame_no_nl(hw, skb);
@@ -814,7 +814,7 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
814 struct ieee80211_hw *hw = arg; 814 struct ieee80211_hw *hw = arg;
815 struct sk_buff *skb; 815 struct sk_buff *skb;
816 struct ieee80211_tx_info *info; 816 struct ieee80211_tx_info *info;
817 u32 _pid; 817 u32 _portid;
818 818
819 hwsim_check_magic(vif); 819 hwsim_check_magic(vif);
820 820
@@ -831,10 +831,10 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
831 mac80211_hwsim_monitor_rx(hw, skb); 831 mac80211_hwsim_monitor_rx(hw, skb);
832 832
833 /* wmediumd mode check */ 833 /* wmediumd mode check */
834 _pid = ACCESS_ONCE(wmediumd_pid); 834 _portid = ACCESS_ONCE(wmediumd_portid);
835 835
836 if (_pid) 836 if (_portid)
837 return mac80211_hwsim_tx_frame_nl(hw, skb, _pid); 837 return mac80211_hwsim_tx_frame_nl(hw, skb, _portid);
838 838
839 mac80211_hwsim_tx_frame_no_nl(hw, skb); 839 mac80211_hwsim_tx_frame_no_nl(hw, skb);
840 dev_kfree_skb(skb); 840 dev_kfree_skb(skb);
@@ -1315,7 +1315,7 @@ static void hwsim_send_ps_poll(void *dat, u8 *mac, struct ieee80211_vif *vif)
1315 struct hwsim_vif_priv *vp = (void *)vif->drv_priv; 1315 struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
1316 struct sk_buff *skb; 1316 struct sk_buff *skb;
1317 struct ieee80211_pspoll *pspoll; 1317 struct ieee80211_pspoll *pspoll;
1318 u32 _pid; 1318 u32 _portid;
1319 1319
1320 if (!vp->assoc) 1320 if (!vp->assoc)
1321 return; 1321 return;
@@ -1336,10 +1336,10 @@ static void hwsim_send_ps_poll(void *dat, u8 *mac, struct ieee80211_vif *vif)
1336 memcpy(pspoll->ta, mac, ETH_ALEN); 1336 memcpy(pspoll->ta, mac, ETH_ALEN);
1337 1337
1338 /* wmediumd mode check */ 1338 /* wmediumd mode check */
1339 _pid = ACCESS_ONCE(wmediumd_pid); 1339 _portid = ACCESS_ONCE(wmediumd_portid);
1340 1340
1341 if (_pid) 1341 if (_portid)
1342 return mac80211_hwsim_tx_frame_nl(data->hw, skb, _pid); 1342 return mac80211_hwsim_tx_frame_nl(data->hw, skb, _portid);
1343 1343
1344 if (!mac80211_hwsim_tx_frame_no_nl(data->hw, skb)) 1344 if (!mac80211_hwsim_tx_frame_no_nl(data->hw, skb))
1345 printk(KERN_DEBUG "%s: PS-poll frame not ack'ed\n", __func__); 1345 printk(KERN_DEBUG "%s: PS-poll frame not ack'ed\n", __func__);
@@ -1353,7 +1353,7 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,
1353 struct hwsim_vif_priv *vp = (void *)vif->drv_priv; 1353 struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
1354 struct sk_buff *skb; 1354 struct sk_buff *skb;
1355 struct ieee80211_hdr *hdr; 1355 struct ieee80211_hdr *hdr;
1356 u32 _pid; 1356 u32 _portid;
1357 1357
1358 if (!vp->assoc) 1358 if (!vp->assoc)
1359 return; 1359 return;
@@ -1375,10 +1375,10 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,
1375 memcpy(hdr->addr3, vp->bssid, ETH_ALEN); 1375 memcpy(hdr->addr3, vp->bssid, ETH_ALEN);
1376 1376
1377 /* wmediumd mode check */ 1377 /* wmediumd mode check */
1378 _pid = ACCESS_ONCE(wmediumd_pid); 1378 _portid = ACCESS_ONCE(wmediumd_portid);
1379 1379
1380 if (_pid) 1380 if (_portid)
1381 return mac80211_hwsim_tx_frame_nl(data->hw, skb, _pid); 1381 return mac80211_hwsim_tx_frame_nl(data->hw, skb, _portid);
1382 1382
1383 if (!mac80211_hwsim_tx_frame_no_nl(data->hw, skb)) 1383 if (!mac80211_hwsim_tx_frame_no_nl(data->hw, skb))
1384 printk(KERN_DEBUG "%s: nullfunc frame not ack'ed\n", __func__); 1384 printk(KERN_DEBUG "%s: nullfunc frame not ack'ed\n", __func__);
@@ -1632,10 +1632,10 @@ static int hwsim_register_received_nl(struct sk_buff *skb_2,
1632 if (info == NULL) 1632 if (info == NULL)
1633 goto out; 1633 goto out;
1634 1634
1635 wmediumd_pid = info->snd_pid; 1635 wmediumd_portid = info->snd_portid;
1636 1636
1637 printk(KERN_DEBUG "mac80211_hwsim: received a REGISTER, " 1637 printk(KERN_DEBUG "mac80211_hwsim: received a REGISTER, "
1638 "switching to wmediumd mode with pid %d\n", info->snd_pid); 1638 "switching to wmediumd mode with pid %d\n", info->snd_portid);
1639 1639
1640 return 0; 1640 return 0;
1641out: 1641out:
@@ -1672,10 +1672,10 @@ static int mac80211_hwsim_netlink_notify(struct notifier_block *nb,
1672 if (state != NETLINK_URELEASE) 1672 if (state != NETLINK_URELEASE)
1673 return NOTIFY_DONE; 1673 return NOTIFY_DONE;
1674 1674
1675 if (notify->pid == wmediumd_pid) { 1675 if (notify->portid == wmediumd_portid) {
1676 printk(KERN_INFO "mac80211_hwsim: wmediumd released netlink" 1676 printk(KERN_INFO "mac80211_hwsim: wmediumd released netlink"
1677 " socket, switching to perfect channel medium\n"); 1677 " socket, switching to perfect channel medium\n");
1678 wmediumd_pid = 0; 1678 wmediumd_portid = 0;
1679 } 1679 }
1680 return NOTIFY_DONE; 1680 return NOTIFY_DONE;
1681 1681