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

Commit 9b6941d8 authored by David S. Miller's avatar David S. Miller
Browse files
parents de221bd5 acd9f9cc
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -3327,7 +3327,6 @@ F: drivers/net/wimax/i2400m/
F:	include/linux/wimax/i2400m.h
F:	include/linux/wimax/i2400m.h


INTEL WIRELESS WIFI LINK (iwlwifi)
INTEL WIRELESS WIFI LINK (iwlwifi)
M:	Reinette Chatre <reinette.chatre@intel.com>
M:	Wey-Yi Guy <wey-yi.w.guy@intel.com>
M:	Wey-Yi Guy <wey-yi.w.guy@intel.com>
M:	Intel Linux Wireless <ilw@linux.intel.com>
M:	Intel Linux Wireless <ilw@linux.intel.com>
L:	linux-wireless@vger.kernel.org
L:	linux-wireless@vger.kernel.org
+20 −55
Original line number Original line Diff line number Diff line
@@ -47,46 +47,40 @@ MODULE_DEVICE_TABLE(usb, ath3k_table);
#define USB_REQ_DFU_DNLOAD	1
#define USB_REQ_DFU_DNLOAD	1
#define BULK_SIZE		4096
#define BULK_SIZE		4096


struct ath3k_data {
static int ath3k_load_firmware(struct usb_device *udev,
	struct usb_device *udev;
				const struct firmware *firmware)
	u8 *fw_data;
	u32 fw_size;
	u32 fw_sent;
};

