Lines Matching refs:mac

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()
110 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_stop() local
112 clear_bit(PURELIFI_DEVICE_RUNNING, &mac->flags); in plfxlc_op_stop()
115 int plfxlc_restore_settings(struct plfxlc_mac *mac) in plfxlc_restore_settings() argument
120 spin_lock_irq(&mac->lock); in plfxlc_restore_settings()
121 beacon_interval = mac->beacon.interval; in plfxlc_restore_settings()
122 beacon_period = mac->beacon.period; in plfxlc_restore_settings()
123 spin_unlock_irq(&mac->lock); in plfxlc_restore_settings()
125 if (mac->type != NL80211_IFTYPE_ADHOC) in plfxlc_restore_settings()
128 if (mac->vif) { in plfxlc_restore_settings()
129 beacon = ieee80211_beacon_get(mac->hw, mac->vif, 0); in plfxlc_restore_settings()
139 plfxlc_set_beacon_interval(&mac->chip, beacon_interval, in plfxlc_restore_settings()
140 beacon_period, mac->type); in plfxlc_restore_settings()
142 spin_lock_irq(&mac->lock); in plfxlc_restore_settings()
143 mac->beacon.last_update = jiffies; in plfxlc_restore_settings()
144 spin_unlock_irq(&mac->lock); in plfxlc_restore_settings()
174 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_tx_to_dev() local
186 q = &mac->ack_wait_queue; in plfxlc_mac_tx_to_dev()
191 mac->ack_pending ? in plfxlc_mac_tx_to_dev()
192 mac->ack_signal : 0, in plfxlc_mac_tx_to_dev()
194 mac->ack_pending = 0; in plfxlc_mac_tx_to_dev()
198 static int plfxlc_fill_ctrlset(struct plfxlc_mac *mac, struct sk_buff *skb) in plfxlc_fill_ctrlset() argument
207 dev_dbg(plfxlc_mac_dev(mac), "Not enough hroom(1)\n"); in plfxlc_fill_ctrlset()
284 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_tx() local
285 struct plfxlc_usb *usb = &mac->chip.usb; in plfxlc_op_tx()
289 r = plfxlc_fill_ctrlset(mac, skb); in plfxlc_op_tx()
304 if (memcmp(tx->station[sidx].mac, dst_mac, ETH_ALEN)) in plfxlc_op_tx()
326 r = plfxlc_usb_wreq_async(&mac->chip.usb, skb->data, skb->len, in plfxlc_op_tx()
341 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_filter_ack() local
351 dev_dbg(plfxlc_mac_dev(mac), "ACK Received\n"); in plfxlc_filter_ack()
354 q = &mac->ack_wait_queue; in plfxlc_filter_ack()
362 if (mac->ack_pending && skb_queue_is_first(q, skb)) in plfxlc_filter_ack()
364 if (mac->ack_pending == 0) in plfxlc_filter_ack()
379 mac->ack_pending ? in plfxlc_filter_ack()
380 mac->ack_signal : 0, in plfxlc_filter_ack()
382 mac->ack_pending = 0; in plfxlc_filter_ack()
385 mac->ack_pending = skb_queue_len(q) ? 1 : 0; in plfxlc_filter_ack()
386 mac->ack_signal = stats->signal; in plfxlc_filter_ack()
396 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_rx() local
407 if (!mac->vif) in plfxlc_mac_rx()
417 mac->rssi = -15 * be16_to_cpu(status->rssi) / 10; in plfxlc_mac_rx()
419 stats.signal = mac->rssi; in plfxlc_mac_rx()
426 mac->crc_errors = be64_to_cpu(status->crc_error_count); in plfxlc_mac_rx()
430 !mac->pass_ctrl) in plfxlc_mac_rx()
437 dev_err(plfxlc_mac_dev(mac), " > MTU %u\n", payload_length); in plfxlc_mac_rx()
445 tx = &mac->chip.usb.tx; in plfxlc_mac_rx()
448 if (memcmp(&buffer[10], tx->station[sidx].mac, ETH_ALEN)) in plfxlc_mac_rx()
460 memcpy(tx->station[sidx].mac, &buffer[10], ETH_ALEN); in plfxlc_mac_rx()
469 dev_dbg(plfxlc_mac_dev(mac), "Probe request\n"); in plfxlc_mac_rx()
472 dev_dbg(plfxlc_mac_dev(mac), "Association request\n"); in plfxlc_mac_rx()
475 dev_dbg(plfxlc_mac_dev(mac), "Authentication req\n"); in plfxlc_mac_rx()
478 dev_dbg(plfxlc_mac_dev(mac), "802.11 data frame\n"); in plfxlc_mac_rx()
499 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_add_interface() local
505 if (mac->type != NL80211_IFTYPE_UNSPECIFIED) in plfxlc_op_add_interface()
510 dev_dbg(plfxlc_mac_dev(mac), "%s %s\n", __func__, in plfxlc_op_add_interface()
512 mac->type = vif->type; in plfxlc_op_add_interface()
513 mac->vif = vif; in plfxlc_op_add_interface()
516 dev_dbg(plfxlc_mac_dev(mac), "unsupported iftype\n"); in plfxlc_op_add_interface()
523 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_remove_interface() local
525 mac->type = NL80211_IFTYPE_UNSPECIFIED; in plfxlc_op_remove_interface()
526 mac->vif = NULL; in plfxlc_op_remove_interface()
546 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_configure_filter() local
562 spin_lock_irqsave(&mac->lock, flags); in plfxlc_op_configure_filter()
563 mac->pass_failed_fcs = !!(*new_flags & FIF_FCSFAIL); in plfxlc_op_configure_filter()
564 mac->pass_ctrl = !!(*new_flags & FIF_CONTROL); in plfxlc_op_configure_filter()
565 mac->multicast_hash = hash; in plfxlc_op_configure_filter()
566 spin_unlock_irqrestore(&mac->lock, flags); in plfxlc_op_configure_filter()
585 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_op_bss_info_changed() local
588 dev_dbg(plfxlc_mac_dev(mac), "changes: %llx\n", changes); in plfxlc_op_bss_info_changed()
590 if (mac->type != NL80211_IFTYPE_ADHOC) { /* for STATION */ in plfxlc_op_bss_info_changed()
618 spin_lock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
619 mac->beacon.period = period; in plfxlc_op_bss_info_changed()
620 mac->beacon.interval = interval; in plfxlc_op_bss_info_changed()
621 mac->beacon.last_update = jiffies; in plfxlc_op_bss_info_changed()
622 spin_unlock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
624 plfxlc_set_beacon_interval(&mac->chip, interval, in plfxlc_op_bss_info_changed()
625 period, mac->type); in plfxlc_op_bss_info_changed()
628 spin_lock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
629 mac->associated = associated; in plfxlc_op_bss_info_changed()
630 spin_unlock_irq(&mac->lock); in plfxlc_op_bss_info_changed()
669 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_get_et_stats() local
671 data[0] = mac->rssi; in plfxlc_get_et_stats()
672 data[1] = mac->crc_errors; in plfxlc_get_et_stats()
705 struct plfxlc_mac *mac; in plfxlc_mac_alloc_hw() local
714 mac = plfxlc_hw_mac(hw); in plfxlc_mac_alloc_hw()
715 memset(mac, 0, sizeof(*mac)); in plfxlc_mac_alloc_hw()
716 spin_lock_init(&mac->lock); in plfxlc_mac_alloc_hw()
717 mac->hw = hw; in plfxlc_mac_alloc_hw()
719 mac->type = NL80211_IFTYPE_UNSPECIFIED; in plfxlc_mac_alloc_hw()
721 memcpy(mac->channels, plfxlc_channels, sizeof(plfxlc_channels)); in plfxlc_mac_alloc_hw()
722 memcpy(mac->rates, plfxlc_rates, sizeof(plfxlc_rates)); in plfxlc_mac_alloc_hw()
723 mac->band.n_bitrates = ARRAY_SIZE(plfxlc_rates); in plfxlc_mac_alloc_hw()
724 mac->band.bitrates = mac->rates; in plfxlc_mac_alloc_hw()
725 mac->band.n_channels = ARRAY_SIZE(plfxlc_channels); in plfxlc_mac_alloc_hw()
726 mac->band.channels = mac->channels; in plfxlc_mac_alloc_hw()
727 hw->wiphy->bands[NL80211_BAND_LC] = &mac->band; in plfxlc_mac_alloc_hw()
746 skb_queue_head_init(&mac->ack_wait_queue); in plfxlc_mac_alloc_hw()
747 mac->ack_pending = 0; in plfxlc_mac_alloc_hw()
749 plfxlc_chip_init(&mac->chip, hw, intf); in plfxlc_mac_alloc_hw()