forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/staging/wlan-ng/cfg80211.c
....@@ -70,13 +70,14 @@
7070 return err;
7171 }
7272
73
-static int prism2_domibset_uint32(struct wlandevice *wlandev, u32 did, u32 data)
73
+static int prism2_domibset_uint32(struct wlandevice *wlandev,
74
+ u32 did, u32 data)
7475 {
7576 struct p80211msg_dot11req_mibset msg;
7677 struct p80211item_uint32 *mibitem =
7778 (struct p80211item_uint32 *)&msg.mibattribute.data;
7879
79
- msg.msgcode = DIDmsg_dot11req_mibset;
80
+ msg.msgcode = DIDMSG_DOT11REQ_MIBSET;
8081 mibitem->did = did;
8182 mibitem->data = data;
8283
....@@ -90,7 +91,7 @@
9091 struct p80211item_pstr32 *mibitem =
9192 (struct p80211item_pstr32 *)&msg.mibattribute.data;
9293
93
- msg.msgcode = DIDmsg_dot11req_mibset;
94
+ msg.msgcode = DIDMSG_DOT11REQ_MIBSET;
9495 mibitem->did = did;
9596 mibitem->data.len = len;
9697 memcpy(mibitem->data.data, data, len);
....@@ -129,7 +130,7 @@
129130
130131 /* Set Operation mode to the PORT TYPE RID */
131132 result = prism2_domibset_uint32(wlandev,
132
- DIDmib_p2_p2Static_p2CnfPortType,
133
+ DIDMIB_P2_STATIC_CNFPORTTYPE,
133134 data);
134135
135136 if (result)
....@@ -158,12 +159,12 @@
158159 }
159160
160161 if (prism2_domibset_uint32(wlandev,
161
- DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
162
+ DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
162163 key_index))
163164 return -EFAULT;
164165
165166 /* send key to driver */
166
- did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_key(key_index + 1);
167
+ did = didmib_dot11smt_wepdefaultkeystable_key(key_index + 1);
167168
168169 if (prism2_domibset_pstr32(wlandev, did, params->key_len, params->key))
169170 return -EFAULT;
....@@ -216,7 +217,7 @@
216217 return -EINVAL;
217218
218219 /* send key to driver */
219
- did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_key(key_index + 1);
220
+ did = didmib_dot11smt_wepdefaultkeystable_key(key_index + 1);
220221 result = prism2_domibset_pstr32(wlandev, did, 13, "0000000000000");
221222
222223 if (result)
....@@ -230,17 +231,9 @@
230231 {
231232 struct wlandevice *wlandev = dev->ml_priv;
232233
233
- int err = 0;
234
- int result = 0;
235
-
236
- result = prism2_domibset_uint32(wlandev,
237
- DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
238
- key_index);
239
-
240
- if (result)
241
- err = -EFAULT;
242
-
243
- return err;
234
+ return prism2_domibset_uint32(wlandev,
235
+ DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
236
+ key_index);
244237 }
245238
246239 static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
....@@ -256,7 +249,7 @@
256249 return -EOPNOTSUPP;
257250
258251 /* build request message */
259
- quality.msgcode = DIDmsg_lnxreq_commsquality;
252
+ quality.msgcode = DIDMSG_LNXREQ_COMMSQUALITY;
260253 quality.dbm.data = P80211ENUM_truth_true;
261254 quality.dbm.status = P80211ENUM_msgitem_status_data_ok;
262255
....@@ -311,7 +304,7 @@
311304 priv->scan_request = request;
312305
313306 memset(&msg1, 0x00, sizeof(msg1));
314
- msg1.msgcode = DIDmsg_dot11req_scan;
307
+ msg1.msgcode = DIDMSG_DOT11REQ_SCAN;
315308 msg1.bsstype.data = P80211ENUM_bsstype_any;
316309
317310 memset(&msg1.bssid.data.data, 0xFF, sizeof(msg1.bssid.data.data));
....@@ -350,7 +343,7 @@
350343 int freq;
351344
352345 memset(&msg2, 0, sizeof(msg2));
353
- msg2.msgcode = DIDmsg_dot11req_scan_results;
346
+ msg2.msgcode = DIDMSG_DOT11REQ_SCAN_RESULTS;
354347 msg2.bssindex.data = i;
355348
356349 result = p80211req_dorequest(wlandev, (u8 *)&msg2);
....@@ -366,16 +359,15 @@
366359 freq = ieee80211_channel_to_frequency(msg2.dschannel.data,
367360 NL80211_BAND_2GHZ);
368361 bss = cfg80211_inform_bss(wiphy,
369
- ieee80211_get_channel(wiphy, freq),
370
- CFG80211_BSS_FTYPE_UNKNOWN,
371
- (const u8 *)&msg2.bssid.data.data,
372
- msg2.timestamp.data, msg2.capinfo.data,
373
- msg2.beaconperiod.data,
374
- ie_buf,
375
- ie_len,
376
- (msg2.signal.data - 65536) * 100, /* Conversion to signed type */
377
- GFP_KERNEL
378
- );
362
+ ieee80211_get_channel(wiphy, freq),
363
+ CFG80211_BSS_FTYPE_UNKNOWN,
364
+ (const u8 *)&msg2.bssid.data.data,
365
+ msg2.timestamp.data, msg2.capinfo.data,
366
+ msg2.beaconperiod.data,
367
+ ie_buf,
368
+ ie_len,
369
+ (msg2.signal.data - 65536) * 100, /* Conversion to signed type */
370
+ GFP_KERNEL);
379371
380372 if (!bss) {
381373 err = -ENOMEM;
....@@ -410,7 +402,7 @@
410402 data = wiphy->rts_threshold;
411403
412404 result = prism2_domibset_uint32(wlandev,
413
- DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold,
405
+ DIDMIB_DOT11MAC_OPERATIONTABLE_RTSTHRESHOLD,
414406 data);
415407 if (result) {
416408 err = -EFAULT;
....@@ -425,7 +417,7 @@
425417 data = wiphy->frag_threshold;
426418
427419 result = prism2_domibset_uint32(wlandev,
428
- DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
420
+ DIDMIB_DOT11MAC_OPERATIONTABLE_FRAGMENTATIONTHRESHOLD,
429421 data);
430422 if (result) {
431423 err = -EFAULT;
....@@ -455,7 +447,7 @@
455447 if (channel) {
456448 chan = ieee80211_frequency_to_channel(channel->center_freq);
457449 result = prism2_domibset_uint32(wlandev,
458
- DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel,
450
+ DIDMIB_DOT11PHY_DSSSTABLE_CURRENTCHANNEL,
459451 chan);
460452 if (result)
461453 goto exit;
....@@ -480,13 +472,13 @@
480472 return -EINVAL;
481473
482474 result = prism2_domibset_uint32(wlandev,
483
- DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
475
+ DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
484476 sme->key_idx);
485477 if (result)
486478 goto exit;
487479
488480 /* send key to driver */
489
- did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_key(
481
+ did = didmib_dot11smt_wepdefaultkeystable_key(
490482 sme->key_idx + 1);
491483 result = prism2_domibset_pstr32(wlandev,
492484 did, sme->key_len,
....@@ -500,13 +492,13 @@
500492 * seems reasonable anyways
501493 */
502494 result = prism2_domibset_uint32(wlandev,
503
- DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked,
495
+ DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED,
504496 P80211ENUM_truth_true);
505497 if (result)
506498 goto exit;
507499
508500 result = prism2_domibset_uint32(wlandev,
509
- DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted,
501
+ DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED,
510502 P80211ENUM_truth_true);
511503 if (result)
512504 goto exit;
....@@ -516,13 +508,13 @@
516508 * and exclude unencrypted
517509 */
518510 result = prism2_domibset_uint32(wlandev,
519
- DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked,
511
+ DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED,
520512 P80211ENUM_truth_false);
521513 if (result)
522514 goto exit;
523515
524516 result = prism2_domibset_uint32(wlandev,
525
- DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted,
517
+ DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED,
526518 P80211ENUM_truth_false);
527519 if (result)
528520 goto exit;
....@@ -531,7 +523,7 @@
531523 /* Now do the actual join. Note there is no way that I can
532524 * see to request a specific bssid
533525 */
534
- msg_join.msgcode = DIDmsg_lnxreq_autojoin;
526
+ msg_join.msgcode = DIDMSG_LNXREQ_AUTOJOIN;
535527
536528 memcpy(msg_join.ssid.data.data, sme->ssid, length);
537529 msg_join.ssid.data.len = length;
....@@ -554,7 +546,7 @@
554546 int err = 0;
555547
556548 /* Do a join, with a bogus ssid. Thats the only way I can think of */
557
- msg_join.msgcode = DIDmsg_lnxreq_autojoin;
549
+ msg_join.msgcode = DIDMSG_LNXREQ_AUTOJOIN;
558550
559551 memcpy(msg_join.ssid.data.data, "---", 3);
560552 msg_join.ssid.data.len = 3;
....@@ -593,7 +585,7 @@
593585 data = MBM_TO_DBM(mbm);
594586
595587 result = prism2_domibset_uint32(wlandev,
596
- DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel,
588
+ DIDMIB_DOT11PHY_TXPOWERTABLE_CURRENTTXPOWERLEVEL,
597589 data);
598590
599591 if (result) {
....@@ -616,9 +608,8 @@
616608 int err = 0;
617609
618610 mibitem = (struct p80211item_uint32 *)&msg.mibattribute.data;
619
- msg.msgcode = DIDmsg_dot11req_mibget;
620
- mibitem->did =
621
- DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel;
611
+ msg.msgcode = DIDMSG_DOT11REQ_MIBGET;
612
+ mibitem->did = DIDMIB_DOT11PHY_TXPOWERTABLE_CURRENTTXPOWERLEVEL;
622613
623614 result = p80211req_dorequest(wlandev, (u8 *)&msg);
624615
....@@ -677,7 +668,8 @@
677668 };
678669
679670 /* Functions to create/free wiphy interface */
680
-static struct wiphy *wlan_create_wiphy(struct device *dev, struct wlandevice *wlandev)
671
+static struct wiphy *wlan_create_wiphy(struct device *dev,
672
+ struct wlandevice *wlandev)
681673 {
682674 struct wiphy *wiphy;
683675 struct prism2_wiphy_private *priv;