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