示例#1
0
/* Called only as a tasklet (software IRQ) */
static void prism2_info_linkstatus(local_info_t *local, unsigned char *buf,
				    int left)
{
	u16 val;
	int non_sta_mode;

	/* Alloc new JoinRequests to occur since LinkStatus for the previous
	 * has been received */
	local->last_join_time = 0;

	if (left != 2) {
		printk(KERN_DEBUG "%s: invalid linkstatus info frame "
		       "length %d\n", local->dev->name, left);
		return;
	}

	non_sta_mode = local->iw_mode == IW_MODE_MASTER ||
		local->iw_mode == IW_MODE_REPEAT ||
		local->iw_mode == IW_MODE_MONITOR;

	val = buf[0] | (buf[1] << 8);
	if (!non_sta_mode || val != HFA384X_LINKSTATUS_DISCONNECTED) {
		PDEBUG(DEBUG_EXTRA, "%s: LinkStatus=%d (%s)\n",
		       local->dev->name, val, hfa384x_linkstatus_str(val));
	}

	if (non_sta_mode)
		return;

	/* Get current BSSID later in scheduled task */
	set_bit(PRISM2_INFO_PENDING_LINKSTATUS, &local->pending_info);
	local->prev_link_status = val;
	PRISM2_SCHEDULE_TASK(&local->info_queue);
}
示例#2
0
static void hostap_set_multicast_list(struct net_device *dev)
{
#if 0
	/* FIX: promiscuous mode seems to be causing a lot of problems with
	 * some station firmware versions (FCSErr frames, invalid MACPort, etc.
	 * corrupted incoming frames). This code is now commented out while the
	 * problems are investigated. */
	local_info_t *local = (local_info_t *) dev->priv;

	if ((dev->flags & IFF_ALLMULTI) || (dev->flags & IFF_PROMISC)) {
		local->is_promisc = 1;
	} else {
		local->is_promisc = 0;
	}

	PRISM2_SCHEDULE_TASK(&local->set_multicast_list_queue);
#endif
}
示例#3
0
/* Called only as a tasklet (software IRQ) */
static void prism2_info_scanresults(local_info_t *local, unsigned char *buf,
				    int left)
{
	u16 *pos;
	int new_count;
	unsigned long flags;
	struct hfa384x_scan_result *results, *prev;

	if (left < 4) {
		printk(KERN_DEBUG "%s: invalid scanresult info frame "
		       "length %d\n", local->dev->name, left);
		return;
	}

	pos = (u16 *) buf;
	pos++;
	pos++;
	left -= 4;

	new_count = left / sizeof(struct hfa384x_scan_result);
	results = kmalloc(new_count * sizeof(struct hfa384x_scan_result),
			  GFP_ATOMIC);
	if (results == NULL)
		return;
	memcpy(results, pos, new_count * sizeof(struct hfa384x_scan_result));

	spin_lock_irqsave(&local->lock, flags);
	local->last_scan_type = PRISM2_SCAN;
	prev = local->last_scan_results;
	local->last_scan_results = results;
	local->last_scan_results_count = new_count;
	spin_unlock_irqrestore(&local->lock, flags);
	kfree(prev);

	hostap_report_scan_complete(local);

	/* Perform rest of ScanResults handling later in scheduled task */
	set_bit(PRISM2_INFO_PENDING_SCANRESULTS, &local->pending_info);
	PRISM2_SCHEDULE_TASK(&local->info_queue);
}