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

Commit a493bcf8 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'wireless-drivers-next-for-davem-2015-10-29' of...

Merge tag 'wireless-drivers-next-for-davem-2015-10-29' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next



Kalle Valo says:

====================
iwlwifi

* bug fix for TDLS
* fixes and cleanups in scan
* support of several scan plans
* improvements in FTM
* fixes in FW API
* improvements in the failure paths when the bus is dead
* other various small things here and there

ath10k

* add QCA9377 support
* fw_stats support for 10.4 firmware

ath6kl

* report antenna configuration to user space
* implement ethtool stats

ssb

* add Kconfig SSB_HOST_SOC for compiling SoC related code
* move functions specific to SoC hosted bus to separated file
* pick PCMCIA host code support from b43 driver
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e258d919 8aaa878d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ config BCM47XX_SSB
	bool "SSB Support for Broadcom BCM47XX"
	select SYS_HAS_CPU_BMIPS32_3300
	select SSB
	select SSB_HOST_SOC
	select SSB_DRIVER_MIPS
	select SSB_DRIVER_EXTIF
	select SSB_EMBEDDED
+36 −41
Original line number Diff line number Diff line
@@ -1231,7 +1231,7 @@ struct airo_info {
	dma_addr_t		shared_dma;
	pm_message_t		power;
	SsidRid			*SSID;
	APListRid		*APList;
	APListRid		APList;
#define	PCI_SHARED_LEN		2*MPI_MAX_FIDS*PKTSIZE+RIDSIZE
	char			proc_name[IFNAMSIZ];

@@ -1848,11 +1848,6 @@ static int readStatusRid(struct airo_info *ai, StatusRid *statr, int lock)
	return PC4500_readrid(ai, RID_STATUS, statr, sizeof(*statr), lock);
}

static int readAPListRid(struct airo_info *ai, APListRid *aplr)
{
	return PC4500_readrid(ai, RID_APLIST, aplr, sizeof(*aplr), 1);
}

