Skip to content

Commit 2b632f7

Browse files
Philipp Hortmanngregkh
authored andcommitted
staging: rtl8192e: Remove unsupported mode IW_MODE_MASTER
Tasklet irq_rx_tasklet is scheduled when hw is receiving frames. Function _rtl92e_irq_rx_tasklet() is then called which calls then _rtl92e_rx_normal(). In _rtl92e_rx_normal() all frames are processed by rtllib_rx(). When ieee->iw_mode is IW_MODE_MASTER the function returns 0. The calling function then calls: dev_kfree_skb_any() which clears the skb. So the driver clears all packets received in this mode. Remove dead code in mode IW_MODE_MASTER. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/9cd4574e4cfe0a2d7afce03c9b868757e215a23c.1691908402.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6a83264 commit 2b632f7

8 files changed

Lines changed: 9 additions & 44 deletions

File tree

drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ static void _rtl92e_update_msr(struct net_device *dev)
5959
if (priv->rtllib->link_state == MAC80211_LINKED)
6060
msr |= MSR_LINK_ADHOC;
6161
break;
62-
case IW_MODE_MASTER:
63-
if (priv->rtllib->link_state == MAC80211_LINKED)
64-
msr |= MSR_LINK_MASTER;
65-
break;
6662
default:
6763
break;
6864
}

drivers/staging/rtl8192e/rtl8192e/rtl_ps.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ void rtl92e_ips_enter(struct net_device *dev)
118118

119119
rt_state = priv->rtllib->rf_power_state;
120120
if (rt_state == rf_on && !psc->bSwRfProcessing &&
121-
(priv->rtllib->link_state != MAC80211_LINKED) &&
122-
(priv->rtllib->iw_mode != IW_MODE_MASTER)) {
121+
(priv->rtllib->link_state != MAC80211_LINKED)) {
123122
psc->eInactivePowerState = rf_off;
124123
_rtl92e_ps_update_rf_state(dev);
125124
}
@@ -210,8 +209,7 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
210209

211210
if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) &&
212211
(priv->rtllib->link_state == MAC80211_LINKED))
213-
|| (priv->rtllib->iw_mode == IW_MODE_ADHOC) ||
214-
(priv->rtllib->iw_mode == IW_MODE_MASTER))
212+
|| (priv->rtllib->iw_mode == IW_MODE_ADHOC))
215213
return;
216214

217215
if (psc->bLeisurePs) {

drivers/staging/rtl8192e/rtl819x_HTProc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,
363363
}
364364

