aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/join.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-08-02 11:31:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:43 -0400
commit0aef64d75851c9f3545d0793f26486ed862306d8 (patch)
tree5cf333e35691636ce1dc728c749679359677cb66 /drivers/net/wireless/libertas/join.c
parentb44898eb2c917cd397a0d8654f1c249dd3cdc67e (diff)
[PATCH] libertas: re-uppercase command defines and other constants
For readability. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/join.c')
-rw-r--r--drivers/net/wireless/libertas/join.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index db467e7876f2..3530c23da798 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -88,7 +88,7 @@ int libertas_send_deauth(wlan_private * priv)
88 int ret = 0; 88 int ret = 0;
89 89
90 if (adapter->mode == IW_MODE_INFRA && 90 if (adapter->mode == IW_MODE_INFRA &&
91 adapter->connect_status == libertas_connected) 91 adapter->connect_status == LIBERTAS_CONNECTED)
92 ret = libertas_send_deauthentication(priv); 92 ret = libertas_send_deauthentication(priv);
93 else 93 else
94 ret = -ENOTSUPP; 94 ret = -ENOTSUPP;
@@ -111,8 +111,8 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req)
111 111
112 lbs_deb_enter(LBS_DEB_JOIN); 112 lbs_deb_enter(LBS_DEB_JOIN);
113 113
114 ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate, 114 ret = libertas_prepare_and_send_command(priv, CMD_802_11_AUTHENTICATE,
115 0, cmd_option_waitforrsp, 115 0, CMD_OPTION_WAITFORRSP,
116 0, assoc_req->bss.bssid); 116 0, assoc_req->bss.bssid);
117 117
118 if (ret) 118 if (ret)
@@ -121,14 +121,14 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req)
121 /* set preamble to firmware */ 121 /* set preamble to firmware */
122 if ( (adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) 122 if ( (adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
123 && (assoc_req->bss.capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) 123 && (assoc_req->bss.capability & WLAN_CAPABILITY_SHORT_PREAMBLE))
124 adapter->preamble = cmd_type_short_preamble; 124 adapter->preamble = CMD_TYPE_SHORT_PREAMBLE;
125 else 125 else
126 adapter->preamble = cmd_type_long_preamble; 126 adapter->preamble = CMD_TYPE_LONG_PREAMBLE;
127 127
128 libertas_set_radio_control(priv); 128 libertas_set_radio_control(priv);
129 129
130 ret = libertas_prepare_and_send_command(priv, cmd_802_11_associate, 130 ret = libertas_prepare_and_send_command(priv, CMD_802_11_ASSOCIATE,
131 0, cmd_option_waitforrsp, 0, assoc_req); 131 0, CMD_OPTION_WAITFORRSP, 0, assoc_req);
132 132
133done: 133done:
134 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); 134 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
@@ -151,10 +151,10 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass
151 151
152 if (adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) { 152 if (adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) {
153 lbs_deb_join("AdhocStart: Short preamble\n"); 153 lbs_deb_join("AdhocStart: Short preamble\n");
154 adapter->preamble = cmd_type_short_preamble; 154 adapter->preamble = CMD_TYPE_SHORT_PREAMBLE;
155 } else { 155 } else {
156 lbs_deb_join("AdhocStart: Long preamble\n"); 156 lbs_deb_join("AdhocStart: Long preamble\n");
157 adapter->preamble = cmd_type_long_preamble; 157 adapter->preamble = CMD_TYPE_LONG_PREAMBLE;
158 } 158 }
159 159
160 libertas_set_radio_control(priv); 160 libertas_set_radio_control(priv);
@@ -162,8 +162,8 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass
162 lbs_deb_join("AdhocStart: channel = %d\n", assoc_req->channel); 162 lbs_deb_join("AdhocStart: channel = %d\n", assoc_req->channel);
163 lbs_deb_join("AdhocStart: band = %d\n", assoc_req->band); 163 lbs_deb_join("AdhocStart: band = %d\n", assoc_req->band);
164 164
165 ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_start, 165 ret = libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_START,
166 0, cmd_option_waitforrsp, 0, assoc_req); 166 0, CMD_OPTION_WAITFORRSP, 0, assoc_req);
167 167
168 return ret; 168 return ret;
169} 169}
@@ -209,10 +209,10 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso
209 if ( !(bss->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) 209 if ( !(bss->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
210 || !(adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) { 210 || !(adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) {
211 lbs_deb_join("AdhocJoin: Long preamble\n"); 211 lbs_deb_join("AdhocJoin: Long preamble\n");
212 adapter->preamble = cmd_type_long_preamble; 212 adapter->preamble = CMD_TYPE_LONG_PREAMBLE;
213 } else { 213 } else {
214 lbs_deb_join("AdhocJoin: Short preamble\n"); 214 lbs_deb_join("AdhocJoin: Short preamble\n");
215 adapter->preamble = cmd_type_short_preamble; 215 adapter->preamble = CMD_TYPE_SHORT_PREAMBLE;
216 } 216 }
217 217
218 libertas_set_radio_control(priv); 218 libertas_set_radio_control(priv);
@@ -222,8 +222,8 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso
222 222
223 adapter->adhoccreate = 0; 223 adapter->adhoccreate = 0;
224 224
225 ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_join, 225 ret = libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_JOIN,
226 0, cmd_option_waitforrsp, 226 0, CMD_OPTION_WAITFORRSP,
227 OID_802_11_SSID, assoc_req); 227 OID_802_11_SSID, assoc_req);
228 228
229 return ret; 229 return ret;
@@ -231,8 +231,8 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso
231 231
232int libertas_stop_adhoc_network(wlan_private * priv) 232int libertas_stop_adhoc_network(wlan_private * priv)
233{ 233{
234 return libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_stop, 234 return libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_STOP,
235 0, cmd_option_waitforrsp, 0, NULL); 235 0, CMD_OPTION_WAITFORRSP, 0, NULL);
236} 236}
237 237
238/** 238/**
@@ -243,8 +243,8 @@ int libertas_stop_adhoc_network(wlan_private * priv)
243 */ 243 */
244int libertas_send_deauthentication(wlan_private * priv) 244int libertas_send_deauthentication(wlan_private * priv)
245{ 245{
246 return libertas_prepare_and_send_command(priv, cmd_802_11_deauthenticate, 246 return libertas_prepare_and_send_command(priv, CMD_802_11_DEAUTHENTICATE,
247 0, cmd_option_waitforrsp, 0, NULL); 247 0, CMD_OPTION_WAITFORRSP, 0, NULL);
248} 248}
249 249
250/** 250/**
@@ -267,7 +267,7 @@ int libertas_cmd_80211_authenticate(wlan_private * priv,
267 267
268 lbs_deb_enter(LBS_DEB_JOIN); 268 lbs_deb_enter(LBS_DEB_JOIN);
269 269
270 cmd->command = cpu_to_le16(cmd_802_11_authenticate); 270 cmd->command = cpu_to_le16(CMD_802_11_AUTHENTICATE);
271 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate) 271 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate)
272 + S_DS_GEN); 272 + S_DS_GEN);
273 273
@@ -307,7 +307,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv,
307 307
308 lbs_deb_enter(LBS_DEB_JOIN); 308 lbs_deb_enter(LBS_DEB_JOIN);
309 309
310 cmd->command = cpu_to_le16(cmd_802_11_deauthenticate); 310 cmd->command = cpu_to_le16(CMD_802_11_DEAUTHENTICATE);
311 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_deauthenticate) + 311 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_deauthenticate) +
312 S_DS_GEN); 312 S_DS_GEN);
313 313
@@ -349,7 +349,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
349 goto done; 349 goto done;
350 } 350 }
351 351
352 cmd->command = cpu_to_le16(cmd_802_11_associate); 352 cmd->command = cpu_to_le16(CMD_802_11_ASSOCIATE);
353 353
354 memcpy(passo->peerstaaddr, bss->bssid, sizeof(passo->peerstaaddr)); 354 memcpy(passo->peerstaaddr, bss->bssid, sizeof(passo->peerstaaddr));
355 pos += sizeof(passo->peerstaaddr); 355 pos += sizeof(passo->peerstaaddr);
@@ -465,7 +465,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
465 goto done; 465 goto done;
466 } 466 }
467 467
468 cmd->command = cpu_to_le16(cmd_802_11_ad_hoc_start); 468 cmd->command = cpu_to_le16(CMD_802_11_AD_HOC_START);
469 469
470 /* 470 /*
471 * Fill in the parameters for 2 data structures: 471 * Fill in the parameters for 2 data structures:
@@ -487,7 +487,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
487 assoc_req->ssid_len); 487 assoc_req->ssid_len);
488 488
489 /* set the BSS type */ 489 /* set the BSS type */
490 adhs->bsstype = cmd_bss_type_ibss; 490 adhs->bsstype = CMD_BSS_TYPE_IBSS;
491 adapter->mode = IW_MODE_ADHOC; 491 adapter->mode = IW_MODE_ADHOC;
492 adhs->beaconperiod = cpu_to_le16(adapter->beaconperiod); 492 adhs->beaconperiod = cpu_to_le16(adapter->beaconperiod);
493 493
@@ -524,7 +524,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
524 adhs->capability = cpu_to_le16(tmpcap); 524 adhs->capability = cpu_to_le16(tmpcap);
525 525
526 /* probedelay */ 526 /* probedelay */
527 adhs->probedelay = cpu_to_le16(cmd_scan_probe_delay_time); 527 adhs->probedelay = cpu_to_le16(CMD_SCAN_PROBE_DELAY_TIME);
528 528
529 memset(adhs->datarate, 0, sizeof(adhs->datarate)); 529 memset(adhs->datarate, 0, sizeof(adhs->datarate));
530 530
@@ -569,7 +569,7 @@ done:
569int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv, 569int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv,
570 struct cmd_ds_command *cmd) 570 struct cmd_ds_command *cmd)
571{ 571{
572 cmd->command = cpu_to_le16(cmd_802_11_ad_hoc_stop); 572 cmd->command = cpu_to_le16(CMD_802_11_AD_HOC_STOP);
573 cmd->size = cpu_to_le16(S_DS_GEN); 573 cmd->size = cpu_to_le16(S_DS_GEN);
574 574
575 return 0; 575 return 0;
@@ -590,9 +590,9 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
590 590
591 lbs_deb_enter(LBS_DEB_JOIN); 591 lbs_deb_enter(LBS_DEB_JOIN);
592 592
593 cmd->command = cpu_to_le16(cmd_802_11_ad_hoc_join); 593 cmd->command = cpu_to_le16(CMD_802_11_AD_HOC_JOIN);
594 594
595 join_cmd->bss.type = cmd_bss_type_ibss; 595 join_cmd->bss.type = CMD_BSS_TYPE_IBSS;
596 join_cmd->bss.beaconperiod = cpu_to_le16(bss->beaconperiod); 596 join_cmd->bss.beaconperiod = cpu_to_le16(bss->beaconperiod);
597 597
598 memcpy(&join_cmd->bss.bssid, &bss->bssid, ETH_ALEN); 598 memcpy(&join_cmd->bss.bssid, &bss->bssid, ETH_ALEN);
@@ -617,7 +617,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
617 join_cmd->failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT); 617 join_cmd->failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT);
618 618
619 /* probedelay */ 619 /* probedelay */
620 join_cmd->probedelay = cpu_to_le16(cmd_scan_probe_delay_time); 620 join_cmd->probedelay = cpu_to_le16(CMD_SCAN_PROBE_DELAY_TIME);
621 621
622 /* Copy Data rates from the rates recorded in scan response */ 622 /* Copy Data rates from the rates recorded in scan response */
623 memset(join_cmd->bss.datarates, 0, sizeof(join_cmd->bss.datarates)); 623 memset(join_cmd->bss.datarates, 0, sizeof(join_cmd->bss.datarates));
@@ -659,14 +659,14 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
659 join_cmd->bss.capability = cpu_to_le16(tmp); 659 join_cmd->bss.capability = cpu_to_le16(tmp);
660 } 660 }
661 661
662 if (adapter->psmode == wlan802_11powermodemax_psp) { 662 if (adapter->psmode == WLAN802_11POWERMODEMAX_PSP) {
663 /* wake up first */ 663 /* wake up first */
664 __le32 Localpsmode; 664 __le32 Localpsmode;
665 665
666 Localpsmode = cpu_to_le32(wlan802_11powermodecam); 666 Localpsmode = cpu_to_le32(WLAN802_11POWERMODECAM);
667 ret = libertas_prepare_and_send_command(priv, 667 ret = libertas_prepare_and_send_command(priv,
668 cmd_802_11_ps_mode, 668 CMD_802_11_PS_MODE,
669 cmd_act_set, 669 CMD_ACT_SET,
670 0, 0, &Localpsmode); 670 0, 0, &Localpsmode);
671 671
672 if (ret) { 672 if (ret) {
@@ -722,7 +722,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
722 le16_to_cpu(resp->size) - S_DS_GEN); 722 le16_to_cpu(resp->size) - S_DS_GEN);
723 723
724 /* Send a Media Connected event, according to the Spec */ 724 /* Send a Media Connected event, according to the Spec */
725 adapter->connect_status = libertas_connected; 725 adapter->connect_status = LIBERTAS_CONNECTED;
726 726
727 lbs_deb_join("ASSOC_RESP: assocated to '%s'\n", 727 lbs_deb_join("ASSOC_RESP: assocated to '%s'\n",
728 escape_essid(bss->ssid, bss->ssid_len)); 728 escape_essid(bss->ssid, bss->ssid_len));
@@ -802,7 +802,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
802 */ 802 */
803 if (result) { 803 if (result) {
804 lbs_deb_join("ADHOC_RESP: failed\n"); 804 lbs_deb_join("ADHOC_RESP: failed\n");
805 if (adapter->connect_status == libertas_connected) { 805 if (adapter->connect_status == LIBERTAS_CONNECTED) {
806 libertas_mac_event_disconnected(priv); 806 libertas_mac_event_disconnected(priv);
807 } 807 }
808 ret = -1; 808 ret = -1;
@@ -817,9 +817,9 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
817 escape_essid(bss->ssid, bss->ssid_len)); 817 escape_essid(bss->ssid, bss->ssid_len));
818 818
819 /* Send a Media Connected event, according to the Spec */ 819 /* Send a Media Connected event, according to the Spec */
820 adapter->connect_status = libertas_connected; 820 adapter->connect_status = LIBERTAS_CONNECTED;
821 821
822 if (command == cmd_ret_802_11_ad_hoc_start) { 822 if (command == CMD_RET_802_11_AD_HOC_START) {
823 /* Update the created network descriptor with the new BSSID */ 823 /* Update the created network descriptor with the new BSSID */
824 memcpy(bss->bssid, padhocresult->bssid, ETH_ALEN); 824 memcpy(bss->bssid, padhocresult->bssid, ETH_ALEN);
825 } 825 }