static int writeAPListRid(struct airo_info *ai, APListRid *aplr, int lock)
{
	return PC4500_writerid(ai, RID_APLIST, aplr, sizeof(*aplr), lock);
@@ -2413,7 +2408,6 @@ void stop_airo_card( struct net_device *dev, int freeres )

	kfree(ai->flash);
	kfree(ai->rssi);
	kfree(ai->APList);
	kfree(ai->SSID);
	if (freeres) {
		/* PCMCIA frees this stuff, so only for PCI and ISA */
@@ -2809,6 +2803,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
	init_waitqueue_head (&ai->thr_wait);
	ai->tfm = NULL;
	add_airo_dev(ai);
	ai->APList.len = cpu_to_le16(sizeof(struct APListRid));

	if (airo_networks_allocate (ai))
		goto err_out_free;
@@ -3042,6 +3037,11 @@ static void airo_process_scan_results (struct airo_info *ai) {
	}

out:
	/* write APList back (we cleared it in airo_set_scan) */
	disable_MAC(ai, 2);
	writeAPListRid(ai, &ai->APList, 0);
	enable_MAC(ai, 0);

	ai->scan_timeout = 0;
	clear_bit(JOB_SCAN_RESULTS, &ai->jobs);
	up(&ai->sem);
@@ -3613,17 +3613,18 @@ static void disable_MAC( struct airo_info *ai, int lock ) {
        Cmd cmd;
	Resp rsp;

	if (lock && down_interruptible(&ai->sem))
	if (lock == 1 && down_interruptible(&ai->sem))
		return;

	if (test_bit(FLAG_ENABLED, &ai->flags)) {
		if (lock != 2) /* lock == 2 means don't disable carrier */
			netif_carrier_off(ai->dev);
		memset(&cmd, 0, sizeof(cmd));
		cmd.cmd = MAC_DISABLE; // disable in case already enabled
		issuecommand(ai, &cmd, &rsp);
		clear_bit(FLAG_ENABLED, &ai->flags);
	}
	if (lock)
	if (lock == 1)
		up(&ai->sem);
}

@@ -3852,8 +3853,6 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
		tdsRssiRid rssi_rid;
		CapabilityRid cap_rid;

		kfree(ai->APList);
		ai->APList = NULL;
		kfree(ai->SSID);
		ai->SSID = NULL;
		// general configuration (read/modify/write)
@@ -5130,31 +5129,31 @@ static void proc_APList_on_close( struct inode *inode, struct file *file ) {
	struct proc_data *data = file->private_data;
	struct net_device *dev = PDE_DATA(inode);
	struct airo_info *ai = dev->ml_priv;
	APListRid APList_rid;
	APListRid *APList_rid = &ai->APList;
	int i;

	if ( !data->writelen ) return;

	memset( &APList_rid, 0, sizeof(APList_rid) );
	APList_rid.len = cpu_to_le16(sizeof(APList_rid));
	memset(APList_rid, 0, sizeof(*APList_rid));
	APList_rid->len = cpu_to_le16(sizeof(*APList_rid));

	for( i = 0; i < 4 && data->writelen >= (i+1)*6*3; i++ ) {
		int j;
		for( j = 0; j < 6*3 && data->wbuffer[j+i*6*3]; j++ ) {
			switch(j%3) {
			case 0:
				APList_rid.ap[i][j/3]=
				APList_rid->ap[i][j/3]=
					hex_to_bin(data->wbuffer[j+i*6*3])<<4;
				break;
			case 1:
				APList_rid.ap[i][j/3]|=
				APList_rid->ap[i][j/3]|=
					hex_to_bin(data->wbuffer[j+i*6*3]);
				break;
			}
		}
	}
	disable_MAC(ai, 1);
	writeAPListRid(ai, &APList_rid, 1);
	writeAPListRid(ai, APList_rid, 1);
	enable_MAC(ai, 1);
}

@@ -5408,7 +5407,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
	struct airo_info *ai = dev->ml_priv;
	int i;
	char *ptr;
	APListRid APList_rid;
	APListRid *APList_rid = &ai->APList;

	if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
		return -ENOMEM;
@@ -5426,13 +5425,12 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
	}
	data->on_close = proc_APList_on_close;

	readAPListRid(ai, &APList_rid);
	ptr = data->rbuffer;
	for( i = 0; i < 4; i++ ) {
// We end when we find a zero MAC
		if ( !*(int*)APList_rid.ap[i] &&
		     !*(int*)&APList_rid.ap[i][2]) break;
		ptr += sprintf(ptr, "%pM\n", APList_rid.ap[i]);
		if ( !*(int*)APList_rid->ap[i] &&
		     !*(int*)&APList_rid->ap[i][2]) break;
		ptr += sprintf(ptr, "%pM\n", APList_rid->ap[i]);
	}
	if (i==0) ptr += sprintf(ptr, "Not using specific APs\n");

@@ -5596,15 +5594,10 @@ static int airo_pci_suspend(struct pci_dev *pdev, pm_message_t state)
	Cmd cmd;
	Resp rsp;

	if (!ai->APList)
		ai->APList = kmalloc(sizeof(APListRid), GFP_KERNEL);
	if (!ai->APList)
		return -ENOMEM;
	if (!ai->SSID)
		ai->SSID = kmalloc(sizeof(SsidRid), GFP_KERNEL);
	if (!ai->SSID)
		return -ENOMEM;
	readAPListRid(ai, ai->APList);
	readSsidRid(ai, ai->SSID);
	memset(&cmd, 0, sizeof(cmd));
	/* the lock will be released at the end of the resume callback */
@@ -5652,11 +5645,7 @@ static int airo_pci_resume(struct pci_dev *pdev)
		kfree(ai->SSID);
		ai->SSID = NULL;
	}
	if (ai->APList) {
		writeAPListRid(ai, ai->APList, 0);
		kfree(ai->APList);
		ai->APList = NULL;
	}
	writeAPListRid(ai, &ai->APList, 0);
	writeConfigRid(ai, 0);
	enable_MAC(ai, 0);
	ai->power = PMSG_ON;
