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