Lines Matching refs:mac
88 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_init_hw() local
89 struct plfxlc_chip *chip = &mac->chip; in plfxlc_mac_init_hw()
94 dev_warn(plfxlc_mac_dev(mac), "init hw failed (%d)\n", r); in plfxlc_mac_init_hw()
98 dev_dbg(plfxlc_mac_dev(mac), "irq_disabled (%d)\n", irqs_disabled()); in plfxlc_mac_init_hw()
103 void plfxlc_mac_release(struct plfxlc_mac *mac) in plfxlc_mac_release() argument
105 plfxlc_chip_release(&mac->chip); in plfxlc_mac_release()
106 lockdep_assert_held(&mac->lock); in plfxlc_mac_release()
117 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_stop() local
119 clear_bit(PURELIFI_DEVICE_RUNNING, &mac->flags); in plfxlc_op_stop()
122 int plfxlc_restore_settings(struct plfxlc_mac *mac) in plfxlc_restore_settings() argument
127 spin_lock_irq(&mac->lock); in plfxlc_restore_settings()
128 beacon_interval = mac->beacon.interval; in plfxlc_restore_settings()
129 beacon_period = mac->beacon.period; in plfxlc_restore_settings()
130 spin_unlock_irq(&mac->lock); in plfxlc_restore_settings()
132 if (mac->type != NL80211_IFTYPE_ADHOC) in plfxlc_restore_settings()
135 if (mac->vif) { in plfxlc_restore_settings()
136 beacon = ieee80211_beacon_get(mac->hw, mac->vif, 0); in plfxlc_restore_settings()
146 plfxlc_set_beacon_interval(&mac->chip, beacon_interval, in plfxlc_restore_settings()
147 beacon_period, mac->type); in plfxlc_restore_settings()
149 spin_lock_irq(&mac->lock); in plfxlc_restore_settings()
150 mac->beacon.last_update = jiffies; in plfxlc_restore_settings()
151 spin_unlock_irq(&mac->lock); in plfxlc_restore_settings()
181 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_tx_to_dev() local
193 q = &mac->ack_wait_queue; in plfxlc_mac_tx_to_dev()
198 mac->ack_pending ? in plfxlc_mac_tx_to_dev()
199 mac->ack_signal : 0, in plfxlc_mac_tx_to_dev()
201 mac->ack_pending = 0; in plfxlc_mac_tx_to_dev()
205 static int plfxlc_fill_ctrlset(struct plfxlc_mac *mac, struct sk_buff *skb) in plfxlc_fill_ctrlset() argument
214 dev_dbg(plfxlc_mac_dev(mac), "Not enough hroom(1)\n"); in plfxlc_fill_ctrlset()
291 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_tx() local
292 struct plfxlc_usb *usb = &mac->chip.usb; in plfxlc_op_tx()
296 r = plfxlc_fill_ctrlset(mac, skb); in plfxlc_op_tx()
311 if (memcmp(tx->station[sidx].mac, dst_mac, ETH_ALEN)) in plfxlc_op_tx()
333 r = plfxlc_usb_wreq_async(&mac->chip.usb, skb->data, skb->len, in plfxlc_op_tx()
348 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_filter_ack() local
358 dev_dbg(plfxlc_mac_dev(mac), "ACK Received\n"); in plfxlc_filter_ack()
361 q = &mac->ack_wait_queue; in plfxlc_filter_ack()
369 if (mac->ack_pending && skb_queue_is_first(q, skb)) in plfxlc_filter_ack()
371 if (mac->ack_pending == 0) in plfxlc_filter_ack()
386 mac->ack_pending ? in plfxlc_filter_ack()
387 mac->ack_signal : 0, in plfxlc_filter_ack()
389 mac->ack_pending = 0; in plfxlc_filter_ack()
392 mac->ack_pending = skb_queue_len(q) ? 1 : 0; in plfxlc_filter_ack()
393 mac->ack_signal = stats->signal; in plfxlc_filter_ack()
403 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_rx() local
414 if (!mac->vif) in plfxlc_mac_rx()
424 mac->rssi = -15 * be16_to_cpu(status->rssi) / 10; in plfxlc_mac_rx()
426 stats.signal = mac->rssi; in plfxlc_mac_rx()
433 mac->crc_errors = be64_to_cpu(status->crc_error_count); in plfxlc_mac_rx()
437 !mac->pass_ctrl) in plfxlc_mac_rx()
444 dev_err(plfxlc_mac_dev(mac), " > MTU %u\n", payload_length); in plfxlc_mac_rx()
452 tx = &mac->chip.usb.tx; in plfxlc_mac_rx()
455 if (memcmp(&buffer[10], tx->station[sidx].mac, ETH_ALEN)) in plfxlc_mac_rx()
467 memcpy(tx->station[sidx].mac, &buffer[10], ETH_ALEN); in plfxlc_mac_rx()
476 dev_dbg(plfxlc_mac_dev(mac), "Probe request\n"); in plfxlc_mac_rx()
479 dev_dbg(plfxlc_mac_dev(mac), "Association request\n"); in plfxlc_mac_rx()
482 dev_dbg(plfxlc_mac_dev(mac), "Authentication req\n"); in plfxlc_mac_rx()
485 dev_dbg(plfxlc_mac_dev(mac), "802.11 data frame\n"); in plfxlc_mac_rx()
506 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_add_interface() local
512 if (mac->type != NL80211_IFTYPE_UNSPECIFIED) in plfxlc_op_add_interface()
517 dev_dbg(plfxlc_mac_dev(mac), "%s %s\n", __func__, in plfxlc_op_add_interface()
519 mac->type = vif->type; in plfxlc_op_add_interface()
520 mac->vif = vif; in plfxlc_op_add_interface()
523 dev_dbg(plfxlc_mac_dev(mac), "unsupported iftype\n"); in plfxlc_op_add_interface()
530 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_remove_interface() local
532 mac->type = NL80211_IFTYPE_UNSPECIFIED; in plfxlc_op_remove_interface()
533 mac->vif = NULL; in plfxlc_op_remove_interface()
553 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_configure_filter() local
569 spin_lock_irqsave(&mac->lock, flags); in plfxlc_op_configure_filter()
570 mac->pass_failed_fcs = !!(*new_flags & FIF_FCSFAIL); in plfxlc_op_configure_filter()
571 mac->pass_ctrl = !!(*new_flags & FIF_CONTROL); in plfxlc_op_configure_filter()
572 mac->multicast_hash = hash; in plfxlc_op_configure_filter()
573 spin_unlock_irqrestore(&mac->lock, flags); in plfxlc_op_configure_filter()
592 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_bss_info_changed() local
595 dev_dbg(plfxlc_mac_dev(mac), "changes: %llx\n", changes); in plfxlc_op_bss_info_changed()
597 if (mac->type != NL80211_IFTYPE_ADHOC) { /* for STATION */ in plfxlc_op_bss_info_changed()
625 spin_lock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
626 mac->beacon.period = period; in plfxlc_op_bss_info_changed()
627 mac->beacon.interval = interval; in plfxlc_op_bss_info_changed()
628 mac->beacon.last_update = jiffies; in plfxlc_op_bss_info_changed()
629 spin_unlock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
631 plfxlc_set_beacon_interval(&mac->chip, interval, in plfxlc_op_bss_info_changed()
632 period, mac->type); in plfxlc_op_bss_info_changed()
635 spin_lock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
636 mac->associated = associated; in plfxlc_op_bss_info_changed()
637 spin_unlock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
676 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_get_et_stats() local
678 data[0] = mac->rssi; in plfxlc_get_et_stats()
679 data[1] = mac->crc_errors; in plfxlc_get_et_stats()
706 struct plfxlc_mac *mac; in plfxlc_mac_alloc_hw() local
715 mac = plfxlc_hw_mac(hw); in plfxlc_mac_alloc_hw()
716 memset(mac, 0, sizeof(*mac)); in plfxlc_mac_alloc_hw()
717 spin_lock_init(&mac->lock); in plfxlc_mac_alloc_hw()
718 mac->hw = hw; in plfxlc_mac_alloc_hw()
720 mac->type = NL80211_IFTYPE_UNSPECIFIED; in plfxlc_mac_alloc_hw()
722 memcpy(mac->channels, plfxlc_channels, sizeof(plfxlc_channels)); in plfxlc_mac_alloc_hw()
723 memcpy(mac->rates, plfxlc_rates, sizeof(plfxlc_rates)); in plfxlc_mac_alloc_hw()
724 mac->band.n_bitrates = ARRAY_SIZE(plfxlc_rates); in plfxlc_mac_alloc_hw()
725 mac->band.bitrates = mac->rates; in plfxlc_mac_alloc_hw()
726 mac->band.n_channels = ARRAY_SIZE(plfxlc_channels); in plfxlc_mac_alloc_hw()
727 mac->band.channels = mac->channels; in plfxlc_mac_alloc_hw()
728 hw->wiphy->bands[NL80211_BAND_LC] = &mac->band; in plfxlc_mac_alloc_hw()
747 skb_queue_head_init(&mac->ack_wait_queue); in plfxlc_mac_alloc_hw()
748 mac->ack_pending = 0; in plfxlc_mac_alloc_hw()
750 plfxlc_chip_init(&mac->chip, hw, intf); in plfxlc_mac_alloc_hw()