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()
105 lockdep_assert_held(&mac->lock); in plfxlc_mac_release()
116 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_stop() local
118 clear_bit(PURELIFI_DEVICE_RUNNING, &mac->flags); in plfxlc_op_stop()
121 int plfxlc_restore_settings(struct plfxlc_mac *mac) in plfxlc_restore_settings() argument
126 spin_lock_irq(&mac->lock); in plfxlc_restore_settings()
127 beacon_interval = mac->beacon.interval; in plfxlc_restore_settings()
128 beacon_period = mac->beacon.period; in plfxlc_restore_settings()
129 spin_unlock_irq(&mac->lock); in plfxlc_restore_settings()
131 if (mac->type != NL80211_IFTYPE_ADHOC) in plfxlc_restore_settings()
134 if (mac->vif) { in plfxlc_restore_settings()
135 beacon = ieee80211_beacon_get(mac->hw, mac->vif, 0); in plfxlc_restore_settings()
145 plfxlc_set_beacon_interval(&mac->chip, beacon_interval, in plfxlc_restore_settings()
146 beacon_period, mac->type); in plfxlc_restore_settings()
148 spin_lock_irq(&mac->lock); in plfxlc_restore_settings()
149 mac->beacon.last_update = jiffies; in plfxlc_restore_settings()
150 spin_unlock_irq(&mac->lock); in plfxlc_restore_settings()
180 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_tx_to_dev() local
192 q = &mac->ack_wait_queue; in plfxlc_mac_tx_to_dev()
197 mac->ack_pending ? in plfxlc_mac_tx_to_dev()
198 mac->ack_signal : 0, in plfxlc_mac_tx_to_dev()
200 mac->ack_pending = 0; in plfxlc_mac_tx_to_dev()
204 static int plfxlc_fill_ctrlset(struct plfxlc_mac *mac, struct sk_buff *skb) in plfxlc_fill_ctrlset() argument
213 dev_dbg(plfxlc_mac_dev(mac), "Not enough hroom(1)\n"); in plfxlc_fill_ctrlset()
290 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_tx() local
291 struct plfxlc_usb *usb = &mac->chip.usb; in plfxlc_op_tx()
295 r = plfxlc_fill_ctrlset(mac, skb); in plfxlc_op_tx()
310 if (memcmp(tx->station[sidx].mac, dst_mac, ETH_ALEN)) in plfxlc_op_tx()
332 r = plfxlc_usb_wreq_async(&mac->chip.usb, skb->data, skb->len, in plfxlc_op_tx()
347 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_filter_ack() local
357 dev_dbg(plfxlc_mac_dev(mac), "ACK Received\n"); in plfxlc_filter_ack()
360 q = &mac->ack_wait_queue; in plfxlc_filter_ack()
368 if (mac->ack_pending && skb_queue_is_first(q, skb)) in plfxlc_filter_ack()
370 if (mac->ack_pending == 0) in plfxlc_filter_ack()
385 mac->ack_pending ? in plfxlc_filter_ack()
386 mac->ack_signal : 0, in plfxlc_filter_ack()
388 mac->ack_pending = 0; in plfxlc_filter_ack()
391 mac->ack_pending = skb_queue_len(q) ? 1 : 0; in plfxlc_filter_ack()
392 mac->ack_signal = stats->signal; in plfxlc_filter_ack()
402 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_rx() local
413 if (!mac->vif) in plfxlc_mac_rx()
423 mac->rssi = -15 * be16_to_cpu(status->rssi) / 10; in plfxlc_mac_rx()
425 stats.signal = mac->rssi; in plfxlc_mac_rx()
432 mac->crc_errors = be64_to_cpu(status->crc_error_count); in plfxlc_mac_rx()
436 !mac->pass_ctrl) in plfxlc_mac_rx()
443 dev_err(plfxlc_mac_dev(mac), " > MTU %u\n", payload_length); in plfxlc_mac_rx()
451 tx = &mac->chip.usb.tx; in plfxlc_mac_rx()
454 if (memcmp(&buffer[10], tx->station[sidx].mac, ETH_ALEN)) in plfxlc_mac_rx()
466 memcpy(tx->station[sidx].mac, &buffer[10], ETH_ALEN); in plfxlc_mac_rx()
475 dev_dbg(plfxlc_mac_dev(mac), "Probe request\n"); in plfxlc_mac_rx()
478 dev_dbg(plfxlc_mac_dev(mac), "Association request\n"); in plfxlc_mac_rx()
481 dev_dbg(plfxlc_mac_dev(mac), "Authentication req\n"); in plfxlc_mac_rx()
484 dev_dbg(plfxlc_mac_dev(mac), "802.11 data frame\n"); in plfxlc_mac_rx()
505 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_add_interface() local
511 if (mac->type != NL80211_IFTYPE_UNSPECIFIED) in plfxlc_op_add_interface()
516 dev_dbg(plfxlc_mac_dev(mac), "%s %s\n", __func__, in plfxlc_op_add_interface()
518 mac->type = vif->type; in plfxlc_op_add_interface()
519 mac->vif = vif; in plfxlc_op_add_interface()
522 dev_dbg(plfxlc_mac_dev(mac), "unsupported iftype\n"); in plfxlc_op_add_interface()
529 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_remove_interface() local
531 mac->type = NL80211_IFTYPE_UNSPECIFIED; in plfxlc_op_remove_interface()
532 mac->vif = NULL; in plfxlc_op_remove_interface()
552 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_configure_filter() local
568 spin_lock_irqsave(&mac->lock, flags); in plfxlc_op_configure_filter()
569 mac->pass_failed_fcs = !!(*new_flags & FIF_FCSFAIL); in plfxlc_op_configure_filter()
570 mac->pass_ctrl = !!(*new_flags & FIF_CONTROL); in plfxlc_op_configure_filter()
571 mac->multicast_hash = hash; in plfxlc_op_configure_filter()
572 spin_unlock_irqrestore(&mac->lock, flags); in plfxlc_op_configure_filter()
591 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_bss_info_changed() local
594 dev_dbg(plfxlc_mac_dev(mac), "changes: %llx\n", changes); in plfxlc_op_bss_info_changed()
596 if (mac->type != NL80211_IFTYPE_ADHOC) { /* for STATION */ in plfxlc_op_bss_info_changed()
624 spin_lock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
625 mac->beacon.period = period; in plfxlc_op_bss_info_changed()
626 mac->beacon.interval = interval; in plfxlc_op_bss_info_changed()
627 mac->beacon.last_update = jiffies; in plfxlc_op_bss_info_changed()
628 spin_unlock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
630 plfxlc_set_beacon_interval(&mac->chip, interval, in plfxlc_op_bss_info_changed()
631 period, mac->type); in plfxlc_op_bss_info_changed()
634 spin_lock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
635 mac->associated = associated; in plfxlc_op_bss_info_changed()
636 spin_unlock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
675 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_get_et_stats() local
677 data[0] = mac->rssi; in plfxlc_get_et_stats()
678 data[1] = mac->crc_errors; in plfxlc_get_et_stats()
710 struct plfxlc_mac *mac; in plfxlc_mac_alloc_hw() local
719 mac = plfxlc_hw_mac(hw); in plfxlc_mac_alloc_hw()
720 memset(mac, 0, sizeof(*mac)); in plfxlc_mac_alloc_hw()
721 spin_lock_init(&mac->lock); in plfxlc_mac_alloc_hw()
722 mac->hw = hw; in plfxlc_mac_alloc_hw()
724 mac->type = NL80211_IFTYPE_UNSPECIFIED; in plfxlc_mac_alloc_hw()
726 memcpy(mac->channels, plfxlc_channels, sizeof(plfxlc_channels)); in plfxlc_mac_alloc_hw()
727 memcpy(mac->rates, plfxlc_rates, sizeof(plfxlc_rates)); in plfxlc_mac_alloc_hw()
728 mac->band.n_bitrates = ARRAY_SIZE(plfxlc_rates); in plfxlc_mac_alloc_hw()
729 mac->band.bitrates = mac->rates; in plfxlc_mac_alloc_hw()
730 mac->band.n_channels = ARRAY_SIZE(plfxlc_channels); in plfxlc_mac_alloc_hw()
731 mac->band.channels = mac->channels; in plfxlc_mac_alloc_hw()
732 hw->wiphy->bands[NL80211_BAND_LC] = &mac->band; in plfxlc_mac_alloc_hw()
751 skb_queue_head_init(&mac->ack_wait_queue); in plfxlc_mac_alloc_hw()
752 mac->ack_pending = 0; in plfxlc_mac_alloc_hw()
754 plfxlc_chip_init(&mac->chip, hw, intf); in plfxlc_mac_alloc_hw()