Skip to content

Commit ba68b15

Browse files
committed
Modify the terminology
Modify the terminology by replacing the abbreviation ah with ibss in vwifi.c to align with cfg80211 kernel functions. Additionally, change the IBSS network names in the test scripts to ibss1, ibss2, and so on.
1 parent 02186dd commit ba68b15

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

scripts/verify.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,34 +160,34 @@ if [ $final_ret -eq 0 ]; then
160160
final_ret=7
161161
fi
162162

163-
# vw3 becomes an IBSS and then joins the "Elian" network (BSSID: 00:76:77:33:00:00).
163+
# vw3 becomes an IBSS and then joins the "ibss1" network (BSSID: 00:76:77:33:00:00).
164164
echo
165165
echo "=================================="
166-
echo "vw3 join Elian (00:76:77:33:00:00)"
166+
echo "vw3 join ibss1 (00:76:77:33:00:00)"
167167
echo "=================================="
168168
sudo ip netns exec ns3 iw dev vw3 set type ibss
169-
sudo ip netns exec ns3 iw dev vw3 ibss join Elian 2412 NOHT fixed-freq 00:76:77:33:00:00 beacon-interval 200
169+
sudo ip netns exec ns3 iw dev vw3 ibss join ibss1 2412 NOHT fixed-freq 00:76:77:33:00:00 beacon-interval 200
170170

171-
# vw4 becomes an IBSS and then joins the "Elian" network (BSSID: 00:76:77:33:00:00).
171+
# vw4 becomes an IBSS and then joins the "ibss1" network (BSSID: 00:76:77:33:00:00).
172172
echo
173173
echo "=================================="
174-
echo "vw4 join Elian (00:76:77:33:00:00)"
174+
echo "vw4 join ibss1 (00:76:77:33:00:00)"
175175
echo "=================================="
176176
sudo ip netns exec ns4 iw dev vw4 set type ibss
177-
sudo ip netns exec ns4 iw dev vw4 ibss join Elian 2412 NOHT fixed-freq 00:76:77:33:00:00 beacon-interval 200
177+
sudo ip netns exec ns4 iw dev vw4 ibss join ibss1 2412 NOHT fixed-freq 00:76:77:33:00:00 beacon-interval 200
178178

179-
# vw5 becomes an IBSS and then joins the "Ricky" network (BSSID: 00:76:77:35:00:00).
179+
# vw5 becomes an IBSS and then joins the "ibss2" network (BSSID: 00:76:77:35:00:00).
180180
echo
181181
echo "=================================="
182-
echo "vw5 join Ricky (00:76:77:35:00:00)"
182+
echo "vw5 join ibss2 (00:76:77:35:00:00)"
183183
echo "=================================="
184184
sudo ip netns exec ns5 iw dev vw5 set type ibss
185-
sudo ip netns exec ns5 iw dev vw5 ibss join Ricky 2412 NOHT fixed-freq 00:76:77:35:00:00 beacon-interval 300
185+
sudo ip netns exec ns5 iw dev vw5 ibss join ibss2 2412 NOHT fixed-freq 00:76:77:35:00:00 beacon-interval 300
186186

187187
# ping test: IBSS vw3 <--> STA vw2, should fail
188188
echo
189189
echo "================================================================================"
190-
echo "Ping Test: IBSS vw3 (10.0.0.4) (in Elian) <--> STA vw2 (10.0.0.3)"
190+
echo "Ping Test: IBSS vw3 (10.0.0.4) (in ibss1) <--> STA vw2 (10.0.0.3)"
191191
echo
192192
echo "(should fail)"
193193
echo "(be patient, it will take some time to route...)"
@@ -197,7 +197,7 @@ if [ $final_ret -eq 0 ]; then
197197
# ping test: IBSS vw3 <--> IBSS vw5, should fail
198198
echo
199199
echo "================================================================================"
200-
echo "Ping Test: IBSS vw3 (10.0.0.4) (in Elian) <--> IBSS vw5 (10.0.0.6) (in Ricky)"
200+
echo "Ping Test: IBSS vw3 (10.0.0.4) (in ibss1) <--> IBSS vw5 (10.0.0.6) (in ibss2)"
201201
echo
202202
echo "(should fail)"
203203
echo "(be patient, it will take some time to route...)"
@@ -207,7 +207,7 @@ if [ $final_ret -eq 0 ]; then
207207
# ping test: IBSS vw3 <--> IBSS vw4, should success
208208
echo
209209
echo "================================================================================"
210-
echo "Ping Test: IBSS vw3 (10.0.0.4) (in Elian) <--> IBSS vw4 (10.0.0.5) (in Elian)"
210+
echo "Ping Test: IBSS vw3 (10.0.0.4) (in ibss1) <--> IBSS vw4 (10.0.0.5) (in ibss1)"
211211
echo
212212
echo "(should success)"
213213
echo "(be patient, it will take some time to route...)"