@@ -5954,7 +5943,7 @@ static int airo_set_wap(struct net_device *dev,
	struct airo_info *local = dev->ml_priv;
	Cmd cmd;
	Resp rsp;
	APListRid APList_rid;
	APListRid *APList_rid = &local->APList;

	if (awrq->sa_family != ARPHRD_ETHER)
		return -EINVAL;
@@ -5967,11 +5956,11 @@ static int airo_set_wap(struct net_device *dev,
		issuecommand(local, &cmd, &rsp);
		up(&local->sem);
	} else {
		memset(&APList_rid, 0, sizeof(APList_rid));
		APList_rid.len = cpu_to_le16(sizeof(APList_rid));
		memcpy(APList_rid.ap[0], awrq->sa_data, ETH_ALEN);
		memset(APList_rid, 0, sizeof(*APList_rid));
		APList_rid->len = cpu_to_le16(sizeof(*APList_rid));
		memcpy(APList_rid->ap[0], awrq->sa_data, ETH_ALEN);
		disable_MAC(local, 1);
		writeAPListRid(local, &APList_rid, 1);
		writeAPListRid(local, APList_rid, 1);
		enable_MAC(local, 1);
	}
	return 0;
@@ -7233,6 +7222,7 @@ static int airo_set_scan(struct net_device *dev,
	Cmd cmd;
	Resp rsp;
	int wake = 0;
	APListRid APList_rid_empty;

	/* Note : you may have realised that, as this is a SET operation,
	 * this is privileged and therefore a normal user can't
@@ -7250,6 +7240,13 @@ static int airo_set_scan(struct net_device *dev,
	if (ai->scan_timeout > 0)
		goto out;

	/* Clear APList as it affects scan results */
	memset(&APList_rid_empty, 0, sizeof(APList_rid_empty));
	APList_rid_empty.len = cpu_to_le16(sizeof(APList_rid_empty));
	disable_MAC(ai, 2);
	writeAPListRid(ai, &APList_rid_empty, 0);
	enable_MAC(ai, 0);

	/* Initiate a scan command */
	ai->scan_timeout = RUN_AT(3*HZ);
	memset(&cmd, 0, sizeof(cmd));
@@ -7505,10 +7502,8 @@ static int airo_config_commit(struct net_device *dev,
	 * parameters. It's now time to commit them in the card */
	disable_MAC(local, 1);
	if (test_bit (FLAG_RESET, &local->flags)) {
		APListRid APList_rid;
		SsidRid SSID_rid;

		readAPListRid(local, &APList_rid);
		readSsidRid(local, &SSID_rid);
		if (test_bit(FLAG_MPI,&local->flags))
			setup_card(local, dev->dev_addr, 1 );
@@ -7516,7 +7511,7 @@ static int airo_config_commit(struct net_device *dev,
			reset_airo_card(dev);
		disable_MAC(local, 1);
		writeSsidRid(local, &SSID_rid, 1);
		writeAPListRid(local, &APList_rid, 1);
		writeAPListRid(local, &local->APList, 1);
	}
	if (down_interruptible(&local->sem))
		return -ERESTARTSYS;
+8 −49
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,
{
	struct ath10k *ar = ce_state->ar;
	struct ath10k_ce_ring *src_ring = ce_state->src_ring;
	struct ce_desc *desc, *sdesc;
	struct ce_desc *desc, sdesc;
	unsigned int nentries_mask = src_ring->nentries_mask;
	unsigned int sw_index = src_ring->sw_index;
	unsigned int write_index = src_ring->write_index;
@@ -294,7 +294,6 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,

	desc = CE_SRC_RING_TO_DESC(src_ring->base_addr_owner_space,
				   write_index);
	sdesc = CE_SRC_RING_TO_DESC(src_ring->shadow_base, write_index);

	desc_flags |= SM(transfer_id, CE_DESC_FLAGS_META_DATA);

@@ -303,11 +302,11 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,
	if (flags & CE_SEND_FLAG_BYTE_SWAP)
		desc_flags |= CE_DESC_FLAGS_BYTE_SWAP;

	sdesc->addr   = __cpu_to_le32(buffer);
	sdesc->nbytes = __cpu_to_le16(nbytes);
	sdesc->flags  = __cpu_to_le16(desc_flags);
	sdesc.addr   = __cpu_to_le32(buffer);
	sdesc.nbytes = __cpu_to_le16(nbytes);
	sdesc.flags  = __cpu_to_le16(desc_flags);

	*desc = *sdesc;
	*desc = sdesc;

	src_ring->per_transfer_context[write_index] = per_transfer_context;

@@ -579,17 +578,13 @@ int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state,
 * The caller takes responsibility for any necessary locking.
 */
int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
					 void **per_transfer_contextp,
					 u32 *bufferp,
					 unsigned int *nbytesp,
					 unsigned int *transfer_idp)
					 void **per_transfer_contextp)
{
	struct ath10k_ce_ring *src_ring = ce_state->src_ring;
	u32 ctrl_addr = ce_state->ctrl_addr;
	struct ath10k *ar = ce_state->ar;
	unsigned int nentries_mask = src_ring->nentries_mask;
	unsigned int sw_index = src_ring->sw_index;
	struct ce_desc *sdesc, *sbase;
	unsigned int read_index;

	if (src_ring->hw_index == sw_index) {
@@ -614,15 +609,6 @@ int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
	if (read_index == sw_index)
		return -EIO;

	sbase = src_ring->shadow_base;
	sdesc = CE_SRC_RING_TO_DESC(sbase, sw_index);

	/* Return data from completed source descriptor */
	*bufferp = __le32_to_cpu(sdesc->addr);
	*nbytesp = __le16_to_cpu(sdesc->nbytes);
	*transfer_idp = MS(__le16_to_cpu(sdesc->flags),
			   CE_DESC_FLAGS_META_DATA);

	if (per_transfer_contextp)
		*per_transfer_contextp =
			src_ring->per_transfer_context[sw_index];
@@ -697,10 +683,7 @@ int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state,
}

int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
				  void **per_transfer_contextp,
				  u32 *bufferp,
				  unsigned int *nbytesp,
				  unsigned int *transfer_idp)
				  void **per_transfer_contextp)
{
	struct ath10k *ar = ce_state->ar;
	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -708,9 +691,7 @@ int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,

	spin_lock_bh(&ar_pci->ce_lock);
	ret = ath10k_ce_completed_send_next_nolock(ce_state,
						   per_transfer_contextp,
						   bufferp, nbytesp,
						   transfer_idp);
						   per_transfer_contextp);
	spin_unlock_bh(&ar_pci->ce_lock);

	return ret;
@@ -940,27 +921,6 @@ ath10k_ce_alloc_src_ring(struct ath10k *ar, unsigned int ce_id,
			src_ring->base_addr_ce_space_unaligned,
			CE_DESC_RING_ALIGN);

	/*
	 * Also allocate a shadow src ring in regular
	 * mem to use for faster access.
	 */
	src_ring->shadow_base_unaligned =
		kmalloc((nentries * sizeof(struct ce_desc) +
			 CE_DESC_RING_ALIGN), GFP_KERNEL);
	if (!src_ring->shadow_base_unaligned) {
		dma_free_coherent(ar->dev,
				  (nentries * sizeof(struct ce_desc) +
				   CE_DESC_RING_ALIGN),
				  src_ring->base_addr_owner_space,
				  src_ring->base_addr_ce_space);
		kfree(src_ring);
		return ERR_PTR(-ENOMEM);
	}

	src_ring->shadow_base = PTR_ALIGN(
			src_ring->shadow_base_unaligned,
			CE_DESC_RING_ALIGN);

	return src_ring;
}

@@ -1139,7 +1099,6 @@ void ath10k_ce_free_pipe(struct ath10k *ar, int ce_id)
	struct ath10k_ce_pipe *ce_state = &ar_pci->ce_states[ce_id];

	if (ce_state->src_ring) {
		kfree(ce_state->src_ring->shadow_base_unaligned);
		dma_free_coherent(ar->dev,
				  (ce_state->src_ring->nentries *
				   sizeof(struct ce_desc) +
+2 −14
Original line number Diff line number Diff line
@@ -100,12 +100,6 @@ struct ath10k_ce_ring {

	/* CE address space */
	u32 base_addr_ce_space;
	/*
	 * Start of shadow copy of descriptors, within regular memory.
	 * Aligned to descriptor-size boundary.
	 */
	void *shadow_base_unaligned;
	struct ce_desc *shadow_base;

	/* keep last */
	void *per_transfer_context[0];
@@ -192,16 +186,10 @@ int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state,
 * Pops 1 completed send buffer from Source ring.
 */
int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
				  void **per_transfer_contextp,
				  u32 *bufferp,
				  unsigned int *nbytesp,
				  unsigned int *transfer_idp);
				  void **per_transfer_contextp);

int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
					 void **per_transfer_contextp,
					 u32 *bufferp,
					 unsigned int *nbytesp,
					 unsigned int *transfer_idp);
					 void **per_transfer_contextp);

/*==================CE Engine Initialization=======================*/

+19 −2
Original line number Diff line number Diff line
@@ -137,6 +137,21 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
			.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
		},
	},
	{
		.id = QCA9377_HW_1_0_DEV_VERSION,
		.name = "qca9377 hw1.0",
		.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
		.uart_pin = 7,
		.otp_exe_param = 0,
		.fw = {
			.dir = QCA9377_HW_1_0_FW_DIR,
			.fw = QCA9377_HW_1_0_FW_FILE,
			.otp = QCA9377_HW_1_0_OTP_FILE,
			.board = QCA9377_HW_1_0_BOARD_DATA_FILE,
			.board_size = QCA9377_BOARD_DATA_SZ,
			.board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
		},
	},
};

