Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67972e0c authored by David S. Miller's avatar David S. Miller
Browse files
parents ad61df91 8a8e05e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ do { \
#define ADM8211_SYNCTL_CS1	(1 << 28)
#define ADM8211_SYNCTL_CAL	(1 << 27)
#define ADM8211_SYNCTL_SELCAL	(1 << 26)
#define ADM8211_SYNCTL_RFtype	((1 << 24) || (1 << 23) || (1 << 22))
#define ADM8211_SYNCTL_RFtype	((1 << 24) | (1 << 23) | (1 << 22))
#define ADM8211_SYNCTL_RFMD	(1 << 22)
#define ADM8211_SYNCTL_GENERAL	(0x7 << 22)
/* SYNCTL 21:0 Data (Si4126: 18-bit data, 4-bit address) */
+92 −76
Original line number Diff line number Diff line
@@ -607,82 +607,7 @@ struct b43_qos_params {
	struct ieee80211_tx_queue_params p;
};

struct b43_wldev;

/* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */
struct b43_wl {
	/* Pointer to the active wireless device on this chip */
	struct b43_wldev *current_dev;
	/* Pointer to the ieee80211 hardware data structure */
	struct ieee80211_hw *hw;

	/* Global driver mutex. Every operation must run with this mutex locked. */
	struct mutex mutex;
	/* Hard-IRQ spinlock. This lock protects things used in the hard-IRQ
	 * handler, only. This basically is just the IRQ mask register. */
	spinlock_t hardirq_lock;

	/* The number of queues that were registered with the mac80211 subsystem
	 * initially. This is a backup copy of hw->queues in case hw->queues has
	 * to be dynamically lowered at runtime (Firmware does not support QoS).
	 * hw->queues has to be restored to the original value before unregistering
	 * from the mac80211 subsystem. */
	u16 mac80211_initially_registered_queues;

	/* We can only have one operating interface (802.11 core)
	 * at a time. General information about this interface follows.
	 */

	struct ieee80211_vif *vif;
	/* The MAC address of the operating interface. */
	u8 mac_addr[ETH_ALEN];
	/* Current BSSID */
	u8 bssid[ETH_ALEN];
	/* Interface type. (NL80211_IFTYPE_XXX) */
	int if_type;
	/* Is the card operating in AP, STA or IBSS mode? */
	bool operating;
	/* filter flags */
	unsigned int filter_flags;
	/* Stats about the wireless interface */
	struct ieee80211_low_level_stats ieee_stats;

#ifdef CONFIG_B43_HWRNG
	struct hwrng rng;
	bool rng_initialized;
	char rng_name[30 + 1];
#endif /* CONFIG_B43_HWRNG */

	/* List of all wireless devices on this chip */
	struct list_head devlist;
	u8 nr_devs;

	bool radiotap_enabled;
	bool radio_enabled;

	/* The beacon we are currently using (AP or IBSS mode). */
	struct sk_buff *current_beacon;
	bool beacon0_uploaded;
	bool beacon1_uploaded;
	bool beacon_templates_virgin; /* Never wrote the templates? */
	struct work_struct beacon_update_trigger;

	/* The current QOS parameters for the 4 queues. */
	struct b43_qos_params qos_params[4];

	/* Work for adjustment of the transmission power.
	 * This is scheduled when we determine that the actual TX output
	 * power doesn't match what we want. */
	struct work_struct txpower_adjust_work;

	/* Packet transmit work */
	struct work_struct tx_work;
	/* Queue of packets to be transmitted. */
	struct sk_buff_head tx_queue;

	/* The device LEDs. */
	struct b43_leds leds;
};
struct b43_wl;

/* The type of the firmware file. */
enum b43_firmware_file_type {
@@ -824,6 +749,97 @@ struct b43_wldev {
#endif
};

/*
 * Include goes here to avoid a dependency problem.
 * A better fix would be to integrate xmit.h into b43.h.
 */
#include "xmit.h"

/* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */
struct b43_wl {
	/* Pointer to the active wireless device on this chip */
	struct b43_wldev *current_dev;
	/* Pointer to the ieee80211 hardware data structure */
	struct ieee80211_hw *hw;

	/* Global driver mutex. Every operation must run with this mutex locked. */
	struct mutex mutex;
	/* Hard-IRQ spinlock. This lock protects things used in the hard-IRQ
	 * handler, only. This basically is just the IRQ mask register. */
	spinlock_t hardirq_lock;

	/* The number of queues that were registered with the mac80211 subsystem
	 * initially. This is a backup copy of hw->queues in case hw->queues has
	 * to be dynamically lowered at runtime (Firmware does not support QoS).
	 * hw->queues has to be restored to the original value before unregistering
	 * from the mac80211 subsystem. */
	u16 mac80211_initially_registered_queues;

	/* We can only have one operating interface (802.11 core)
	 * at a time. General information about this interface follows.
	 */

	struct ieee80211_vif *vif;
	/* The MAC address of the operating interface. */
	u8 mac_addr[ETH_ALEN];
	/* Current BSSID */
	u8 bssid[ETH_ALEN];
	/* Interface type. (NL80211_IFTYPE_XXX) */
	int if_type;
	/* Is the card operating in AP, STA or IBSS mode? */
	bool operating;
	/* filter flags */
	unsigned int filter_flags;
	/* Stats about the wireless interface */
	struct ieee80211_low_level_stats ieee_stats;

#ifdef CONFIG_B43_HWRNG
	struct hwrng rng;
	bool rng_initialized;
	char rng_name[30 + 1];
#endif /* CONFIG_B43_HWRNG */

	/* List of all wireless devices on this chip */
	struct list_head devlist;
	u8 nr_devs;

	bool radiotap_enabled;
	bool radio_enabled;

	/* The beacon we are currently using (AP or IBSS mode). */
	struct sk_buff *current_beacon;
	bool beacon0_uploaded;
	bool beacon1_uploaded;
	bool beacon_templates_virgin; /* Never wrote the templates? */
	struct work_struct beacon_update_trigger;

	/* The current QOS parameters for the 4 queues. */
	struct b43_qos_params qos_params[4];

	/* Work for adjustment of the transmission power.
	 * This is scheduled when we determine that the actual TX output
	 * power doesn't match what we want. */
	struct work_struct txpower_adjust_work;

	/* Packet transmit work */
	struct work_struct tx_work;
	/* Queue of packets to be transmitted. */
	struct sk_buff_head tx_queue;

	/* The device LEDs. */
	struct b43_leds leds;

#ifdef CONFIG_B43_PIO
	/*
	 * RX/TX header/tail buffers used by the frame transmit functions.
	 */
	struct b43_rxhdr_fw4 rxhdr;
	struct b43_txhdr txhdr;
	u8 rx_tail[4];
	u8 tx_tail[4];
#endif /* CONFIG_B43_PIO */
};

static inline struct b43_wl *hw_to_b43_wl(struct ieee80211_hw *hw)
{
	return hw->priv;
+2 −2
Original line number Diff line number Diff line
@@ -348,9 +348,9 @@ void b43_leds_register(struct b43_wldev *dev)
	}
}

void b43_leds_unregister(struct b43_wldev *dev)
void b43_leds_unregister(struct b43_wl *wl)
{
	struct b43_leds *leds = &dev->wl->leds;
	struct b43_leds *leds = &wl->leds;

	b43_unregister_led(&leds->led_tx);
	b43_unregister_led(&leds->led_rx);
+2 −2
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ enum b43_led_behaviour {
};

void b43_leds_register(struct b43_wldev *dev);
void b43_leds_unregister(struct b43_wldev *dev);
void b43_leds_unregister(struct b43_wl *wl);
void b43_leds_init(struct b43_wldev *dev);
void b43_leds_exit(struct b43_wldev *dev);
void b43_leds_stop(struct b43_wldev *dev);
@@ -76,7 +76,7 @@ struct b43_leds {
static inline void b43_leds_register(struct b43_wldev *dev)
{
}
static inline void b43_leds_unregister(struct b43_wldev *dev)
static inline void b43_leds_unregister(struct b43_wl *wl)
{
}
static inline void b43_leds_init(struct b43_wldev *dev)
+5 −2
Original line number Diff line number Diff line
@@ -3874,6 +3874,7 @@ static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev)
{
	struct b43_wl *wl = dev->wl;
	struct b43_wldev *orig_dev;
	u32 mask;

redo:
	if (!dev || b43_status(dev) < B43_STAT_STARTED)
@@ -3920,7 +3921,8 @@ static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev)
			goto redo;
		return dev;
	}
	B43_WARN_ON(b43_read32(dev, B43_MMIO_GEN_IRQ_MASK));
	mask = b43_read32(dev, B43_MMIO_GEN_IRQ_MASK);
	B43_WARN_ON(mask != 0xFFFFFFFF && mask);

	/* Drain the TX queue */
	while (skb_queue_len(&wl->tx_queue))
@@ -4499,6 +4501,7 @@ static void b43_op_stop(struct ieee80211_hw *hw)

	cancel_work_sync(&(wl->beacon_update_trigger));

	wiphy_rfkill_stop_polling(hw->wiphy);
	mutex_lock(&wl->mutex);
	if (b43_status(dev) >= B43_STAT_STARTED) {
		dev = b43_wireless_core_stop(dev);
@@ -4997,7 +5000,7 @@ static void b43_remove(struct ssb_device *dev)

	if (list_empty(&wl->devlist)) {
		b43_rng_exit(wl);
		b43_leds_unregister(wldev);
		b43_leds_unregister(wl);
		/* Last core on the chip unregistered.
		 * We can destroy common struct b43_wl.
		 */
Loading