Lines Matching refs:local

72 static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx,
74 static void ray_build_header(ray_dev_t *local, struct tx_msg __iomem *ptx,
76 static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len);
81 static void authenticate(ray_dev_t *local);
82 static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type);
84 static int get_free_ccs(ray_dev_t *local);
85 static int get_free_tx_ccs(ray_dev_t *local);
86 static void init_startup_params(ray_dev_t *local);
90 static int interrupt_ecf(ray_dev_t *local, int ccs);
97 static void clear_interrupt(ray_dev_t *local);
98 static void rx_deauthenticate(ray_dev_t *local, struct rcs __iomem *prcs,
100 static int copy_from_rx_buff(ray_dev_t *local, UCHAR *dest, int pkt_addr, int len);
101 static void ray_rx(struct net_device *dev, ray_dev_t *local, struct rcs __iomem *prcs);
102 static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs);
103 static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,
107 static void associate(ray_dev_t *local);
271 ray_dev_t *local; in ray_probe() local
282 local = netdev_priv(dev); in ray_probe()
283 local->finder = p_dev; in ray_probe()
295 local->finder = p_dev; in ray_probe()
296 local->card_status = CARD_INSERTED; in ray_probe()
297 local->authentication_state = UNAUTHENTICATED; in ray_probe()
298 local->num_multi = 0; in ray_probe()
300 p_dev, dev, local, &ray_interrupt); in ray_probe()
306 local->wireless_data.spy_data = &local->spy_data; in ray_probe()
307 dev->wireless_data = &local->wireless_data; in ray_probe()
314 timer_setup(&local->timer, NULL, 0); in ray_probe()
352 ray_dev_t *local = netdev_priv(dev); in ray_config() local
385 local->sram = ioremap(link->resource[2]->start, in ray_config()
387 if (!local->sram) in ray_config()
401 local->rmem = ioremap(link->resource[3]->start, in ray_config()
403 if (!local->rmem) in ray_config()
417 local->amem = ioremap(link->resource[4]->start, in ray_config()
419 if (!local->amem) in ray_config()
422 dev_dbg(&link->dev, "ray_config sram=%p\n", local->sram); in ray_config()
423 dev_dbg(&link->dev, "ray_config rmem=%p\n", local->rmem); in ray_config()
424 dev_dbg(&link->dev, "ray_config amem=%p\n", local->amem); in ray_config()
470 ray_dev_t *local = netdev_priv(dev); in ray_init() local
471 struct pcmcia_device *link = local->finder; in ray_init()
478 local->net_type = net_type; in ray_init()
479 local->sta_type = TYPE_STA; in ray_init()
482 memcpy_fromio(&local->startup_res, local->sram + ECF_TO_HOST_BASE, in ray_init()
486 if (local->startup_res.startup_word != 0x80) { in ray_init()
488 local->startup_res.startup_word); in ray_init()
489 local->card_status = CARD_INIT_ERROR; in ray_init()
493 local->fw_ver = local->startup_res.firmware_version[0]; in ray_init()
494 local->fw_bld = local->startup_res.firmware_version[1]; in ray_init()
495 local->fw_var = local->startup_res.firmware_version[2]; in ray_init()
496 dev_dbg(&link->dev, "ray_init firmware version %d.%d\n", local->fw_ver, in ray_init()
497 local->fw_bld); in ray_init()
499 local->tib_length = 0x20; in ray_init()
500 if ((local->fw_ver == 5) && (local->fw_bld >= 30)) in ray_init()
501 local->tib_length = local->startup_res.tib_length; in ray_init()
502 dev_dbg(&link->dev, "ray_init tib_length = 0x%02x\n", local->tib_length); in ray_init()
504 pccs = ccs_base(local); in ray_init()
508 init_startup_params(local); in ray_init()
511 if (!parse_addr(phy_addr, local->sparm.b4.a_mac_addr)) { in ray_init()
512 memcpy(&local->sparm.b4.a_mac_addr, in ray_init()
513 &local->startup_res.station_addr, ADDRLEN); in ray_init()
516 clear_interrupt(local); /* Clear any interrupt from the card */ in ray_init()
517 local->card_status = CARD_AWAITING_PARAM; in ray_init()
527 ray_dev_t *local = netdev_priv(dev); in dl_startup_params() local
529 struct pcmcia_device *link = local->finder; in dl_startup_params()
538 if (local->fw_ver == 0x55) in dl_startup_params()
539 memcpy_toio(local->sram + HOST_TO_ECF_BASE, &local->sparm.b4, in dl_startup_params()
542 memcpy_toio(local->sram + HOST_TO_ECF_BASE, &local->sparm.b5, in dl_startup_params()
546 if ((ccsindex = get_free_ccs(local)) < 0) in dl_startup_params()
548 local->dl_param_ccs = ccsindex; in dl_startup_params()
549 pccs = ccs_base(local) + ccsindex; in dl_startup_params()
552 local->dl_param_ccs); in dl_startup_params()
554 if (interrupt_ecf(local, ccsindex)) { in dl_startup_params()
557 local->card_status = CARD_DL_PARAM_ERROR; in dl_startup_params()
561 local->card_status = CARD_DL_PARAM; in dl_startup_params()
563 local->timer.expires = jiffies + HZ / 2; in dl_startup_params()
564 local->timer.function = verify_dl_startup; in dl_startup_params()
565 add_timer(&local->timer); in dl_startup_params()
572 static void init_startup_params(ray_dev_t *local) in init_startup_params() argument
592 if (local->fw_ver == 0x55) { in init_startup_params()
593 memcpy(&local->sparm.b4, b4_default_startup_parms, in init_startup_params()
598 local->sparm.b4.a_hop_time[0] = (i >> 16) & 0xff; in init_startup_params()
599 local->sparm.b4.a_hop_time[1] = (i >> 8) & 0xff; in init_startup_params()
600 local->sparm.b4.a_beacon_period[0] = 0; in init_startup_params()
601 local->sparm.b4.a_beacon_period[1] = in init_startup_params()
603 local->sparm.b4.a_curr_country_code = country; in init_startup_params()
604 local->sparm.b4.a_hop_pattern_length = in init_startup_params()
607 local->sparm.b4.a_ack_timeout = 0x50; in init_startup_params()
608 local->sparm.b4.a_sifs = 0x3f; in init_startup_params()
611 memcpy((UCHAR *) &local->sparm.b5, b5_default_startup_parms, in init_startup_params()
614 local->sparm.b5.a_hop_time[0] = (hop_dwell >> 8) & 0xff; in init_startup_params()
615 local->sparm.b5.a_hop_time[1] = hop_dwell & 0xff; in init_startup_params()
616 local->sparm.b5.a_beacon_period[0] = in init_startup_params()
618 local->sparm.b5.a_beacon_period[1] = beacon_period & 0xff; in init_startup_params()
620 local->sparm.b5.a_power_mgt_state = 1; in init_startup_params()
621 local->sparm.b5.a_curr_country_code = country; in init_startup_params()
622 local->sparm.b5.a_hop_pattern_length = in init_startup_params()
626 local->sparm.b4.a_network_type = net_type & 0x01; in init_startup_params()
627 local->sparm.b4.a_acting_as_ap_status = TYPE_STA; in init_startup_params()
630 strscpy(local->sparm.b4.a_current_ess_id, essid, ESSID_SIZE); in init_startup_params()
636 ray_dev_t *local = from_timer(local, t, timer); in verify_dl_startup() local
637 struct ccs __iomem *pccs = ccs_base(local) + local->dl_param_ccs; in verify_dl_startup()
639 struct pcmcia_device *link = local->finder; in verify_dl_startup()
650 local->dl_param_ccs); in verify_dl_startup()
653 (unsigned int)readb(local->sram + in verify_dl_startup()
665 local->card_status = CARD_DL_PARAM_ERROR; in verify_dl_startup()
668 if (local->sparm.b4.a_network_type == ADHOC) in verify_dl_startup()
669 start_net(&local->timer); in verify_dl_startup()
671 join_net(&local->timer); in verify_dl_startup()
678 ray_dev_t *local = from_timer(local, t, timer); in start_net() local
681 struct pcmcia_device *link = local->finder; in start_net()
687 if ((ccsindex = get_free_ccs(local)) < 0) in start_net()
689 pccs = ccs_base(local) + ccsindex; in start_net()
693 if (interrupt_ecf(local, ccsindex)) { in start_net()
698 local->card_status = CARD_DOING_ACQ; in start_net()
705 ray_dev_t *local = from_timer(local, t, timer); in join_net() local
709 struct pcmcia_device *link = local->finder; in join_net()
716 if ((ccsindex = get_free_ccs(local)) < 0) in join_net()
718 pccs = ccs_base(local) + ccsindex; in join_net()
723 if (interrupt_ecf(local, ccsindex)) { in join_net()
728 local->card_status = CARD_DOING_ACQ; in join_net()
735 ray_dev_t *local = netdev_priv(dev); in ray_release() local
739 del_timer_sync(&local->timer); in ray_release()
741 if (local->sram) in ray_release()
742 iounmap(local->sram); in ray_release()
743 if (local->rmem) in ray_release()
744 iounmap(local->rmem); in ray_release()
745 if (local->amem) in ray_release()
746 iounmap(local->amem); in ray_release()
780 ray_dev_t *local = netdev_priv(dev); in ray_dev_init() local
781 struct pcmcia_device *link = local->finder; in ray_dev_init()
801 local->card_status); in ray_dev_init()
805 eth_hw_addr_set(dev, local->sparm.b4.a_mac_addr); in ray_dev_init()
815 ray_dev_t *local = netdev_priv(dev); in ray_dev_config() local
816 struct pcmcia_device *link = local->finder; in ray_dev_config()
831 ray_dev_t *local = netdev_priv(dev); in ray_dev_start_xmit() local
832 struct pcmcia_device *link = local->finder; in ray_dev_start_xmit()
842 if (local->authentication_state == NEED_TO_AUTH) { in ray_dev_start_xmit()
844 if (!build_auth_frame(local, local->auth_id, OPEN_AUTH_REQUEST)) { in ray_dev_start_xmit()
845 local->authentication_state = AUTHENTICATED; in ray_dev_start_xmit()
875 ray_dev_t *local = netdev_priv(dev); in ray_hw_xmit() local
888 switch (ccsindex = get_free_tx_ccs(local)) { in ray_hw_xmit()
904 local->stats.tx_bytes += len; in ray_hw_xmit()
905 local->stats.tx_packets++; in ray_hw_xmit()
908 ptx = local->sram + addr; in ray_hw_xmit()
910 ray_build_header(local, ptx, msg_type, data); in ray_hw_xmit()
912 offset = translate_frame(local, ptx, data, len); in ray_hw_xmit()
920 pccs = ccs_base(local) + ccsindex; in ray_hw_xmit()
924 writeb(local->tib_length, &pccs->var.tx_request.tx_data_ptr[1]); in ray_hw_xmit()
929 writeb(local->net_default_tx_rate, &pccs->var.tx_request.tx_rate); in ray_hw_xmit()
932 local->net_default_tx_rate); in ray_hw_xmit()
935 if (interrupt_ecf(local, ccsindex)) { in ray_hw_xmit()
948 static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx, in translate_frame() argument
982 static void ray_build_header(ray_dev_t *local, struct tx_msg __iomem *ptx, in ray_build_header() argument
993 if (local->net_type == ADHOC) { in ray_build_header()
999 memcpy_toio(ptx->mac.addr_3, local->bss_id, ADDRLEN); in ray_build_header()
1002 if (local->sparm.b4.a_acting_as_ap_status) { in ray_build_header()
1006 memcpy_toio(ptx->mac.addr_2, local->bss_id, 6); in ray_build_header()
1012 memcpy_toio(ptx->mac.addr_1, local->bss_id, ADDRLEN); in ray_build_header()
1041 ray_dev_t *local = netdev_priv(dev); in ray_set_freq() local
1045 if (local->card_status != CARD_AWAITING_PARAM) in ray_set_freq()
1052 local->sparm.b5.a_hop_pattern = wrqu->freq.m; in ray_set_freq()
1064 ray_dev_t *local = netdev_priv(dev); in ray_get_freq() local
1066 wrqu->freq.m = local->sparm.b5.a_hop_pattern; in ray_get_freq()
1078 ray_dev_t *local = netdev_priv(dev); in ray_set_essid() local
1081 if (local->card_status != CARD_AWAITING_PARAM) in ray_set_essid()
1094 memset(local->sparm.b5.a_current_ess_id, 0, IW_ESSID_MAX_SIZE); in ray_set_essid()
1095 memcpy(local->sparm.b5.a_current_ess_id, extra, wrqu->essid.length); in ray_set_essid()
1107 ray_dev_t *local = netdev_priv(dev); in ray_get_essid() local
1111 memcpy(extra, local->sparm.b5.a_current_ess_id, IW_ESSID_MAX_SIZE); in ray_get_essid()
1112 memcpy(tmp, local->sparm.b5.a_current_ess_id, IW_ESSID_MAX_SIZE); in ray_get_essid()
1129 ray_dev_t *local = netdev_priv(dev); in ray_get_wap() local
1131 memcpy(wrqu->ap_addr.sa_data, local->bss_id, ETH_ALEN); in ray_get_wap()
1144 ray_dev_t *local = netdev_priv(dev); in ray_set_rate() local
1147 if (local->card_status != CARD_AWAITING_PARAM) in ray_set_rate()
1155 if ((local->fw_ver == 0x55) && /* Please check */ in ray_set_rate()
1157 local->net_default_tx_rate = 3; in ray_set_rate()
1159 local->net_default_tx_rate = wrqu->bitrate.value / 500000; in ray_set_rate()
1171 ray_dev_t *local = netdev_priv(dev); in ray_get_rate() local
1173 if (local->net_default_tx_rate == 3) in ray_get_rate()
1176 wrqu->bitrate.value = local->net_default_tx_rate * 500000; in ray_get_rate()
1189 ray_dev_t *local = netdev_priv(dev); in ray_set_rts() local
1193 if (local->card_status != CARD_AWAITING_PARAM) in ray_set_rts()
1203 local->sparm.b5.a_rts_threshold[0] = (rthr >> 8) & 0xFF; in ray_set_rts()
1204 local->sparm.b5.a_rts_threshold[1] = rthr & 0xFF; in ray_set_rts()
1216 ray_dev_t *local = netdev_priv(dev); in ray_get_rts() local
1218 wrqu->rts.value = (local->sparm.b5.a_rts_threshold[0] << 8) in ray_get_rts()
1219 + local->sparm.b5.a_rts_threshold[1]; in ray_get_rts()
1233 ray_dev_t *local = netdev_priv(dev); in ray_set_frag() local
1237 if (local->card_status != CARD_AWAITING_PARAM) in ray_set_frag()
1247 local->sparm.b5.a_frag_threshold[0] = (fthr >> 8) & 0xFF; in ray_set_frag()
1248 local->sparm.b5.a_frag_threshold[1] = fthr & 0xFF; in ray_set_frag()
1260 ray_dev_t *local = netdev_priv(dev); in ray_get_frag() local
1262 wrqu->frag.value = (local->sparm.b5.a_frag_threshold[0] << 8) in ray_get_frag()
1263 + local->sparm.b5.a_frag_threshold[1]; in ray_get_frag()
1277 ray_dev_t *local = netdev_priv(dev); in ray_set_mode() local
1282 if (local->card_status != CARD_AWAITING_PARAM) in ray_set_mode()
1290 local->sparm.b5.a_network_type = card_mode; in ray_set_mode()
1306 ray_dev_t *local = netdev_priv(dev); in ray_get_mode() local
1308 if (local->sparm.b5.a_network_type) in ray_get_mode()
1399 ray_dev_t *local = netdev_priv(dev); in ray_get_wireless_stats() local
1400 struct pcmcia_device *link = local->finder; in ray_get_wireless_stats()
1401 struct status __iomem *p = local->sram + STATUS_BASE; in ray_get_wireless_stats()
1403 local->wstats.status = local->card_status; in ray_get_wireless_stats()
1405 if ((local->spy_data.spy_number > 0) in ray_get_wireless_stats()
1406 && (local->sparm.b5.a_network_type == 0)) { in ray_get_wireless_stats()
1408 local->wstats.qual.qual = local->spy_data.spy_stat[0].qual; in ray_get_wireless_stats()
1409 local->wstats.qual.level = local->spy_data.spy_stat[0].level; in ray_get_wireless_stats()
1410 local->wstats.qual.noise = local->spy_data.spy_stat[0].noise; in ray_get_wireless_stats()
1411 local->wstats.qual.updated = in ray_get_wireless_stats()
1412 local->spy_data.spy_stat[0].updated; in ray_get_wireless_stats()
1417 local->wstats.qual.noise = readb(&p->rxnoise); in ray_get_wireless_stats()
1418 local->wstats.qual.updated |= 4; in ray_get_wireless_stats()
1421 return &local->wstats; in ray_get_wireless_stats()
1487 ray_dev_t *local = netdev_priv(dev); in ray_open() local
1489 link = local->finder; in ray_open()
1494 local->num_multi = 0; in ray_open()
1498 if (local->card_status == CARD_AWAITING_PARAM) { in ray_open()
1524 ray_dev_t *local = netdev_priv(dev); in ray_dev_close() local
1526 link = local->finder; in ray_dev_close()
1550 static int interrupt_ecf(ray_dev_t *local, int ccs) in interrupt_ecf() argument
1553 struct pcmcia_device *link = local->finder; in interrupt_ecf()
1559 dev_dbg(&link->dev, "interrupt_ecf(local=%p, ccs = 0x%x\n", local, ccs); in interrupt_ecf()
1562 (readb(local->amem + CIS_OFFSET + ECF_INTR_OFFSET) & in interrupt_ecf()
1570 writeb(ccs, local->sram + SCB_BASE); in interrupt_ecf()
1571 writeb(ECF_INTR_SET, local->amem + CIS_OFFSET + ECF_INTR_OFFSET); in interrupt_ecf()
1578 static int get_free_tx_ccs(ray_dev_t *local) in get_free_tx_ccs() argument
1581 struct ccs __iomem *pccs = ccs_base(local); in get_free_tx_ccs()
1582 struct pcmcia_device *link = local->finder; in get_free_tx_ccs()
1589 if (test_and_set_bit(0, &local->tx_ccs_lock)) { in get_free_tx_ccs()
1598 local->tx_ccs_lock = 0; in get_free_tx_ccs()
1602 local->tx_ccs_lock = 0; in get_free_tx_ccs()
1610 static int get_free_ccs(ray_dev_t *local) in get_free_ccs() argument
1613 struct ccs __iomem *pccs = ccs_base(local); in get_free_ccs()
1614 struct pcmcia_device *link = local->finder; in get_free_ccs()
1620 if (test_and_set_bit(0, &local->ccs_lock)) { in get_free_ccs()
1629 local->ccs_lock = 0; in get_free_ccs()
1633 local->ccs_lock = 0; in get_free_ccs()
1641 ray_dev_t *local = from_timer(local, t, timer); in authenticate_timeout() local
1642 del_timer(&local->timer); in authenticate_timeout()
1645 join_net(&local->timer); in authenticate_timeout()
1684 ray_dev_t *local = netdev_priv(dev); in ray_get_stats() local
1685 struct pcmcia_device *link = local->finder; in ray_get_stats()
1686 struct status __iomem *p = local->sram + STATUS_BASE; in ray_get_stats()
1689 return &local->stats; in ray_get_stats()
1692 local->stats.rx_over_errors += swab16(readw(&p->mrx_overflow)); in ray_get_stats()
1697 local->stats.rx_crc_errors += in ray_get_stats()
1703 local->stats.rx_frame_errors += swab16(readw(&p->rx_hec_error)); in ray_get_stats()
1707 return &local->stats; in ray_get_stats()
1714 ray_dev_t *local = netdev_priv(dev); in ray_update_parm() local
1715 struct pcmcia_device *link = local->finder; in ray_update_parm()
1725 if ((ccsindex = get_free_ccs(local)) < 0) { in ray_update_parm()
1729 pccs = ccs_base(local) + ccsindex; in ray_update_parm()
1735 writeb(value[i], local->sram + HOST_TO_ECF_BASE); in ray_update_parm()
1738 if (interrupt_ecf(local, ccsindex)) { in ray_update_parm()
1749 ray_dev_t *local = netdev_priv(dev); in ray_update_multi_list() local
1750 struct pcmcia_device *link = local->finder; in ray_update_multi_list()
1751 void __iomem *p = local->sram + HOST_TO_ECF_BASE; in ray_update_multi_list()
1758 if ((ccsindex = get_free_ccs(local)) < 0) { in ray_update_multi_list()
1762 pccs = ccs_base(local) + ccsindex; in ray_update_multi_list()
1767 local->num_multi = 0xff; in ray_update_multi_list()
1785 local->num_multi = i; in ray_update_multi_list()
1787 if (interrupt_ecf(local, ccsindex)) { in ray_update_multi_list()
1797 ray_dev_t *local = netdev_priv(dev); in set_multicast_list() local
1803 if (local->sparm.b5.a_promiscuous_mode == 0) { in set_multicast_list()
1805 local->sparm.b5.a_promiscuous_mode = 1; in set_multicast_list()
1811 if (local->sparm.b5.a_promiscuous_mode == 1) { in set_multicast_list()
1813 local->sparm.b5.a_promiscuous_mode = 0; in set_multicast_list()
1823 if (local->num_multi != netdev_mc_count(dev)) in set_multicast_list()
1835 ray_dev_t *local; in ray_interrupt() local
1850 local = netdev_priv(dev); in ray_interrupt()
1851 link = local->finder; in ray_interrupt()
1857 rcsindex = readb(&((struct scb __iomem *)(local->sram))->rcs_index); in ray_interrupt()
1861 clear_interrupt(local); in ray_interrupt()
1865 pccs = ccs_base(local) + rcsindex; in ray_interrupt()
1870 del_timer(&local->timer); in ray_interrupt()
1903 memcpy(memtmp, local->sparm.b4.a_current_ess_id, in ray_interrupt()
1919 memcpy_fromio(&local->bss_id, in ray_interrupt()
1923 if (local->fw_ver == 0x55) in ray_interrupt()
1924 local->net_default_tx_rate = 3; in ray_interrupt()
1926 local->net_default_tx_rate = in ray_interrupt()
1929 local->encryption = in ray_interrupt()
1931 if (!sniffer && (local->net_type == INFRA) in ray_interrupt()
1932 && !(local->sparm.b4.a_acting_as_ap_status)) { in ray_interrupt()
1933 authenticate(local); in ray_interrupt()
1935 local->card_status = CARD_ACQ_COMPLETE; in ray_interrupt()
1937 local->card_status = CARD_ACQ_FAILED; in ray_interrupt()
1939 del_timer(&local->timer); in ray_interrupt()
1940 local->timer.expires = jiffies + HZ * 5; in ray_interrupt()
1945 local->timer.function = start_net; in ray_interrupt()
1950 local->timer.function = join_net; in ray_interrupt()
1952 add_timer(&local->timer); in ray_interrupt()
1957 local->card_status = CARD_ASSOC_COMPLETE; in ray_interrupt()
1961 local->card_status = CARD_ASSOC_FAILED; in ray_interrupt()
1962 join_net(&local->timer); in ray_interrupt()
1999 prcs = rcs_base(local) + rcsindex; in ray_interrupt()
2003 ray_rx(dev, local, prcs); in ray_interrupt()
2007 local->card_status = CARD_ACQ_COMPLETE; in ray_interrupt()
2009 if (local->sparm.b4.a_network_type == ADHOC) { in ray_interrupt()
2013 memcpy_fromio(&local->bss_id, in ray_interrupt()
2017 local->bss_id); in ray_interrupt()
2019 authenticate(local); in ray_interrupt()
2025 local->card_status = CARD_DOING_ACQ; in ray_interrupt()
2039 clear_interrupt(local); in ray_interrupt()
2044 static void ray_rx(struct net_device *dev, ray_dev_t *local, in ray_rx() argument
2059 local->last_rsl = readb(&prcs->var.rx_packet.rx_sig_lev); in ray_rx()
2060 pmsg = local->rmem + pkt_addr; in ray_rx()
2071 rx_authenticate(local, prcs, pkt_addr, rx_len); in ray_rx()
2078 rx_deauthenticate(local, prcs, pkt_addr, rx_len); in ray_rx()
2088 copy_from_rx_buff(local, (UCHAR *) &local->last_bcn, pkt_addr, in ray_rx()
2092 local->beacon_rxed = 1; in ray_rx()
2110 ray_dev_t *local = netdev_priv(dev); in rx_data() local
2115 int siglev = local->last_rsl; in rx_data()
2160 prcslink = rcs_base(local) in rx_data()
2167 local->stats.rx_dropped++; in rx_data()
2168 release_frag_chain(local, prcs); in rx_data()
2178 local->stats.rx_dropped++; in rx_data()
2180 release_frag_chain(local, prcs); in rx_data()
2193 copy_from_rx_buff(local, rx_ptr, pkt_addr & RX_BUFF_END, rx_len); in rx_data()
2208 untranslate(local, skb, total_len); in rx_data()
2220 prcslink = rcs_base(local) in rx_data()
2236 copy_from_rx_buff(local, rx_ptr, pkt_addr, rx_len); in rx_data()
2241 release_frag_chain(local, prcs); in rx_data()
2246 local->stats.rx_packets++; in rx_data()
2247 local->stats.rx_bytes += total_len; in rx_data()
2254 if (!memcmp(linksrcaddr, local->bss_id, ETH_ALEN)) { in rx_data()
2257 local->wstats.qual.level = siglev; in rx_data()
2259 local->wstats.qual.updated = 0x2; in rx_data()
2275 static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len) in untranslate() argument
2367 static int copy_from_rx_buff(ray_dev_t *local, UCHAR *dest, int pkt_addr, in copy_from_rx_buff() argument
2372 memcpy_fromio(dest, local->rmem + pkt_addr, length); in copy_from_rx_buff()
2375 memcpy_fromio(dest, local->rmem + pkt_addr, in copy_from_rx_buff()
2377 memcpy_fromio(dest + length - wrap_bytes, local->rmem, in copy_from_rx_buff()
2384 static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs) in release_frag_chain() argument
2397 prcslink = rcs_base(local) + rcsindex; in release_frag_chain()
2404 static void authenticate(ray_dev_t *local) in authenticate() argument
2406 struct pcmcia_device *link = local->finder; in authenticate()
2413 del_timer(&local->timer); in authenticate()
2414 if (build_auth_frame(local, local->bss_id, OPEN_AUTH_REQUEST)) { in authenticate()
2415 local->timer.function = join_net; in authenticate()
2417 local->timer.function = authenticate_timeout; in authenticate()
2419 local->timer.expires = jiffies + HZ * 2; in authenticate()
2420 add_timer(&local->timer); in authenticate()
2421 local->authentication_state = AWAITING_RESPONSE; in authenticate()
2425 static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs, in rx_authenticate() argument
2431 del_timer(&local->timer); in rx_authenticate()
2433 copy_from_rx_buff(local, buff, pkt_addr, rx_len & 0xff); in rx_authenticate()
2435 if (local->sparm.b4.a_network_type == ADHOC) { in rx_authenticate()
2440 (local, msg->mac.addr_2, OPEN_AUTH_RESPONSE)) { in rx_authenticate()
2441 local->authentication_state = NEED_TO_AUTH; in rx_authenticate()
2442 memcpy(local->auth_id, msg->mac.addr_2, in rx_authenticate()
2448 if (local->authentication_state == AWAITING_RESPONSE) { in rx_authenticate()
2453 local->card_status = CARD_AUTH_COMPLETE; in rx_authenticate()
2454 associate(local); in rx_authenticate()
2455 local->authentication_state = in rx_authenticate()
2459 local->card_status = CARD_AUTH_REFUSED; in rx_authenticate()
2460 join_net(&local->timer); in rx_authenticate()
2461 local->authentication_state = in rx_authenticate()
2471 static void associate(ray_dev_t *local) in associate() argument
2474 struct pcmcia_device *link = local->finder; in associate()
2482 if ((ccsindex = get_free_ccs(local)) < 0) { in associate()
2488 pccs = ccs_base(local) + ccsindex; in associate()
2492 if (interrupt_ecf(local, ccsindex)) { in associate()
2496 del_timer(&local->timer); in associate()
2497 local->timer.expires = jiffies + HZ * 2; in associate()
2498 local->timer.function = join_net; in associate()
2499 add_timer(&local->timer); in associate()
2500 local->card_status = CARD_ASSOC_FAILED; in associate()
2509 static void rx_deauthenticate(ray_dev_t *local, struct rcs __iomem *prcs, in rx_deauthenticate() argument
2516 local->authentication_state = UNAUTHENTICATED; in rx_deauthenticate()
2523 static void clear_interrupt(ray_dev_t *local) in clear_interrupt() argument
2525 writeb(0, local->amem + CIS_OFFSET + HCS_INTR_OFFSET); in clear_interrupt()
2562 ray_dev_t *local; in ray_cs_proc_show() local
2573 local = netdev_priv(dev); in ray_cs_proc_show()
2574 if (!local) in ray_cs_proc_show()
2581 if (local->fw_ver == 0x55) in ray_cs_proc_show()
2585 local->fw_ver, local->fw_bld, local->fw_var); in ray_cs_proc_show()
2588 c[i] = local->sparm.b5.a_current_ess_id[i]; in ray_cs_proc_show()
2591 nettype[local->sparm.b5.a_network_type], c); in ray_cs_proc_show()
2593 p = local->bss_id; in ray_cs_proc_show()
2597 local->sparm.b5.a_curr_country_code); in ray_cs_proc_show()
2599 i = local->card_status; in ray_cs_proc_show()
2608 seq_printf(m, "Last pkt signal lvl = %d\n", local->last_rsl); in ray_cs_proc_show()
2610 if (local->beacon_rxed) { in ray_cs_proc_show()
2613 local->last_bcn.beacon_intvl[0] in ray_cs_proc_show()
2614 + 256 * local->last_bcn.beacon_intvl[1]); in ray_cs_proc_show()
2616 p = local->last_bcn.elements; in ray_cs_proc_show()
2661 static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type) in build_auth_frame() argument
2669 if ((ccsindex = get_free_tx_ccs(local)) < 0) { in build_auth_frame()
2674 pccs = ccs_base(local) + ccsindex; in build_auth_frame()
2687 ptx = local->sram + addr; in build_auth_frame()
2693 memcpy_toio(ptx->mac.addr_2, local->sparm.b4.a_mac_addr, ADDRLEN); in build_auth_frame()
2694 memcpy_toio(ptx->mac.addr_3, local->bss_id, ADDRLEN); in build_auth_frame()
2701 if (interrupt_ecf(local, ccsindex)) { in build_auth_frame()