static int ath3k_load_firmware(struct ath3k_data *data,
				unsigned char *firmware,
				int count)
{
{
	u8 *send_buf;
	u8 *send_buf;
	int err, pipe, len, size, sent = 0;
	int err, pipe, len, size, sent = 0;
	int count = firmware->size;


	BT_DBG("ath3k %p udev %p", data, data->udev);
	BT_DBG("udev %p", udev);


	pipe = usb_sndctrlpipe(data->udev, 0);
	pipe = usb_sndctrlpipe(udev, 0);


	if ((usb_control_msg(data->udev, pipe,
	send_buf = kmalloc(BULK_SIZE, GFP_ATOMIC);
	if (!send_buf) {
		BT_ERR("Can't allocate memory chunk for firmware");
		return -ENOMEM;
	}

	memcpy(send_buf, firmware->data, 20);
	if ((err = usb_control_msg(udev, pipe,
				USB_REQ_DFU_DNLOAD,
				USB_REQ_DFU_DNLOAD,
				USB_TYPE_VENDOR, 0, 0,
				USB_TYPE_VENDOR, 0, 0,
				firmware, 20, USB_CTRL_SET_TIMEOUT)) < 0) {
				send_buf, 20, USB_CTRL_SET_TIMEOUT)) < 0) {
		BT_ERR("Can't change to loading configuration err");
		BT_ERR("Can't change to loading configuration err");
		return -EBUSY;
		goto error;
	}
	}
	sent += 20;
	sent += 20;
	count -= 20;
	count -= 20;


	send_buf = kmalloc(BULK_SIZE, GFP_ATOMIC);
	if (!send_buf) {
		BT_ERR("Can't allocate memory chunk for firmware");
		return -ENOMEM;
	}

	while (count) {
	while (count) {
		size = min_t(uint, count, BULK_SIZE);
		size = min_t(uint, count, BULK_SIZE);
		pipe = usb_sndbulkpipe(data->udev, 0x02);
		pipe = usb_sndbulkpipe(udev, 0x02);
		memcpy(send_buf, firmware + sent, size);
		memcpy(send_buf, firmware->data + sent, size);


		err = usb_bulk_msg(data->udev, pipe, send_buf, size,
		err = usb_bulk_msg(udev, pipe, send_buf, size,
					&len, 3000);
					&len, 3000);


		if (err || (len != size)) {
		if (err || (len != size)) {
@@ -112,57 +106,28 @@ static int ath3k_probe(struct usb_interface *intf,
{
{
	const struct firmware *firmware;
	const struct firmware *firmware;
	struct usb_device *udev = interface_to_usbdev(intf);
	struct usb_device *udev = interface_to_usbdev(intf);
	struct ath3k_data *data;
	int size;


	BT_DBG("intf %p id %p", intf, id);
	BT_DBG("intf %p id %p", intf, id);


	if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
	if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
		return -ENODEV;
		return -ENODEV;


	data = kzalloc(sizeof(*data), GFP_KERNEL);
	if (!data)
		return -ENOMEM;

	data->udev = udev;

	if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
	if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
		kfree(data);
		return -EIO;
		return -EIO;
	}
	}


	size = max_t(uint, firmware->size, 4096);
	if (ath3k_load_firmware(udev, firmware)) {
	data->fw_data = kmalloc(size, GFP_KERNEL);
	if (!data->fw_data) {
		release_firmware(firmware);
		release_firmware(firmware);
		kfree(data);
		return -ENOMEM;
	}

	memcpy(data->fw_data, firmware->data, firmware->size);
	data->fw_size = firmware->size;
	data->fw_sent = 0;
	release_firmware(firmware);

	usb_set_intfdata(intf, data);
	if (ath3k_load_firmware(data, data->fw_data, data->fw_size)) {
		usb_set_intfdata(intf, NULL);
		kfree(data->fw_data);
		kfree(data);
		return -EIO;
		return -EIO;
	}
	}
	release_firmware(firmware);


	return 0;
	return 0;
}
}


static void ath3k_disconnect(struct usb_interface *intf)
static void ath3k_disconnect(struct usb_interface *intf)
{
{
	struct ath3k_data *data = usb_get_intfdata(intf);

	BT_DBG("ath3k_disconnect intf %p", intf);
	BT_DBG("ath3k_disconnect intf %p", intf);

	kfree(data->fw_data);
	kfree(data);
}
}


static struct usb_driver ath3k_driver = {
static struct usb_driver ath3k_driver = {
+5 −1
Original line number Original line Diff line number Diff line
@@ -369,6 +369,9 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
	else
	else
		ah->config.ht_enable = 0;
		ah->config.ht_enable = 0;


	/* PAPRD needs some more work to be enabled */
	ah->config.paprd_disable = 1;

	ah->config.rx_intr_mitigation = true;
	ah->config.rx_intr_mitigation = true;
	ah->config.pcieSerDesWrite = true;
	ah->config.pcieSerDesWrite = true;


@@ -1933,7 +1936,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
		pCap->rx_status_len = sizeof(struct ar9003_rxs);
		pCap->rx_status_len = sizeof(struct ar9003_rxs);
		pCap->tx_desc_len = sizeof(struct ar9003_txc);
		pCap->tx_desc_len = sizeof(struct ar9003_txc);
		pCap->txs_len = sizeof(struct ar9003_txs);
		pCap->txs_len = sizeof(struct ar9003_txs);
		if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD))
		if (!ah->config.paprd_disable &&
		    ah->eep_ops->get_eeprom(ah, EEP_PAPRD))
			pCap->hw_caps |= ATH9K_HW_CAP_PAPRD;
			pCap->hw_caps |= ATH9K_HW_CAP_PAPRD;
	} else {
	} else {
		pCap->tx_desc_len = sizeof(struct ath_desc);
		pCap->tx_desc_len = sizeof(struct ath_desc);
+1 −0
Original line number Original line Diff line number Diff line
@@ -225,6 +225,7 @@ struct ath9k_ops_config {
	u32 pcie_waen;
	u32 pcie_waen;
	u8 analog_shiftreg;
	u8 analog_shiftreg;
	u8 ht_enable;
	u8 ht_enable;
	u8 paprd_disable;
	u32 ofdm_trig_low;
	u32 ofdm_trig_low;
	u32 ofdm_trig_high;
	u32 ofdm_trig_high;
	u32 cck_trig_high;
	u32 cck_trig_high;
+5 −3
Original line number Original line Diff line number Diff line
@@ -592,14 +592,12 @@ void ath9k_tasklet(unsigned long data)
	u32 status = sc->intrstatus;
	u32 status = sc->intrstatus;
	u32 rxmask;
	u32 rxmask;


	ath9k_ps_wakeup(sc);

	if (status & ATH9K_INT_FATAL) {
	if (status & ATH9K_INT_FATAL) {
		ath_reset(sc, true);
		ath_reset(sc, true);
		ath9k_ps_restore(sc);
		return;
		return;
	}
	}


	ath9k_ps_wakeup(sc);
	spin_lock(&sc->sc_pcu_lock);
	spin_lock(&sc->sc_pcu_lock);


	if (!ath9k_hw_check_alive(ah))
	if (!ath9k_hw_check_alive(ah))
@@ -969,6 +967,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
	/* Stop ANI */
	/* Stop ANI */
	del_timer_sync(&common->ani.timer);
	del_timer_sync(&common->ani.timer);


	ath9k_ps_wakeup(sc);
	spin_lock_bh(&sc->sc_pcu_lock);
	spin_lock_bh(&sc->sc_pcu_lock);


	ieee80211_stop_queues(hw);
	ieee80211_stop_queues(hw);
@@ -1015,6 +1014,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)


	/* Start ANI */
	/* Start ANI */
	ath_start_ani(common);
	ath_start_ani(common);
	ath9k_ps_restore(sc);


	return r;
	return r;
}
}
@@ -1701,7 +1701,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
skip_chan_change:
skip_chan_change:
	if (changed & IEEE80211_CONF_CHANGE_POWER) {
	if (changed & IEEE80211_CONF_CHANGE_POWER) {
		sc->config.txpowlimit = 2 * conf->power_level;
		sc->config.txpowlimit = 2 * conf->power_level;
		ath9k_ps_wakeup(sc);
		ath_update_txpow(sc);
		ath_update_txpow(sc);
		ath9k_ps_restore(sc);
	}
	}


	spin_lock_bh(&sc->wiphy_lock);
	spin_lock_bh(&sc->wiphy_lock);
Loading