vwifi.c

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static atomic_t vwifi_wiphy_counter = ATOMIC_INIT(0);
8282

8383
/* Virtual interface pointed to by netdev_priv(). Fields in the structure are
8484
* interface-dependent. Every interface has its own vwifi_vif, regardless of the
85-
* interface mode (STA, AP, Ad-hoc...).
85+
* interface mode (STA, AP, IBSS...).
8686
*/
8787
struct vwifi_vif {
8888
struct wireless_dev wdev;
@@ -104,7 +104,7 @@ struct vwifi_vif {
104104

105105
struct mutex lock;
106106

107-
/* Split logic for STA and AP mode */
107+
/* Split logic for the interface mode */
108108
union {
109109
/* Structure for STA mode */
110110
struct {
@@ -139,46 +139,46 @@ struct vwifi_vif {
139139
struct ieee80211_channel *channel;
140140
enum nl80211_chan_width bw;
141141
};
142-
/* Structure for AD-HOC mode */
142+
/* Structure for IBSS(ad hoc) mode */
143143
struct {
144144
/* List node for storing ibss devices (vwifi->ibss_list is the
145-
* head), this field is for interface in AD-HOC mode.
145+
* head), this field is for interface in IBSS mode.
146146
*/
147147
struct list_head ibss_list;
148148
/* defines the channel to use if no other IBSS to join can be found
149149
*/
150-
struct cfg80211_chan_def ah_chandef;
151-
u16 ah_beacon_int;
150+
struct cfg80211_chan_def ibss_chandef;
151+
u16 ibss_beacon_int;
152152
/* bitmap of basic rates */
153-
u32 ah_basic_rates;
153+
u32 ibss_basic_rates;
154154
/* The channel should be fixed -- do not search for IBSSs to join on
155155
* other channels. */
156-
bool ah_channel_fixed;
156+
bool ibss_channel_fixed;
157157
/* This is a protected network, keys will be configured after
158158
* joining */
159-
bool ah_privacy;
159+
bool ibss_privacy;
160160
/* whether user space controls IEEE 802.1X port, i.e.,
161161
* sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
162162
* required to assume that the port is unauthorized until authorized
163163
* by user space. Otherwise, port is marked authorized by default.
164164
*/
165-
bool ah_control_port;
165+
bool ibss_control_port;
166166
/* TRUE if userspace expects to exchange control
167167
* port frames over NL80211 instead of the network interface.
168168
*/
169-
bool ah_control_port_over_nl80211;
169+
bool ibss_control_port_over_nl80211;
170170
/* whether user space controls DFS operation */
171-
bool ah_userspace_handles_dfs;
171+
bool ibss_userspace_handles_dfs;
172172
/* per-band multicast rate index + 1 (0: disabled) */
173-
int ah_mcast_rate[NUM_NL80211_BANDS];
173+
int ibss_mcast_rate[NUM_NL80211_BANDS];
174174
/* HT Capabilities over-rides. */
175-
struct ieee80211_ht_cap ah_ht_capa;
175+
struct ieee80211_ht_cap ibss_ht_capa;
176176
/* The bits of ht_capa which are to be used. */
177-
struct ieee80211_ht_cap ah_ht_capa_mask;
177+
struct ieee80211_ht_cap ibss_ht_capa_mask;
178178
/* static WEP keys */
179-
struct key_params *ah_wep_keys;
179+
struct key_params *ibss_wep_keys;
180180
/* key index (0..3) of the default TX static WEP key */
181-
int ah_wep_tx_key;
181+
int ibss_wep_tx_key;
182182
};
183183
};
184184

@@ -551,7 +551,7 @@ static void inform_bss(struct vwifi_vif *vif)
551551
/* Helper function that prepares a structure with self-defined BSS information
552552
* and "informs" the kernel about the "new" Independent BSS.
553553
*/
554-
static void ah_inform_bss(struct vwifi_vif *vif)
554+
static void ibss_inform_bss(struct vwifi_vif *vif)
555555
{
556556
struct vwifi_vif *ibss;
557557

@@ -567,7 +567,7 @@ static void ah_inform_bss(struct vwifi_vif *vif)
567567
};
568568
int capability = WLAN_CAPABILITY_IBSS;
569569

570-
if (ibss->ah_privacy)
570+
if (ibss->ibss_privacy)
571571
capability |= WLAN_CAPABILITY_PRIVACY;
572572

573573
pr_info("vwifi: %s performs scan, found %s (SSID: %s, BSSID: %pM)\n",
@@ -586,7 +586,7 @@ static void ah_inform_bss(struct vwifi_vif *vif)
586586
/* It is possible to use cfg80211_inform_bss() instead. */
587587
bss = cfg80211_inform_bss_data(
588588
vif->wdev.wiphy, &data, CFG80211_BSS_FTYPE_UNKNOWN, ibss->bssid,
589-
tsf, capability, ibss->ah_beacon_int, ibss->beacon_ie,
589+
tsf, capability, ibss->ibss_beacon_int, ibss->beacon_ie,
590590
ibss->beacon_ie_len, GFP_KERNEL);
591591

592592
/* cfg80211_inform_bss_data() returns cfg80211_bss structure reference
@@ -949,7 +949,7 @@ static netdev_tx_t vwifi_ndo_start_xmit(struct sk_buff *skb,
949949
}
950950
}
951951
}
952-
/* TX by interface of AD-HOC mode */
952+
/* TX by interface of IBSS(ad-hoc) mode */
953953
else if (vif->wdev.iftype == NL80211_IFTYPE_ADHOC) {
954954
/* Check if the packet is broadcasting */
955955
if (is_broadcast_ether_addr(eth_hdr->h_dest)) {
@@ -1028,7 +1028,7 @@ static void vwifi_scan_timeout_work(struct work_struct *w)
10281028

10291029
/* inform with dummy BSS */
10301030
inform_bss(vif);
1031-
ah_inform_bss(vif);
1031+
ibss_inform_bss(vif);
10321032

10331033
if (mutex_lock_interruptible(&vif->lock))
10341034
return;
@@ -1575,7 +1575,7 @@ static int vwifi_change_iface(struct wiphy *wiphy,
15751575
ndev->ieee80211_ptr->iftype = type;
15761576
break;
15771577
case NL80211_IFTYPE_ADHOC:
1578-
pr_info("vwifi: %s start acting in AD-HOC mode.\n", ndev->name);
1578+
pr_info("vwifi: %s start acting in IBSS mode.\n", ndev->name);
15791579
ndev->ieee80211_ptr->iftype = type;
15801580
break;
15811581
default:
@@ -2067,22 +2067,22 @@ static int vwifi_join_ibss(struct wiphy *wiphy,
20672067
/* Retrieve IBSS configuration parameters */
20682068
memcpy(vif->ssid, params->ssid, params->ssid_len);
20692069
memcpy(vif->bssid, params->bssid, ETH_ALEN);
2070-
vif->ah_chandef = params->chandef;
2070+
vif->ibss_chandef = params->chandef;
20712071
vif->ssid_len = params->ssid_len;
20722072
vif->beacon_ie_len = params->ie_len;
20732073
memcpy(vif->beacon_ie, params->ie, params->ie_len);
2074-
vif->ah_beacon_int = params->beacon_interval;
2075-
vif->ah_basic_rates = params->basic_rates;
2076-
vif->ah_channel_fixed = params->channel_fixed;
2077-
vif->ah_privacy = params->privacy;
2078-
vif->ah_control_port = params->control_port;
2079-
vif->ah_control_port_over_nl80211 = params->control_port_over_nl80211;
2080-
vif->ah_userspace_handles_dfs = params->userspace_handles_dfs;
2081-
memcpy(vif->ah_mcast_rate, params->mcast_rate, sizeof(params->mcast_rate));
2082-
vif->ah_ht_capa = params->ht_capa;
2083-
vif->ah_ht_capa_mask = params->ht_capa_mask;
2084-
vif->ah_wep_keys = params->wep_keys;
2085-
vif->ah_wep_tx_key = params->wep_tx_key;
2074+
vif->ibss_beacon_int = params->beacon_interval;
2075+
vif->ibss_basic_rates = params->basic_rates;
2076+
vif->ibss_channel_fixed = params->channel_fixed;
2077+
vif->ibss_privacy = params->privacy;
2078+
vif->ibss_control_port = params->control_port;
2079+
vif->ibss_control_port_over_nl80211 = params->control_port_over_nl80211;
2080+
vif->ibss_userspace_handles_dfs = params->userspace_handles_dfs;
2081+
memcpy(vif->ibss_mcast_rate, params->mcast_rate, sizeof(params->mcast_rate));
2082+
vif->ibss_ht_capa = params->ht_capa;
2083+
vif->ibss_ht_capa_mask = params->ht_capa_mask;
2084+
vif->ibss_wep_keys = params->wep_keys;
2085+
vif->ibss_wep_tx_key = params->wep_tx_key;
20862086

20872087
mutex_unlock(&vif->lock);
20882088

0 commit comments

Comments
 (0)