Lines Matching full:local
14 static void prism2_info_commtallies16(local_info_t *local, unsigned char *buf, in prism2_info_commtallies16() argument
21 "info frame\n", local->dev->name, left); in prism2_info_commtallies16()
27 local->comm_tallies.name += le16_to_cpu(tallies->name) in prism2_info_commtallies16()
54 static void prism2_info_commtallies32(local_info_t *local, unsigned char *buf, in prism2_info_commtallies32() argument
61 "info frame\n", local->dev->name, left); in prism2_info_commtallies32()
67 local->comm_tallies.name += le32_to_cpu(tallies->name) in prism2_info_commtallies32()
94 static void prism2_info_commtallies(local_info_t *local, unsigned char *buf, in prism2_info_commtallies() argument
97 if (local->tallies32) in prism2_info_commtallies()
98 prism2_info_commtallies32(local, buf, left); in prism2_info_commtallies()
100 prism2_info_commtallies16(local, buf, left); in prism2_info_commtallies()
129 static void prism2_info_linkstatus(local_info_t *local, unsigned char *buf, in prism2_info_linkstatus() argument
137 local->last_join_time = 0; in prism2_info_linkstatus()
141 "length %d\n", local->dev->name, left); in prism2_info_linkstatus()
145 non_sta_mode = local->iw_mode == IW_MODE_MASTER || in prism2_info_linkstatus()
146 local->iw_mode == IW_MODE_REPEAT || in prism2_info_linkstatus()
147 local->iw_mode == IW_MODE_MONITOR; in prism2_info_linkstatus()
152 local->dev->name, val, hfa384x_linkstatus_str(val)); in prism2_info_linkstatus()
156 netif_carrier_on(local->dev); in prism2_info_linkstatus()
157 netif_carrier_on(local->ddev); in prism2_info_linkstatus()
162 set_bit(PRISM2_INFO_PENDING_LINKSTATUS, &local->pending_info); in prism2_info_linkstatus()
163 local->prev_link_status = val; in prism2_info_linkstatus()
164 schedule_work(&local->info_queue); in prism2_info_linkstatus()
168 static void prism2_host_roaming(local_info_t *local) in prism2_host_roaming() argument
171 struct net_device *dev = local->dev; in prism2_host_roaming()
176 if (local->last_join_time && in prism2_host_roaming()
177 time_before(jiffies, local->last_join_time + 10 * HZ)) { in prism2_host_roaming()
192 spin_lock_irqsave(&local->lock, flags); in prism2_host_roaming()
193 if (local->last_scan_results == NULL || in prism2_host_roaming()
194 local->last_scan_results_count == 0) { in prism2_host_roaming()
195 spin_unlock_irqrestore(&local->lock, flags); in prism2_host_roaming()
201 selected = &local->last_scan_results[0]; in prism2_host_roaming()
203 if (local->preferred_ap[0] || local->preferred_ap[1] || in prism2_host_roaming()
204 local->preferred_ap[2] || local->preferred_ap[3] || in prism2_host_roaming()
205 local->preferred_ap[4] || local->preferred_ap[5]) { in prism2_host_roaming()
208 dev->name, local->preferred_ap); in prism2_host_roaming()
209 for (i = 0; i < local->last_scan_results_count; i++) { in prism2_host_roaming()
210 entry = &local->last_scan_results[i]; in prism2_host_roaming()
211 if (memcmp(local->preferred_ap, entry->bssid, 6) == 0) in prism2_host_roaming()
223 spin_unlock_irqrestore(&local->lock, flags); in prism2_host_roaming()
228 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req, in prism2_host_roaming()
232 local->last_join_time = jiffies; in prism2_host_roaming()
236 static void hostap_report_scan_complete(local_info_t *local) in hostap_report_scan_complete() argument
244 wireless_send_event(local->dev, SIOCGIWSCAN, &wrqu, NULL); in hostap_report_scan_complete()
248 local->scan_timestamp = 0; in hostap_report_scan_complete()
253 static void prism2_info_scanresults(local_info_t *local, unsigned char *buf, in prism2_info_scanresults() argument
264 "length %d\n", local->dev->name, left); in prism2_info_scanresults()
288 spin_lock_irqsave(&local->lock, flags); in prism2_info_scanresults()
289 local->last_scan_type = PRISM2_SCAN; in prism2_info_scanresults()
290 prev = local->last_scan_results; in prism2_info_scanresults()
291 local->last_scan_results = results; in prism2_info_scanresults()
292 local->last_scan_results_count = new_count; in prism2_info_scanresults()
293 spin_unlock_irqrestore(&local->lock, flags); in prism2_info_scanresults()
296 hostap_report_scan_complete(local); in prism2_info_scanresults()
299 set_bit(PRISM2_INFO_PENDING_SCANRESULTS, &local->pending_info); in prism2_info_scanresults()
300 schedule_work(&local->info_queue); in prism2_info_scanresults()
305 static void prism2_info_hostscanresults(local_info_t *local, in prism2_info_hostscanresults() argument
314 wake_up_interruptible(&local->hostscan_wq); in prism2_info_hostscanresults()
318 "length %d\n", local->dev->name, left); in prism2_info_hostscanresults()
326 "hostscanresults\n", local->dev->name); in prism2_info_hostscanresults()
351 local->dev->name, left, result_size); in prism2_info_hostscanresults()
354 spin_lock_irqsave(&local->lock, flags); in prism2_info_hostscanresults()
355 local->last_scan_type = PRISM2_HOSTSCAN; in prism2_info_hostscanresults()
356 prev = local->last_scan_results; in prism2_info_hostscanresults()
357 local->last_scan_results = results; in prism2_info_hostscanresults()
358 local->last_scan_results_count = new_count; in prism2_info_hostscanresults()
359 spin_unlock_irqrestore(&local->lock, flags); in prism2_info_hostscanresults()
362 hostap_report_scan_complete(local); in prism2_info_hostscanresults()
368 void hostap_info_process(local_info_t *local, struct sk_buff *skb) in hostap_info_process() argument
383 prism2_info_commtallies(local, buf, left); in hostap_info_process()
388 prism2_info_linkstatus(local, buf, left); in hostap_info_process()
392 prism2_info_scanresults(local, buf, left); in hostap_info_process()
396 prism2_info_hostscanresults(local, buf, left); in hostap_info_process()
403 local->dev->name, le16_to_cpu(info->len), in hostap_info_process()
416 static void handle_info_queue_linkstatus(local_info_t *local) in handle_info_queue_linkstatus() argument
418 int val = local->prev_link_status; in handle_info_queue_linkstatus()
427 if (local->func->get_rid(local->dev, HFA384X_RID_CURRENTBSSID, in handle_info_queue_linkstatus()
428 local->bssid, ETH_ALEN, 1) < 0) { in handle_info_queue_linkstatus()
430 "LinkStatus event\n", local->dev->name); in handle_info_queue_linkstatus()
433 local->dev->name, in handle_info_queue_linkstatus()
434 (unsigned char *) local->bssid); in handle_info_queue_linkstatus()
435 if (local->wds_type & HOSTAP_WDS_AP_CLIENT) in handle_info_queue_linkstatus()
436 hostap_add_sta(local->ap, local->bssid); in handle_info_queue_linkstatus()
441 netif_carrier_on(local->dev); in handle_info_queue_linkstatus()
442 netif_carrier_on(local->ddev); in handle_info_queue_linkstatus()
443 memcpy(wrqu.ap_addr.sa_data, local->bssid, ETH_ALEN); in handle_info_queue_linkstatus()
445 netif_carrier_off(local->dev); in handle_info_queue_linkstatus()
446 netif_carrier_off(local->ddev); in handle_info_queue_linkstatus()
457 if (connected || local->prev_linkstatus_connected) in handle_info_queue_linkstatus()
458 wireless_send_event(local->dev, SIOCGIWAP, &wrqu, NULL); in handle_info_queue_linkstatus()
459 local->prev_linkstatus_connected = connected; in handle_info_queue_linkstatus()
463 static void handle_info_queue_scanresults(local_info_t *local) in handle_info_queue_scanresults() argument
465 if (local->host_roaming == 1 && local->iw_mode == IW_MODE_INFRA) in handle_info_queue_scanresults()
466 prism2_host_roaming(local); in handle_info_queue_scanresults()
468 if (local->host_roaming == 2 && local->iw_mode == IW_MODE_INFRA && in handle_info_queue_scanresults()
469 !is_zero_ether_addr(local->preferred_ap)) { in handle_info_queue_scanresults()
477 prism2_host_roaming(local); in handle_info_queue_scanresults()
486 local_info_t *local = container_of(work, local_info_t, info_queue); in handle_info_queue() local
489 &local->pending_info)) in handle_info_queue()
490 handle_info_queue_linkstatus(local); in handle_info_queue()
493 &local->pending_info)) in handle_info_queue()
494 handle_info_queue_scanresults(local); in handle_info_queue()
499 void hostap_info_init(local_info_t *local) in hostap_info_init() argument
501 skb_queue_head_init(&local->info_list); in hostap_info_init()
503 INIT_WORK(&local->info_queue, handle_info_queue); in hostap_info_init()