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

Commit 066cb637 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by David S. Miller
Browse files

[PATCH] rt2x00: Reorganize rt2x00dev->flags



The rt2x00dev->flags has become a chaos over time,
this will reorganize the flags by renaming, deleting, adding
and properly implement the flags.

Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 12dadb90
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1374,7 +1374,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
	 * Detect if this device has an hardware controlled radio.
	 */
	if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
		__set_bit(DEVICE_SUPPORT_HW_BUTTON, &rt2x00dev->flags);
		__set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags);

	/*
	 * Check if the BBP tuning should be enabled.
@@ -1469,7 +1469,7 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
	/*
	 * This device requires the beacon ring
	 */
	__set_bit(REQUIRE_BEACON_RING, &rt2x00dev->flags);
	__set_bit(DRIVER_REQUIRE_BEACON_RING, &rt2x00dev->flags);

	/*
	 * Set the rssi offset.
+2 −2
Original line number Diff line number Diff line
@@ -1545,7 +1545,7 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
	 * Detect if this device has an hardware controlled radio.
	 */
	if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
		__set_bit(DEVICE_SUPPORT_HW_BUTTON, &rt2x00dev->flags);
		__set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags);

	/*
	 * Check if the BBP tuning should be enabled.
@@ -1801,7 +1801,7 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev)
	/*
	 * This device requires the beacon ring
	 */
	__set_bit(REQUIRE_BEACON_RING, &rt2x00dev->flags);
	__set_bit(DRIVER_REQUIRE_BEACON_RING, &rt2x00dev->flags);

	/*
	 * Set the rssi offset.
+1 −1
Original line number Diff line number Diff line
@@ -1573,7 +1573,7 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
	/*
	 * This device requires the beacon ring
	 */
	__set_bit(REQUIRE_BEACON_RING, &rt2x00dev->flags);
	__set_bit(DRIVER_REQUIRE_BEACON_RING, &rt2x00dev->flags);

	/*
	 * Set the rssi offset.
+14 −17
Original line number Diff line number Diff line
@@ -493,24 +493,21 @@ struct rt2x00_dev {
	 * of the device capabilities are stored.
	 */
	unsigned long flags;
#define DEVICE_ENABLED_RADIO		1
#define DEVICE_ENABLED_RADIO_HW		2
#define DEVICE_PRESENT			1
#define DEVICE_REGISTERED_HW		2
#define DEVICE_INITIALIZED		3
#define DEVICE_INITIALIZED_HW		4
#define REQUIRE_FIRMWARE		5
/* Hole: Add new Flag here */
#define INTERFACE_RESUME		8
#define INTERFACE_ENABLED		9
/* Hole: Add new Flag here */
#define REQUIRE_BEACON_RING		11
#define DEVICE_SUPPORT_HW_BUTTON	12
#define CONFIG_FRAME_TYPE		13
#define CONFIG_RF_SEQUENCE		14
/* Hole: Add new Flag here */
#define CONFIG_EXTERNAL_LNA_A		16
#define CONFIG_EXTERNAL_LNA_BG		17
#define CONFIG_DOUBLE_ANTENNA		18
#define CONFIG_DISABLE_LINK_TUNING	19
#define DEVICE_STARTED			4
#define DEVICE_ENABLED_RADIO		5
#define DEVICE_ENABLED_RADIO_HW		6
#define DRIVER_REQUIRE_FIRMWARE		7
#define DRIVER_REQUIRE_BEACON_RING	8
#define CONFIG_SUPPORT_HW_BUTTON	9
#define CONFIG_FRAME_TYPE		10
#define CONFIG_RF_SEQUENCE		11
#define CONFIG_EXTERNAL_LNA_A		12
#define CONFIG_EXTERNAL_LNA_BG		13
#define CONFIG_DOUBLE_ANTENNA		14
#define CONFIG_DISABLE_LINK_TUNING	15

	/*
	 * Chipset identification.
+7 −20
Original line number Diff line number Diff line
@@ -48,33 +48,20 @@ void rt2x00lib_config_bssid(struct rt2x00_dev *rt2x00dev, u8 *bssid)

void rt2x00lib_config_type(struct rt2x00_dev *rt2x00dev, int type)
{
	struct interface *intf = &rt2x00dev->interface;

	if (!test_bit(INTERFACE_RESUME, &rt2x00dev->flags) &&
	    (!!test_bit(INTERFACE_ENABLED, &rt2x00dev->flags) ==
	     !!is_interface_present(intf)))
		return;

	if (type != INVALID_INTERFACE)
		rt2x00dev->ops->lib->config_type(rt2x00dev, type);

	/*
	 * Update the configuration flags.
	 */
	if (is_interface_present(intf))
		__set_bit(INTERFACE_ENABLED, &rt2x00dev->flags);
	else
		__clear_bit(INTERFACE_ENABLED, &rt2x00dev->flags);
}

void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, struct ieee80211_conf *conf)
void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
		      struct ieee80211_conf *conf, const int force_config)
{
	int flags = 0;

	/*
	 * If we are in RESUME state we should
	 * force all configuration options.
	 * In some situations we want to force all configurations
	 * to be reloaded (When resuming for instance).
	 */
	if (test_bit(INTERFACE_RESUME, &rt2x00dev->flags)) {
	if (force_config) {
		flags = CONFIG_UPDATE_ALL;
		goto config;
	}
Loading