| |   |
| 24 | 24 | #include <linux/pm.h> |
| 25 | 25 | #include <linux/vmalloc.h> |
| 26 | 26 | #include <linux/firmware.h> |
| 27 | | #include <net/iw_handler.h> |
| 27 | //#include <net/iw_handler.h> |
| 28 | 28 | #include <linux/ethtool.h> |
| 29 | | #include <linux/utsrelease.h> |
| 29 | //#include <linux/utsrelease.h> |
| 30 | 30 | |
| 31 | 31 | #include "acx.h" |
| 32 | 32 | |
| … | … | |
| 99 | 99 | static unsigned max_lock_time; |
| 100 | 100 | static unsigned max_sem_time; |
| 101 | 101 | |
| 102 | /* Obvious or linux kernel specific derived code follows: */ |
| 103 | |
| 102 | 104 | void acx_lock_unhold() |
| 103 | 105 | { |
| 104 | 106 | max_lock_time = 0; |
| … | … | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | |
| 245 | | /*********************************************************************** |
| 246 | | ** acx_get_status_name |
| 247 | | */ |
| 248 | | static const char *acx_get_status_name(u16 status) |
| 249 | | { |
| 250 | | static const char *const str[] = { |
| 251 | | "STOPPED", "SCANNING", "WAIT_AUTH", |
| 252 | | "AUTHENTICATED", "ASSOCIATED", "INVALID??" |
| 253 | | }; |
| 254 | | if (status > ARRAY_SIZE(str) - 1) |
| 255 | | status = ARRAY_SIZE(str) - 1; |
| 256 | | |
| 257 | | return str[status]; |
| 258 | | } |
| 259 | | |
| 260 | | |
| 261 | | /*********************************************************************** |
| 262 | | ** acx_get_packet_type_string |
| 263 | | */ |
| 264 | | #if ACX_DEBUG |
| 265 | | const char *acx_get_packet_type_string(u16 fc) |
| 266 | | { |
| 267 | | static const char *const mgmt_arr[] = { |
| 268 | | "MGMT/AssocReq", "MGMT/AssocResp", "MGMT/ReassocReq", |
| 269 | | "MGMT/ReassocResp", "MGMT/ProbeReq", "MGMT/ProbeResp", |
| 270 | | "MGMT/UNKNOWN", "MGMT/UNKNOWN", "MGMT/Beacon", "MGMT/ATIM", |
| 271 | | "MGMT/Disassoc", "MGMT/Authen", "MGMT/Deauthen" |
| 272 | | }; |
| 273 | | static const char *const ctl_arr[] = { |
| 274 | | "CTL/PSPoll", "CTL/RTS", "CTL/CTS", "CTL/Ack", "CTL/CFEnd", |
| 275 | | "CTL/CFEndCFAck" |
| 276 | | }; |
| 277 | | static const char *const data_arr[] = { |
| 278 | | "DATA/DataOnly", "DATA/Data CFAck", "DATA/Data CFPoll", |
| 279 | | "DATA/Data CFAck/CFPoll", "DATA/Null", "DATA/CFAck", |
| 280 | | "DATA/CFPoll", "DATA/CFAck/CFPoll" |
| 281 | | }; |
| 282 | | const char *str; |
| 283 | | u8 fstype = (WF_FC_FSTYPE & fc) >> 4; |
| 284 | | u8 ctl; |
| 285 | | |
| 286 | | switch (WF_FC_FTYPE & fc) { |
| 287 | | case WF_FTYPE_MGMT: |
| 288 | | if (fstype < ARRAY_SIZE(mgmt_arr)) |
| 289 | | str = mgmt_arr[fstype]; |
| 290 | | else |
| 291 | | str = "MGMT/UNKNOWN"; |
| 292 | | break; |
| 293 | | case WF_FTYPE_CTL: |
| 294 | | ctl = fstype - 0x0a; |
| 295 | | if (ctl < ARRAY_SIZE(ctl_arr)) |
| 296 | | str = ctl_arr[ctl]; |
| 297 | | else |
| 298 | | str = "CTL/UNKNOWN"; |
| 299 | | break; |
| 300 | | case WF_FTYPE_DATA: |
| 301 | | if (fstype < ARRAY_SIZE(data_arr)) |
| 302 | | str = data_arr[fstype]; |
| 303 | | else |
| 304 | | str = "DATA/UNKNOWN"; |
| 305 | | break; |
| 306 | | default: |
| 307 | | str = "UNKNOWN"; |
| 308 | | break; |
| 309 | | } |
| 310 | | return str; |
| 311 | | } |
| 312 | | #endif |
| 313 | | |
| 314 | | |
| 315 | | /*********************************************************************** |
| 316 | | ** acx_wlan_reason_str |
| 317 | | */ |
| 318 | | static inline const char *acx_wlan_reason_str(u16 reason) |
| 319 | | { |
| 320 | | static const char *const reason_str[] = { |
| 321 | | /* 0 */ "?", |
| 322 | | /* 1 */ "unspecified", |
| 323 | | /* 2 */ "prev auth is not valid", |
| 324 | | /* 3 */ "leaving BBS", |
| 325 | | /* 4 */ "due to inactivity", |
| 326 | | /* 5 */ "AP is busy", |
| 327 | | /* 6 */ "got class 2 frame from non-auth'ed STA", |
| 328 | | /* 7 */ "got class 3 frame from non-assoc'ed STA", |
| 329 | | /* 8 */ "STA has left BSS", |
| 330 | | /* 9 */ "assoc without auth is not allowed", |
| 331 | | /* 10 */ "bad power setting (802.11h)", |
| 332 | | /* 11 */ "bad channel (802.11i)", |
| 333 | | /* 12 */ "?", |
| 334 | | /* 13 */ "invalid IE", |
| 335 | | /* 14 */ "MIC failure", |
| 336 | | /* 15 */ "four-way handshake timeout", |
| 337 | | /* 16 */ "group key handshake timeout", |
| 338 | | /* 17 */ "IE is different", |
| 339 | | /* 18 */ "invalid group cipher", |
| 340 | | /* 19 */ "invalid pairwise cipher", |
| 341 | | /* 20 */ "invalid AKMP", |
| 342 | | /* 21 */ "unsupported RSN version", |
| 343 | | /* 22 */ "invalid RSN IE cap", |
| 344 | | /* 23 */ "802.1x failed", |
| 345 | | /* 24 */ "cipher suite rejected" |
| 346 | | }; |
| 347 | | return reason < ARRAY_SIZE(reason_str) ? reason_str[reason] : "?"; |
| 348 | | } |
| 349 | 245 | |
| 350 | 246 | |
| 351 | 247 | /*********************************************************************** |
| … | … | |
| 272 | 272 | cmd_error_strings[state] : "?"; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | | |
| 276 | | /*********************************************************************** |
| 277 | | ** get_status_string |
| 278 | | */ |
| 279 | | static inline const char *get_status_string(unsigned int status) |
| 280 | | { |
| 281 | | /* A bit shortened, but hopefully still understandable */ |
| 282 | | static const char *const status_str[] = { |
| 283 | | /* 0 */ "Successful", |
| 284 | | /* 1 */ "Unspecified failure", |
| 285 | | /* 2 */ "reserved", |
| 286 | | /* 3 */ "reserved", |
| 287 | | /* 4 */ "reserved", |
| 288 | | /* 5 */ "reserved", |
| 289 | | /* 6 */ "reserved", |
| 290 | | /* 7 */ "reserved", |
| 291 | | /* 8 */ "reserved", |
| 292 | | /* 9 */ "reserved", |
| 293 | | /*10 */ |
| 294 | | "Cannot support all requested capabilities in Capability Information field", |
| 295 | | /*11 */ "Reassoc denied (reason outside of 802.11b scope)", |
| 296 | | /*12 */ |
| 297 | | "Assoc denied (reason outside of 802.11b scope) -- maybe MAC filtering by peer?", |
| 298 | | /*13 */ |
| 299 | | "Responding station doesnt support specified auth algorithm -- maybe WRP auth Open vs. Restricted", |
| 300 | | /*14 */ "Auth rejected: wrong transaction sequence number", |
| 301 | | /*15 */ "Auth rejected: challenge failure", |
| 302 | | /*16 */ "Auth rejected: timeout for next frame in sequence", |
| 303 | | /*17 */ "Assoc denied: too many STAs on this AP", |
| 304 | | /*18 */ |
| 305 | | "Assoc denied: requesting STA doesnt support all data rates in basic set", |
| 306 | | /*19 */ |
| 307 | | "Assoc denied: requesting STA doesnt support Short Preamble", |
| 308 | | /*20 */ |
| 309 | | "Assoc denied: requesting STA doesnt support PBCC Modulation", |
| 310 | | /*21 */ |
| 311 | | "Assoc denied: requesting STA doesnt support Channel Agility" |
| 312 | | /*22 */ "reserved", |
| 313 | | /*23 */ "reserved", |
| 314 | | /*24 */ "reserved", |
| 315 | | /*25 */ |
| 316 | | "Assoc denied: requesting STA doesnt support Short Slot Time", |
| 317 | | /*26 */ "Assoc denied: requesting STA doesnt support DSSS-OFDM" |
| 318 | | }; |
| 319 | | |
| 320 | | return status_str[status < ARRAY_SIZE(status_str) ? status : 2]; |
| 321 | | } |
| 322 | | |
| 323 | 275 | /*********************************************************************** |
| 324 | 276 | */ |
| 325 | 277 | #if ACX_DEBUG |
| … | … | |
| 305 | 305 | |
| 306 | 306 | /*********************************************************************** |
| 307 | 307 | ** acx_s_get_firmware_version |
| 308 | ** |
| 309 | ** Obvious |
| 308 | 310 | */ |
| 309 | 311 | void acx_s_get_firmware_version(acx_device_t * adev) |
| 310 | 312 | { |
| … | … | |
| 393 | 393 | ** acx_display_hardware_details |
| 394 | 394 | ** |
| 395 | 395 | ** Displays hw/fw version, radio type etc... |
| 396 | ** |
| 397 | ** Obvious |
| 396 | 398 | */ |
| 397 | 399 | void acx_display_hardware_details(acx_device_t * adev) |
| 398 | 400 | { |
| … | … | |
| 461 | 461 | |
| 462 | 462 | |
| 463 | 463 | /*********************************************************************** |
| 464 | | */ |
| 465 | | int acx_e_change_mtu(struct ieee80211_hw *hw, int mtu) |
| 466 | | { |
| 467 | | enum { |
| 468 | | MIN_MTU = 256, |
| 469 | | MAX_MTU = WLAN_DATA_MAXLEN - (ETH_HLEN) |
| 470 | | }; |
| 471 | | |
| 472 | | if (mtu < MIN_MTU || mtu > MAX_MTU) |
| 473 | | return -EINVAL; |
| 474 | | |
| 475 | | // hw->mtu = mtu; |
| 476 | | return 1; |
| 477 | | } |
| 478 | | |
| 479 | | /*********************************************************************** |
| 480 | 464 | ** acx_e_get_stats, acx_e_get_wireless_stats |
| 481 | 465 | */ |
| 482 | 466 | int |
| … | … | |
| 475 | 475 | return 0; |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | | struct iw_statistics *acx_e_get_wireless_stats(struct ieee80211_hw *hw) |
| 479 | | { |
| 480 | | acx_device_t *adev = ieee2adev(hw); |
| 481 | | return &adev->wstats; |
| 482 | | } |
| 483 | | |
| 484 | 478 | |
| 485 | 479 | /*********************************************************************** |
| 486 | 480 | ** maps acx111 tx descr rate field to acx100 one |
| … | … | |
| 829 | 829 | adev->form_factor, |
| 830 | 830 | adev->eeprom_version, |
| 831 | 831 | adev->firmware_version, adev->firmware_numver); |
| 832 | | /* |
| 833 | | for (i = 0; i < VEC_SIZE(adev->sta_list); i++) { |
| 834 | | struct client *bss = &adev->sta_list[i]; |
| 835 | | if (!bss->used) continue; |
| 836 | | p += sprintf(p, "BSS %u BSSID "MACSTR" ESSID %s channel %u " |
| 837 | | "Cap 0x%X SIR %u SNR %u\n", |
| 838 | | i, MAC(bss->bssid), (char*)bss->essid, bss->channel, |
| 839 | | bss->cap_info, bss->sir, bss->snr); |
| 840 | | } |
| 841 | | */ |
| 842 | | p += sprintf(p, "status:\t\t\t%u (%s)\n", |
| 843 | | adev->status, acx_get_status_name(adev->status)); |
| 844 | 832 | |
| 845 | 833 | FN_EXIT1(p - buf); |
| 846 | 834 | return p - buf; |
| … | … | |
| 870 | 870 | "\n" |
| 871 | 871 | "** network status **\n" |
| 872 | 872 | "dev_state_mask 0x%04X\n" |
| 873 | | "status %u (%s), " |
| 874 | 873 | "mode %u, channel %u, " |
| 875 | 874 | "reg_dom_id 0x%02X, reg_dom_chanmask 0x%04X, ", |
| 876 | 875 | adev->dev_state_mask, |
| 877 | | adev->status, acx_get_status_name(adev->status), |
| 878 | 876 | adev->mode, adev->channel, |
| 879 | 877 | adev->reg_dom_id, adev->reg_dom_chanmask); |
| 880 | 878 | p += sprintf(p, |
| … | … | |
| 1414 | 1414 | return manage_proc_entries(ieee, 1); |
| 1415 | 1415 | } |
| 1416 | 1416 | #endif /* CONFIG_PROC_FS */ |
| 1417 | | /* |
| 1418 | | void acx_get_drvinfo(struct ieee80211_hw *hw, |
| 1419 | | struct ethtool_drvinfo *info) |
| 1420 | | { |
| 1421 | | acx_device_t *adev = ieee2adev(hw); |
| 1422 | | |
| 1423 | | strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); |
| 1424 | | strncpy(info->version, UTS_RELEASE, sizeof(info->version)); |
| 1425 | | acx_put_devname(adev,info); |
| 1426 | | } |
| 1427 | 1417 | |
| 1428 | | struct ethtool_ops acx_ethtool_ops = { |
| 1429 | | .get_drvinfo = acx_get_drvinfo, |
| 1430 | | .get_link = ethtool_op_get_link, |
| 1431 | | }; |
| 1432 | | */ |
| 1418 | /**** |
| 1419 | ** Gathered From rt2x00 and bcm43xx_mac80211 projects |
| 1420 | **/ |
| 1433 | 1421 | void acx_free_modes(acx_device_t * adev) |
| 1434 | 1422 | { |
| 1435 | 1423 | |
| 1436 | | /* for (i = 0; i < ieee->num_modes; i++) { |
| 1437 | | kfree(ieee->modes[i].channels); |
| 1438 | | kfree(ieee->modes[i].rates); |
| 1439 | | }*/ |
| 1440 | 1424 | kfree(adev->modes); |
| 1441 | 1425 | adev->modes = NULL; |
| 1442 | 1426 | } |
| 1443 | | /* |
| 1444 | | int acx_append_mode(struct ieee80211_hw *ieee, |
| 1445 | | int mode_id, |
| 1446 | | int nr_channels, |
| 1447 | | const struct ieee80211_channel *channels, |
| 1448 | | int nr_rates, const struct ieee80211_rate *rates) |
| 1449 | | { |
| 1450 | | struct ieee80211_hw_modes *mode; |
| 1451 | | int err = -ENOMEM; |
| 1452 | | |
| 1453 | | mode = &(ieee->modes[ieee->num_modes]); |
| 1454 | | |
| 1455 | | mode->mode = mode_id; |
| 1456 | | mode->num_channels = nr_channels; |
| 1457 | | mode->channels = kzalloc(sizeof(*channels) * nr_channels, GFP_KERNEL); |
| 1458 | | if (!mode->channels) |
| 1459 | | goto out; |
| 1460 | | memcpy(mode->channels, channels, sizeof(*channels) * nr_channels); |
| 1461 | | |
| 1462 | | mode->num_rates = nr_rates; |
| 1463 | | mode->rates = kzalloc(sizeof(*rates) * nr_rates, GFP_KERNEL); |
| 1464 | | if (!mode->rates) |
| 1465 | | goto err_free_channels; |
| 1466 | | memcpy(mode->rates, rates, sizeof(*rates) * nr_rates); |
| 1467 | 1427 | |
| 1468 | | err = 0; |
| 1469 | | out: |
| 1470 | | return err; |
| 1471 | | |
| 1472 | | err_free_channels: |
| 1473 | | kfree(mode->channels); |
| 1474 | | goto out; |
| 1475 | | |
| 1476 | | } |
| 1477 | | */ |
| 1478 | 1428 | #define RATETAB_ENT(_rateid, _flags) \ |
| 1479 | 1429 | { \ |
| 1480 | 1430 | .rate = (_rateid), \ |
| … | … | |
| 1462 | 1462 | .flag = IEEE80211_CHAN_W_SCAN | \ |
| 1463 | 1463 | IEEE80211_CHAN_W_ACTIVE_SCAN | \ |
| 1464 | 1464 | IEEE80211_CHAN_W_IBSS, \ |
| 1465 | | .power_level = 0xFF, \ |
| 1465 | .power_level = 0xf, \ |
| 1466 | 1466 | .antenna_max = 0xFF, \ |
| 1467 | 1467 | } |
| 1468 | 1468 | static struct ieee80211_channel channels[] = { |
| … | … | |
| 1538 | 1538 | /*********************************************************************** |
| 1539 | 1539 | ** acx_fill_beacon_or_proberesp_template |
| 1540 | 1540 | ** |
| 1541 | | ** For frame format info, please see 802.11-1999.pdf item 7.2.3.9 and below!! |
| 1542 | | ** |
| 1543 | | ** NB: we use the fact that |
| 1544 | | ** struct acx_template_proberesp and struct acx_template_beacon are the same |
| 1545 | | ** (well, almost...) |
| 1546 | | ** |
| 1547 | | ** [802.11] Beacon's body consist of these IEs: |
| 1548 | | ** 1 Timestamp |
| 1549 | | ** 2 Beacon interval |
| 1550 | | ** 3 Capability information |
| 1551 | | ** 4 SSID |
| 1552 | | ** 5 Supported rates (up to 8 rates) |
| 1553 | | ** 6 FH Parameter Set (frequency-hopping PHYs only) |
| 1554 | | ** 7 DS Parameter Set (direct sequence PHYs only) |
| 1555 | | ** 8 CF Parameter Set (only if PCF is supported) |
| 1556 | | ** 9 IBSS Parameter Set (ad-hoc only) |
| 1557 | | ** |
| 1558 | | ** Beacon only: |
| 1559 | | ** 10 TIM (AP only) (see 802.11 7.3.2.6) |
| 1560 | | ** 11 Country Information (802.11d) |
| 1561 | | ** 12 FH Parameters (802.11d) |
| 1562 | | ** 13 FH Pattern Table (802.11d) |
| 1563 | | ** ... (?!! did not yet find relevant PDF file... --vda) |
| 1564 | | ** 19 ERP Information (extended rate PHYs) |
| 1565 | | ** 20 Extended Supported Rates (if more than 8 rates) |
| 1566 | | ** |
| 1567 | | ** Proberesp only: |
| 1568 | | ** 10 Country information (802.11d) |
| 1569 | | ** 11 FH Parameters (802.11d) |
| 1570 | | ** 12 FH Pattern Table (802.11d) |
| 1571 | | ** 13-n Requested information elements (802.11d) |
| 1572 | | ** ???? |
| 1573 | | ** 18 ERP Information (extended rate PHYs) |
| 1574 | | ** 19 Extended Supported Rates (if more than 8 rates) |
| 1541 | ** Origin: derived from rt2x00 project |
| 1575 | 1542 | */ |
| 1576 | 1543 | static int |
| 1577 | 1544 | acx_fill_beacon_or_proberesp_template(acx_device_t *adev, |
| 1578 | 1545 | struct acx_template_beacon *templ, |
| 1579 | | u16 fc /* in host order! */) |
| 1546 | struct sk_buff* skb /* in host order! */) |
| 1580 | 1547 | { |
| 1581 | | int len; |
| 1582 | | u8 *p; |
| 1583 | | |
| 1584 | 1548 | FN_ENTER; |
| 1585 | 1549 | |
| 1586 | | memset(templ, 0, sizeof(*templ)); |
| 1587 | | MAC_BCAST(templ->da); |
| 1588 | | MAC_COPY(templ->sa, adev->dev_addr); |
| 1589 | | MAC_COPY(templ->bssid, adev->bssid); |
| 1590 | | |
| 1591 | | templ->beacon_interval = cpu_to_le16(adev->beacon_interval); |
| 1592 | | acx_update_capabilities(adev); |
| 1593 | | templ->cap = cpu_to_le16(adev->capabilities); |
| 1594 | | |
| 1595 | | p = templ->variable; |
| 1596 | | p = wlan_fill_ie_ssid(p, adev->essid_len, adev->essid); |
| 1597 | | p = wlan_fill_ie_rates(p, adev->rate_supported_len, adev->rate_supported); |
| 1598 | | p = wlan_fill_ie_ds_parms(p, adev->channel); |
| 1599 | | /* NB: should go AFTER tim, but acx seem to keep tim last always */ |
| 1600 | | p = wlan_fill_ie_rates_ext(p, adev->rate_supported_len, adev->rate_supported); |
| 1601 | | |
| 1602 | | switch (adev->mode) { |
| 1603 | | case ACX_MODE_0_ADHOC: |
| 1604 | | /* ATIM window */ |
| 1605 | | p = wlan_fill_ie_ibss_parms(p, 0); break; |
| 1606 | | case ACX_MODE_3_AP: |
| 1607 | | /* TIM IE is set up as separate template */ |
| 1608 | | break; |
| 1609 | | } |
| 1610 | | |
| 1611 | | len = p - (u8*)templ; |
| 1612 | | templ->fc = cpu_to_le16(WF_FTYPE_MGMT | fc); |
| 1613 | | /* - 2: do not count 'u16 size' field */ |
| 1614 | | templ->size = cpu_to_le16(len - 2); |
| 1615 | | |
| 1616 | | FN_EXIT1(len); |
| 1617 | | return len; |
| 1550 | memcpy(templ,skb->data, skb->len); |
| 1551 | FN_EXIT1(skb->len); |
| 1552 | return skb->len; |
| 1618 | 1553 | } |
| 1619 | 1554 | |
| 1620 | 1555 | /*********************************************************************** |
| 1621 | 1556 | ** acx_s_set_beacon_template |
| 1557 | ** |
| 1558 | ** |
| 1622 | 1559 | */ |
| 1623 | 1560 | static int |
| 1624 | | acx_s_set_beacon_template(acx_device_t *adev) |
| 1561 | acx_s_set_beacon_template(acx_device_t *adev, struct sk_buff *skb) |
| 1625 | 1562 | { |
| 1626 | 1563 | struct acx_template_beacon bcn; |
| 1627 | 1564 | int len, result; |
| 1628 | 1565 | |
| 1629 | 1566 | FN_ENTER; |
| 1630 | | |
| 1631 | | len = acx_fill_beacon_or_proberesp_template(adev, &bcn, WF_FSTYPE_BEACON); |
| 1567 | printk("Size of template: %08X, Size of beacon: %08X\n",sizeof(struct acx_template_beacon),skb->len); |
| 1568 | len = acx_fill_beacon_or_proberesp_template(adev, &bcn, skb); |
| 1632 | 1569 | result = acx_s_issue_cmd(adev, ACX1xx_CMD_CONFIG_BEACON, &bcn, len); |
| 1633 | 1570 | |
| 1634 | 1571 | FN_EXIT1(result); |
| … | … | |
| 1608 | 1608 | } |
| 1609 | 1609 | |
| 1610 | 1610 | |
| 1611 | | static void |
| 1612 | | acx_s_cmd_join_bssid(acx_device_t *adev, const u8 *bssid) |
| 1611 | void acx_s_cmd_join_bssid(acx_device_t *adev, const u8 *bssid) |
| 1613 | 1612 | { |
| 1614 | 1613 | acx_joinbss_t tmp; |
| 1615 | 1614 | int dtim_interval; |
| … | … | |
| 1666 | 1666 | tmp.macmode = (adev->mode != ACX_MODE_MONITOR ? adev->mode : ACX_MODE_2_STA); |
| 1667 | 1667 | tmp.channel = adev->channel; |
| 1668 | 1668 | tmp.essid_len = adev->essid_len; |
| 1669 | | /* NOTE: the code memcpy'd essid_len + 1 before, which is WRONG! */ |
| 1669 | |
| 1670 | 1670 | memcpy(tmp.essid, adev->essid, tmp.essid_len); |
| 1671 | 1671 | acx_s_issue_cmd(adev, ACX1xx_CMD_JOIN, &tmp, tmp.essid_len + 0x11); |
| 1672 | 1672 | |
| 1673 | 1673 | log(L_ASSOC|L_DEBUG, "BSS_Type = %u\n", tmp.macmode); |
| 1674 | 1674 | acxlog_mac(L_ASSOC|L_DEBUG, "JoinBSSID MAC:", adev->bssid, "\n"); |
| 1675 | 1675 | |
| 1676 | | acx_update_capabilities(adev); |
| 1676 | /* acx_update_capabilities(adev); */ |
| 1677 | 1677 | FN_EXIT0; |
| 1678 | 1678 | } |
| 1679 | 1679 | |
| 1680 | | |
| 1681 | | |
| 1682 | 1680 | /*********************************************************************** |
| 1683 | | ** acx_s_cmd_start_scan |
| 1684 | | ** |
| 1685 | | ** Issue scan command to the hardware |
| 1686 | | ** |
| 1687 | | ** unified function for both ACX111 and ACX100 |
| 1688 | | */ |
| 1689 | | /* |
| 1690 | | int acx_passive_scan(struct net_device *net_dev, int state, |
| 1691 | | struct ieee80211_scan_conf *conf) |
| 1692 | | { |
| 1693 | | union { |
| 1694 | | acx111_scan_t acx111; |
| 1695 | | acx100_scan_t acx100; |
| 1696 | | } s; |
| 1697 | | unsigned long flags; |
| 1698 | | acx_device_t *adev = ieee2adev(hw); |
| 1699 | | FN_ENTER; |
| 1700 | | acx_lock(adev, flags); |
| 1701 | | memset(&s, 0, sizeof(s)); |
| 1702 | | */ |
| 1703 | | /* first common positions... */ |
| 1704 | | /* |
| 1705 | | s.acx111.count = cpu_to_le16(adev->scan_count); |
| 1706 | | s.acx111.rate = adev->scan_rate; |
| 1707 | | s.acx111.options = ACX_SCAN_OPT_PASSIVE; |
| 1708 | | s.acx111.chan_duration = cpu_to_le16(adev->scan_duration); |
| 1709 | | s.acx111.max_probe_delay = cpu_to_le16(adev->scan_probe_delay); |
| 1681 | ** acxpci_i_set_multicast_list |
| 1682 | ** FIXME: most likely needs refinement |
| 1710 | 1683 | */ |
| 1711 | | /* ...then differences */ |
| 1712 | | |
| 1713 | | // if (IS_ACX111(adev)) { |
| 1714 | | /*s.acx111.channel_list_select = 0; *//* scan every allowed channel */ |
| 1715 | | // s.acx111.channel_list_select = 1; /* scan given channels */ |
| 1716 | | /*s.acx111.modulation = 0x40; *//* long preamble? OFDM? -> only for active scan */ |
| 1717 | | // s.acx111.modulation = 0; |
| 1718 | | // s.acx111.channel_list[0] = conf->scan_channel; |
| 1719 | | /*s.acx111.channel_list[1] = 4; */ |
| 1720 | | /* } else { |
| 1721 | | s.acx100.start_chan = cpu_to_le16(conf->scan_channel); |
| 1722 | | s.acx100.flags = cpu_to_le16(conf->scan_channel); |
| 1723 | | } |
| 1724 | | |
| 1725 | | acx_s_issue_cmd(adev, ACX1xx_CMD_SCAN, &s, sizeof(s)); |
| 1726 | | acx_unlock(adev, flags); |
| 1727 | | FN_EXIT0; |
| 1728 | | return 0; |
| 1729 | | }*/ |
| 1730 | | static void acx_s_scan_chan(acx_device_t * adev) |
| 1684 | void |
| 1685 | acx_i_set_multicast_list(struct ieee80211_hw *hw, |
| 1686 | unsigned short netflags, int mc_count) |
| 1731 | 1687 | { |
| 1732 | | union { |
| 1733 | | acx111_scan_t acx111; |
| 1734 | | acx100_scan_t acx100; |
| 1735 | | } s; |
| 1736 | | |
| 1737 | | FN_ENTER; |
| 1738 | | |
| 1739 | | memset(&s, 0, sizeof(s)); |
| 1740 | | |
| 1741 | | /* first common positions... */ |
| 1742 | | |
| 1743 | | s.acx111.count = cpu_to_le16(adev->scan_count); |
| 1744 | | s.acx111.rate = adev->scan_rate; |
| 1745 | | s.acx111.options = adev->scan_mode; |
| 1746 | | s.acx111.chan_duration = cpu_to_le16(adev->scan_duration); |
| 1747 | | s.acx111.max_probe_delay = cpu_to_le16(adev->scan_probe_delay); |
| 1688 | |