365365
memset(posHTInfo, 0, *len);
366-
if ((ieee->iw_mode == IW_MODE_ADHOC) ||
367-
(ieee->iw_mode == IW_MODE_MASTER)) {
366+
if (ieee->iw_mode == IW_MODE_ADHOC) {
368367
pHTInfoEle->ControlChl = ieee->current_network.channel;
369368
pHTInfoEle->ExtChlOffset = ((!pHT->bRegBW40MHz) ?
370369
HT_EXTCHNL_OFFSET_NO_EXT :

drivers/staging/rtl8192e/rtl819x_TSProc.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
182182
struct list_head *psearch_list;
183183
struct ts_common_info *pRet = NULL;
184184

185-
if (ieee->iw_mode == IW_MODE_MASTER) {
186-
if (TxRxSelect == TX_DIR) {
187-
search_dir[DIR_DOWN] = true;
188-
search_dir[DIR_BI_DIR] = true;
189-
} else {
190-
search_dir[DIR_UP] = true;
191-
search_dir[DIR_BI_DIR] = true;
192-
}
193-
} else if (ieee->iw_mode == IW_MODE_ADHOC) {
185+
if (ieee->iw_mode == IW_MODE_ADHOC) {
194186
if (TxRxSelect == TX_DIR)
195187
search_dir[DIR_UP] = true;
196188
else
@@ -311,9 +303,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
311303
(&ieee->Tx_TS_Admit_List) :
312304
(&ieee->Rx_TS_Admit_List);
313305

314-
Dir = (ieee->iw_mode == IW_MODE_MASTER) ?
315-
((TxRxSelect == TX_DIR) ? DIR_DOWN : DIR_UP) :
316-
((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN);
306+
Dir = ((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN);
317307

318308
if (!list_empty(pUnusedList)) {
319309
(*ppTS) = list_entry(pUnusedList->next,

drivers/staging/rtl8192e/rtllib_rx.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,6 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
14961496
case IW_MODE_INFRA:
14971497
ret = rtllib_rx_InfraAdhoc(ieee, skb, rx_stats);
14981498
break;
1499-
case IW_MODE_MASTER:
15001499
case IW_MODE_REPEAT:
15011500
break;
15021501
case IW_MODE_MONITOR:
@@ -2682,8 +2681,7 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee,
26822681
netdev_dbg(ieee->dev, "received PROBE REQUEST (%d)\n",
26832682
WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
26842683
if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) &&
2685-
((ieee->iw_mode == IW_MODE_ADHOC ||
2686-
ieee->iw_mode == IW_MODE_MASTER) &&
2684+
(ieee->iw_mode == IW_MODE_ADHOC &&
26872685
ieee->link_state == MAC80211_LINKED))
26882686
rtllib_rx_probe_rq(ieee, skb);
26892687
break;

drivers/staging/rtl8192e/rtllib_softmac.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,7 @@ static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest)
935935
ether_addr_copy(assoc->header.addr1, dest);
936936
ether_addr_copy(assoc->header.addr3, ieee->dev->dev_addr);
937937
ether_addr_copy(assoc->header.addr2, ieee->dev->dev_addr);
938-
assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ?
939-
WLAN_CAPABILITY_ESS : WLAN_CAPABILITY_IBSS);
938+
assoc->capability = cpu_to_le16(WLAN_CAPABILITY_IBSS);
940939

941940
assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME);
942941

@@ -2248,8 +2247,6 @@ rtllib_rx_auth(struct rtllib_device *ieee, struct sk_buff *skb,
22482247
netdev_dbg(ieee->dev,
22492248
"Received authentication response");
22502249
rtllib_rx_auth_resp(ieee, skb);
2251-
} else if (ieee->iw_mode == IW_MODE_MASTER) {
2252-
rtllib_rx_auth_rq(ieee, skb);
22532250
}
22542251
}
22552252
return 0;
@@ -2309,9 +2306,6 @@ inline int rtllib_rx_frame_softmac(struct rtllib_device *ieee,
23092306
break;
23102307
case RTLLIB_STYPE_ASSOC_REQ:
23112308
case RTLLIB_STYPE_REASSOC_REQ:
2312-
if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
2313-
ieee->iw_mode == IW_MODE_MASTER)
2314-
rtllib_rx_assoc_rq(ieee, skb);
23152309
break;
23162310
case RTLLIB_STYPE_AUTH:
23172311
rtllib_rx_auth(ieee, skb, rx_stats);
@@ -2807,9 +2801,6 @@ void rtllib_start_protocol(struct rtllib_device *ieee)
28072801
case IW_MODE_ADHOC:
28082802
rtllib_start_ibss(ieee);
28092803
break;
2810-
case IW_MODE_MASTER:
2811-
rtllib_start_master_bss(ieee);
2812-
break;
28132804
case IW_MODE_MONITOR:
28142805
rtllib_start_monitor_mode(ieee);
28152806
break;

drivers/staging/rtl8192e/rtllib_softmac_wx.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
5151
ieee->current_network.channel = fwrq->m;
5252
ieee->set_chan(ieee->dev, ieee->current_network.channel);
5353

54-
if (ieee->iw_mode == IW_MODE_ADHOC ||
55-
ieee->iw_mode == IW_MODE_MASTER)
54+
if (ieee->iw_mode == IW_MODE_ADHOC)
5655
if (ieee->link_state == MAC80211_LINKED) {
5756
rtllib_stop_send_beacons(ieee);
5857
rtllib_start_send_beacons(ieee);
@@ -125,10 +124,6 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,
125124

126125
mutex_lock(&ieee->wx_mutex);
127126
/* use ifconfig hw ether */
128-
if (ieee->iw_mode == IW_MODE_MASTER) {
129-
ret = -1;
130-
goto out;
131-
}
132127

133128
if (temp->sa_family != ARPHRD_ETHER) {
134129
ret = -EINVAL;
@@ -366,7 +361,7 @@ void rtllib_wx_sync_scan_wq(void *data)
366361
ieee->link_detect_info.NumRecvBcnInPeriod = 1;
367362
ieee->link_detect_info.NumRecvDataInPeriod = 1;
368363
}
369-
if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
364+
if (ieee->iw_mode == IW_MODE_ADHOC)
370365
rtllib_start_send_beacons(ieee);
371366

372367
rtllib_wake_all_queues(ieee);

drivers/staging/rtl8192e/rtllib_tx.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,6 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee,
463463
}
464464
if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
465465
tcb_desc->bUseShortPreamble = true;
466-
if (ieee->iw_mode == IW_MODE_MASTER)
467-
goto NO_PROTECTION;
468466
return;
469467
NO_PROTECTION:
470468
tcb_desc->bRTSEnable = false;

0 commit comments

Comments
 (0)