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

Commit d904dc17 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville
Browse files

rt2x00: bss_info_changed() callback is allowed to sleep



The bss_info_changed() callback function no longer needs
to be atomic. Remove the scheduled work structure and
call into the driver directly.

Additionaly this makes the DRIVER_REQUIRE_SCHEDULED
flag redundant so it can be removed.

Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent afa62042
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1874,7 +1874,6 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
	 */
	__set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
	__set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags);
	__set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);
	if (!modparam_nohwcrypt) {
		__set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
		__set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags);
+0 −1
Original line number Diff line number Diff line
@@ -2634,7 +2634,6 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
	 * This device requires firmware.
	 */
	__set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
	__set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);
	__set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
	if (!modparam_nohwcrypt)
		__set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
+0 −3
Original line number Diff line number Diff line
@@ -350,8 +350,6 @@ struct rt2x00_intf {
	 */
	unsigned int delayed_flags;
#define DELAYED_UPDATE_BEACON		0x00000001
#define DELAYED_CONFIG_ERP		0x00000002
#define DELAYED_LED_ASSOC		0x00000004

	/*
	 * Software sequence counter, this is only required
@@ -614,7 +612,6 @@ enum rt2x00_flags {
	DRIVER_REQUIRE_FIRMWARE,
	DRIVER_REQUIRE_BEACON_GUARD,
	DRIVER_REQUIRE_ATIM_QUEUE,
	DRIVER_REQUIRE_SCHEDULED,
	DRIVER_REQUIRE_DMA,
	DRIVER_REQUIRE_COPY_IV,
	DRIVER_REQUIRE_L2PAD,
+0 −8
Original line number Diff line number Diff line
@@ -123,7 +123,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
{
	struct rt2x00_dev *rt2x00dev = data;
	struct rt2x00_intf *intf = vif_to_intf(vif);
	struct ieee80211_bss_conf conf;
	int delayed_flags;

	/*
@@ -133,7 +132,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
	 */
	spin_lock(&intf->lock);

	memcpy(&conf, &vif->bss_conf, sizeof(conf));
	delayed_flags = intf->delayed_flags;
	intf->delayed_flags = 0;

@@ -150,12 +148,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,

	if (delayed_flags & DELAYED_UPDATE_BEACON)
		rt2x00queue_update_beacon(rt2x00dev, vif, true);

	if (delayed_flags & DELAYED_CONFIG_ERP)
		rt2x00lib_config_erp(rt2x00dev, intf, &conf);

	if (delayed_flags & DELAYED_LED_ASSOC)
		rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);
}

static void rt2x00lib_intf_scheduled(struct work_struct *work)
+3 −11
Original line number Diff line number Diff line
@@ -636,23 +636,15 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
		else
			rt2x00dev->intf_associated--;

		if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags))
			rt2x00leds_led_assoc(rt2x00dev,
					     !!rt2x00dev->intf_associated);
		else
			delayed |= DELAYED_LED_ASSOC;
		rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);
	}

	/*
	 * When the erp information has changed, we should perform
	 * additional configuration steps. For all other changes we are done.
	 */
	if (changes & ~(BSS_CHANGED_ASSOC | BSS_CHANGED_HT)) {
		if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags))
	if (changes & ~(BSS_CHANGED_ASSOC | BSS_CHANGED_HT))
		rt2x00lib_config_erp(rt2x00dev, intf, bss_conf);
		else
			delayed |= DELAYED_CONFIG_ERP;
	}

	spin_lock(&intf->lock);
	if (delayed) {
Loading