static const char *const ath10k_core_fw_feature_str[] = {
@@ -151,6 +166,7 @@ static const char *const ath10k_core_fw_feature_str[] = {
	[ATH10K_FW_FEATURE_NO_NWIFI_DECAP_4ADDR_PADDING] = "no-4addr-pad",
	[ATH10K_FW_FEATURE_SUPPORTS_SKIP_CLOCK_INIT] = "skip-clock-init",
	[ATH10K_FW_FEATURE_RAW_MODE_SUPPORT] = "raw-mode",
	[ATH10K_FW_FEATURE_SUPPORTS_ADAPTIVE_CCA] = "adaptive-cca",
};

static unsigned int ath10k_core_get_fw_feature_str(char *buf,
@@ -568,8 +584,8 @@ static int ath10k_download_fw(struct ath10k *ar, enum ath10k_firmware_mode mode)
		}
		break;
	case ATH10K_FIRMWARE_MODE_UTF:
		data = ar->testmode.utf->data;
		data_len = ar->testmode.utf->size;
		data = ar->testmode.utf_firmware_data;
		data_len = ar->testmode.utf_firmware_len;
		mode_name = "utf";
		break;
	default:
@@ -1900,6 +1916,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
		ar->hw_values = &qca988x_values;
		break;
	case ATH10K_HW_QCA6174:
	case ATH10K_HW_QCA9377:
		ar->regs = &qca6174_regs;
		ar->hw_values = &qca6174_values;
		break;
Loading