Lines Matching refs:mac

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