Lines Matching full:mac

14 #include "mac.h"
87 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_init_hw() local
88 struct plfxlc_chip *chip = &mac->chip; in plfxlc_mac_init_hw()
93 dev_warn(plfxlc_mac_dev(mac), "init hw failed (%d)\n", r); in plfxlc_mac_init_hw()
97 dev_dbg(plfxlc_mac_dev(mac), "irq_disabled (%d)\n", irqs_disabled()); in plfxlc_mac_init_hw()
102 void plfxlc_mac_release(struct plfxlc_mac *mac) in plfxlc_mac_release() argument
104 plfxlc_chip_release(&mac->chip); in plfxlc_mac_release()
115 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_stop() local
117 clear_bit(PURELIFI_DEVICE_RUNNING, &mac->flags); in plfxlc_op_stop()
120 int plfxlc_restore_settings(struct plfxlc_mac *mac) in plfxlc_restore_settings() argument
125 spin_lock_irq(&mac->lock); in plfxlc_restore_settings()
126 beacon_interval = mac->beacon.interval; in plfxlc_restore_settings()
127 beacon_period = mac->beacon.period; in plfxlc_restore_settings()
128 spin_unlock_irq(&mac->lock); in plfxlc_restore_settings()
130 if (mac->type != NL80211_IFTYPE_ADHOC) in plfxlc_restore_settings()
133 if (mac->vif) { in plfxlc_restore_settings()
134 beacon = ieee80211_beacon_get(mac->hw, mac->vif, 0); in plfxlc_restore_settings()
144 plfxlc_set_beacon_interval(&mac->chip, beacon_interval, in plfxlc_restore_settings()
145 beacon_period, mac->type); in plfxlc_restore_settings()
147 spin_lock_irq(&mac->lock); in plfxlc_restore_settings()
148 mac->beacon.last_update = jiffies; in plfxlc_restore_settings()
149 spin_unlock_irq(&mac->lock); in plfxlc_restore_settings()
179 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_tx_to_dev() local
191 q = &mac->ack_wait_queue; in plfxlc_mac_tx_to_dev()
196 mac->ack_pending ? in plfxlc_mac_tx_to_dev()
197 mac->ack_signal : 0, in plfxlc_mac_tx_to_dev()
199 mac->ack_pending = 0; in plfxlc_mac_tx_to_dev()
203 static int plfxlc_fill_ctrlset(struct plfxlc_mac *mac, struct sk_buff *skb) in plfxlc_fill_ctrlset() argument
212 dev_dbg(plfxlc_mac_dev(mac), "Not enough hroom(1)\n"); in plfxlc_fill_ctrlset()
289 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_tx() local
290 struct plfxlc_usb *usb = &mac->chip.usb; in plfxlc_op_tx()
294 r = plfxlc_fill_ctrlset(mac, skb); in plfxlc_op_tx()
309 if (memcmp(tx->station[sidx].mac, dst_mac, ETH_ALEN)) in plfxlc_op_tx()
331 r = plfxlc_usb_wreq_async(&mac->chip.usb, skb->data, skb->len, in plfxlc_op_tx()
346 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_filter_ack() local
356 dev_dbg(plfxlc_mac_dev(mac), "ACK Received\n"); in plfxlc_filter_ack()
359 q = &mac->ack_wait_queue; in plfxlc_filter_ack()
367 if (mac->ack_pending && skb_queue_is_first(q, skb)) in plfxlc_filter_ack()
369 if (mac->ack_pending == 0) in plfxlc_filter_ack()
384 mac->ack_pending ? in plfxlc_filter_ack()
385 mac->ack_signal : 0, in plfxlc_filter_ack()
387 mac->ack_pending = 0; in plfxlc_filter_ack()
390 mac->ack_pending = skb_queue_len(q) ? 1 : 0; in plfxlc_filter_ack()
391 mac->ack_signal = stats->signal; in plfxlc_filter_ack()
401 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_rx() local
412 if (!mac->vif) in plfxlc_mac_rx()
422 mac->rssi = -15 * be16_to_cpu(status->rssi) / 10; in plfxlc_mac_rx()
424 stats.signal = mac->rssi; in plfxlc_mac_rx()
431 mac->crc_errors = be64_to_cpu(status->crc_error_count); in plfxlc_mac_rx()
435 !mac->pass_ctrl) in plfxlc_mac_rx()
442 dev_err(plfxlc_mac_dev(mac), " > MTU %u\n", payload_length); in plfxlc_mac_rx()
450 tx = &mac->chip.usb.tx; in plfxlc_mac_rx()
453 if (memcmp(&buffer[10], tx->station[sidx].mac, ETH_ALEN)) in plfxlc_mac_rx()
465 memcpy(tx->station[sidx].mac, &buffer[10], ETH_ALEN); in plfxlc_mac_rx()
474 dev_dbg(plfxlc_mac_dev(mac), "Probe request\n"); in plfxlc_mac_rx()
477 dev_dbg(plfxlc_mac_dev(mac), "Association request\n"); in plfxlc_mac_rx()
480 dev_dbg(plfxlc_mac_dev(mac), "Authentication req\n"); in plfxlc_mac_rx()
483 dev_dbg(plfxlc_mac_dev(mac), "802.11 data frame\n"); in plfxlc_mac_rx()
504 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_add_interface() local
510 if (mac->type != NL80211_IFTYPE_UNSPECIFIED) in plfxlc_op_add_interface()
515 dev_dbg(plfxlc_mac_dev(mac), "%s %s\n", __func__, in plfxlc_op_add_interface()
517 mac->type = vif->type; in plfxlc_op_add_interface()
518 mac->vif = vif; in plfxlc_op_add_interface()
521 dev_dbg(plfxlc_mac_dev(mac), "unsupported iftype\n"); in plfxlc_op_add_interface()
528 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_remove_interface() local
530 mac->type = NL80211_IFTYPE_UNSPECIFIED; in plfxlc_op_remove_interface()
531 mac->vif = NULL; in plfxlc_op_remove_interface()
551 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_configure_filter() local
567 spin_lock_irqsave(&mac->lock, flags); in plfxlc_op_configure_filter()
568 mac->pass_failed_fcs = !!(*new_flags & FIF_FCSFAIL); in plfxlc_op_configure_filter()
569 mac->pass_ctrl = !!(*new_flags & FIF_CONTROL); in plfxlc_op_configure_filter()
570 mac->multicast_hash = hash; in plfxlc_op_configure_filter()
571 spin_unlock_irqrestore(&mac->lock, flags); in plfxlc_op_configure_filter()
590 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_bss_info_changed() local
593 dev_dbg(plfxlc_mac_dev(mac), "changes: %llx\n", changes); in plfxlc_op_bss_info_changed()
595 if (mac->type != NL80211_IFTYPE_ADHOC) { /* for STATION */ in plfxlc_op_bss_info_changed()
623 spin_lock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
624 mac->beacon.period = period; in plfxlc_op_bss_info_changed()
625 mac->beacon.interval = interval; in plfxlc_op_bss_info_changed()
626 mac->beacon.last_update = jiffies; in plfxlc_op_bss_info_changed()
627 spin_unlock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
629 plfxlc_set_beacon_interval(&mac->chip, interval, in plfxlc_op_bss_info_changed()
630 period, mac->type); in plfxlc_op_bss_info_changed()
633 spin_lock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
634 mac->associated = associated; in plfxlc_op_bss_info_changed()
635 spin_unlock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
674 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_get_et_stats() local
676 data[0] = mac->rssi; in plfxlc_get_et_stats()
677 data[1] = mac->crc_errors; in plfxlc_get_et_stats()
709 struct plfxlc_mac *mac; in plfxlc_mac_alloc_hw() local
718 mac = plfxlc_hw_mac(hw); in plfxlc_mac_alloc_hw()
719 memset(mac, 0, sizeof(*mac)); in plfxlc_mac_alloc_hw()
720 spin_lock_init(&mac->lock); in plfxlc_mac_alloc_hw()
721 mac->hw = hw; in plfxlc_mac_alloc_hw()
723 mac->type = NL80211_IFTYPE_UNSPECIFIED; in plfxlc_mac_alloc_hw()
725 memcpy(mac->channels, plfxlc_channels, sizeof(plfxlc_channels)); in plfxlc_mac_alloc_hw()
726 memcpy(mac->rates, plfxlc_rates, sizeof(plfxlc_rates)); in plfxlc_mac_alloc_hw()
727 mac->band.n_bitrates = ARRAY_SIZE(plfxlc_rates); in plfxlc_mac_alloc_hw()
728 mac->band.bitrates = mac->rates; in plfxlc_mac_alloc_hw()
729 mac->band.n_channels = ARRAY_SIZE(plfxlc_channels); in plfxlc_mac_alloc_hw()
730 mac->band.channels = mac->channels; in plfxlc_mac_alloc_hw()
731 hw->wiphy->bands[NL80211_BAND_LC] = &mac->band; in plfxlc_mac_alloc_hw()
750 skb_queue_head_init(&mac->ack_wait_queue); in plfxlc_mac_alloc_hw()
751 mac->ack_pending = 0; in plfxlc_mac_alloc_hw()
753 plfxlc_chip_init(&mac->chip, hw, intf); in plfxlc_mac_alloc_hw()