Lines Matching +full:left +full:-

1 // SPDX-License-Identifier: GPL-2.0
15 int left) in prism2_info_commtallies16() argument
19 if (left < sizeof(struct hfa384x_comm_tallies)) { in prism2_info_commtallies16()
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()
55 int left) in prism2_info_commtallies32() argument
59 if (left < sizeof(struct hfa384x_comm_tallies32)) { in prism2_info_commtallies32()
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()
95 int left) 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()
130 int left) in prism2_info_linkstatus() argument
137 local->last_join_time = 0; in prism2_info_linkstatus()
139 if (left != 2) { 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()
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()
179 "completed - waiting for it before issuing new one\n", in prism2_host_roaming()
180 dev->name); 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()
197 dev->name); 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()
214 "selection\n", dev->name); in prism2_host_roaming()
221 memcpy(req.bssid, selected->bssid, ETH_ALEN); in prism2_host_roaming()
222 req.channel = selected->chid; in prism2_host_roaming()
223 spin_unlock_irqrestore(&local->lock, flags); in prism2_host_roaming()
227 dev->name, req.bssid, le16_to_cpu(req.channel)); in prism2_host_roaming()
228 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req, in prism2_host_roaming()
230 printk(KERN_DEBUG "%s: JoinRequest failed\n", dev->name); in prism2_host_roaming()
232 local->last_join_time = jiffies; in prism2_host_roaming()
244 wireless_send_event(local->dev, SIOCGIWSCAN, &wrqu, NULL); in hostap_report_scan_complete()
248 local->scan_timestamp = 0; in hostap_report_scan_complete()
254 int left) in prism2_info_scanresults() argument
262 if (left < 4) { in prism2_info_scanresults()
264 "length %d\n", local->dev->name, left); in prism2_info_scanresults()
271 left -= 4; in prism2_info_scanresults()
273 new_count = left / sizeof(struct hfa384x_scan_result); 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()
299 set_bit(PRISM2_INFO_PENDING_SCANRESULTS, &local->pending_info); in prism2_info_scanresults()
300 schedule_work(&local->info_queue); in prism2_info_scanresults()
306 unsigned char *buf, int left) in prism2_info_hostscanresults() argument
314 wake_up_interruptible(&local->hostscan_wq); in prism2_info_hostscanresults()
316 if (left < 4) { 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()
334 left -= 4; in prism2_info_hostscanresults()
337 new_count = left / result_size; in prism2_info_hostscanresults()
346 left -= result_size; in prism2_info_hostscanresults()
349 if (left) { 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()
372 int left; in hostap_info_process() local
377 info = (struct hfa384x_info_frame *) skb->data; in hostap_info_process()
378 buf = skb->data + sizeof(*info); in hostap_info_process()
379 left = skb->len - sizeof(*info); in hostap_info_process()
381 switch (le16_to_cpu(info->type)) { in hostap_info_process()
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()
402 PDEBUG(DEBUG_EXTRA, "%s: INFO - len=%d type=0x%04x\n", in hostap_info_process()
403 local->dev->name, le16_to_cpu(info->len), in hostap_info_process()
404 le16_to_cpu(info->type)); in hostap_info_process()
406 for (i = 0; i < (left < 100 ? left : 100); i++) in hostap_info_process()
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()
465 if (local->host_roaming == 1 && local->iw_mode == IW_MODE_INFRA) 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()
473 * to fix this by re-joining the current AP. This does not in handle_info_queue_scanresults()
489 &local->pending_info)) in handle_info_queue()
493 &local->pending_info)) in handle_info_queue()
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()