Lines Matching refs:network
69 struct ipw_network *network = callback_data; in notify_packet_sent() local
72 spin_lock_irqsave(&network->lock, flags); in notify_packet_sent()
73 network->outgoing_packets_queued--; in notify_packet_sent()
74 if (network->ppp_channel != NULL) { in notify_packet_sent()
75 if (network->ppp_blocked) { in notify_packet_sent()
76 network->ppp_blocked = 0; in notify_packet_sent()
77 spin_unlock_irqrestore(&network->lock, flags); in notify_packet_sent()
78 ppp_output_wakeup(network->ppp_channel); in notify_packet_sent()
83 spin_unlock_irqrestore(&network->lock, flags); in notify_packet_sent()
85 spin_unlock_irqrestore(&network->lock, flags); in notify_packet_sent()
94 struct ipw_network *network = ppp_channel->private; in ipwireless_ppp_start_xmit() local
97 spin_lock_irqsave(&network->lock, flags); in ipwireless_ppp_start_xmit()
98 if (network->outgoing_packets_queued < ipwireless_out_queue) { in ipwireless_ppp_start_xmit()
106 network->outgoing_packets_queued++; in ipwireless_ppp_start_xmit()
107 spin_unlock_irqrestore(&network->lock, flags); in ipwireless_ppp_start_xmit()
115 ret = ipwireless_send_packet(network->hardware, in ipwireless_ppp_start_xmit()
119 network); in ipwireless_ppp_start_xmit()
131 ret = ipwireless_send_packet(network->hardware, in ipwireless_ppp_start_xmit()
135 network); in ipwireless_ppp_start_xmit()
147 network->ppp_blocked = 1; in ipwireless_ppp_start_xmit()
148 spin_unlock_irqrestore(&network->lock, flags); in ipwireless_ppp_start_xmit()
159 struct ipw_network *network = ppp_channel->private; in ipwireless_ppp_ioctl() local
167 val = network->flags | network->rbits; in ipwireless_ppp_ioctl()
176 network->flags = val & ~SC_RCV_BITS; in ipwireless_ppp_ioctl()
177 network->rbits = val & SC_RCV_BITS; in ipwireless_ppp_ioctl()
182 if (put_user(network->xaccm[0], user_arg)) in ipwireless_ppp_ioctl()
188 if (get_user(network->xaccm[0], user_arg)) in ipwireless_ppp_ioctl()
194 if (put_user(network->raccm, user_arg)) in ipwireless_ppp_ioctl()
200 if (get_user(network->raccm, user_arg)) in ipwireless_ppp_ioctl()
206 if (copy_to_user((void __user *) arg, network->xaccm, in ipwireless_ppp_ioctl()
207 sizeof(network->xaccm))) in ipwireless_ppp_ioctl()
217 memcpy(network->xaccm, accm, sizeof(network->xaccm)); in ipwireless_ppp_ioctl()
222 if (put_user(network->mru, user_arg)) in ipwireless_ppp_ioctl()
232 network->mru = val; in ipwireless_ppp_ioctl()
250 struct ipw_network *network = in do_go_online() local
255 spin_lock_irqsave(&network->lock, flags); in do_go_online()
256 if (!network->ppp_channel) { in do_go_online()
259 spin_unlock_irqrestore(&network->lock, flags); in do_go_online()
266 channel->private = network; in do_go_online()
271 network->flags = 0; in do_go_online()
272 network->rbits = 0; in do_go_online()
273 network->mru = PPP_MRU; in do_go_online()
274 memset(network->xaccm, 0, sizeof(network->xaccm)); in do_go_online()
275 network->xaccm[0] = ~0U; in do_go_online()
276 network->xaccm[3] = 0x60000000U; in do_go_online()
277 network->raccm = ~0U; in do_go_online()
284 spin_lock_irqsave(&network->lock, flags); in do_go_online()
285 network->ppp_channel = channel; in do_go_online()
287 spin_unlock_irqrestore(&network->lock, flags); in do_go_online()
292 struct ipw_network *network = in do_go_offline() local
297 mutex_lock(&network->close_lock); in do_go_offline()
298 spin_lock_irqsave(&network->lock, flags); in do_go_offline()
299 if (network->ppp_channel != NULL) { in do_go_offline()
300 struct ppp_channel *channel = network->ppp_channel; in do_go_offline()
302 network->ppp_channel = NULL; in do_go_offline()
303 spin_unlock_irqrestore(&network->lock, flags); in do_go_offline()
304 mutex_unlock(&network->close_lock); in do_go_offline()
307 spin_unlock_irqrestore(&network->lock, flags); in do_go_offline()
308 mutex_unlock(&network->close_lock); in do_go_offline()
312 void ipwireless_network_notify_control_line_change(struct ipw_network *network, in ipwireless_network_notify_control_line_change() argument
320 network->ras_control_lines = control_lines; in ipwireless_network_notify_control_line_change()
324 network->associated_ttys[channel_idx][i]; in ipwireless_network_notify_control_line_change()
364 void ipwireless_network_packet_received(struct ipw_network *network, in ipwireless_network_packet_received() argument
373 struct ipw_tty *tty = network->associated_ttys[channel_idx][i]; in ipwireless_network_packet_received()
385 && (network->ras_control_lines & in ipwireless_network_packet_received()
393 mutex_lock(&network->close_lock); in ipwireless_network_packet_received()
394 spin_lock_irqsave(&network->lock, flags); in ipwireless_network_packet_received()
395 if (network->ppp_channel != NULL) { in ipwireless_network_packet_received()
398 spin_unlock_irqrestore(&network->lock, in ipwireless_network_packet_received()
404 ppp_input(network->ppp_channel, skb); in ipwireless_network_packet_received()
406 spin_unlock_irqrestore(&network->lock, in ipwireless_network_packet_received()
408 mutex_unlock(&network->close_lock); in ipwireless_network_packet_received()
418 struct ipw_network *network = in ipwireless_network_create() local
421 if (!network) in ipwireless_network_create()
424 spin_lock_init(&network->lock); in ipwireless_network_create()
425 mutex_init(&network->close_lock); in ipwireless_network_create()
427 network->hardware = hw; in ipwireless_network_create()
429 INIT_WORK(&network->work_go_online, do_go_online); in ipwireless_network_create()
430 INIT_WORK(&network->work_go_offline, do_go_offline); in ipwireless_network_create()
432 ipwireless_associate_network(hw, network); in ipwireless_network_create()
434 return network; in ipwireless_network_create()
437 void ipwireless_network_free(struct ipw_network *network) in ipwireless_network_free() argument
439 network->shutting_down = 1; in ipwireless_network_free()
441 ipwireless_ppp_close(network); in ipwireless_network_free()
442 flush_work(&network->work_go_online); in ipwireless_network_free()
443 flush_work(&network->work_go_offline); in ipwireless_network_free()
445 ipwireless_stop_interrupts(network->hardware); in ipwireless_network_free()
446 ipwireless_associate_network(network->hardware, NULL); in ipwireless_network_free()
448 kfree(network); in ipwireless_network_free()
451 void ipwireless_associate_network_tty(struct ipw_network *network, in ipwireless_associate_network_tty() argument
458 if (network->associated_ttys[channel_idx][i] == NULL) { in ipwireless_associate_network_tty()
459 network->associated_ttys[channel_idx][i] = tty; in ipwireless_associate_network_tty()
464 void ipwireless_disassociate_network_ttys(struct ipw_network *network, in ipwireless_disassociate_network_ttys() argument
470 network->associated_ttys[channel_idx][i] = NULL; in ipwireless_disassociate_network_ttys()
473 void ipwireless_ppp_open(struct ipw_network *network) in ipwireless_ppp_open() argument
477 schedule_work(&network->work_go_online); in ipwireless_ppp_open()
480 void ipwireless_ppp_close(struct ipw_network *network) in ipwireless_ppp_close() argument
485 schedule_work(&network->work_go_offline); in ipwireless_ppp_close()
488 int ipwireless_ppp_channel_index(struct ipw_network *network) in ipwireless_ppp_channel_index() argument
493 spin_lock_irqsave(&network->lock, flags); in ipwireless_ppp_channel_index()
494 if (network->ppp_channel != NULL) in ipwireless_ppp_channel_index()
495 ret = ppp_channel_index(network->ppp_channel); in ipwireless_ppp_channel_index()
496 spin_unlock_irqrestore(&network->lock, flags); in ipwireless_ppp_channel_index()
501 int ipwireless_ppp_unit_number(struct ipw_network *network) in ipwireless_ppp_unit_number() argument
506 spin_lock_irqsave(&network->lock, flags); in ipwireless_ppp_unit_number()
507 if (network->ppp_channel != NULL) in ipwireless_ppp_unit_number()
508 ret = ppp_unit_number(network->ppp_channel); in ipwireless_ppp_unit_number()
509 spin_unlock_irqrestore(&network->lock, flags); in ipwireless_ppp_unit_number()
514 int ipwireless_ppp_mru(const struct ipw_network *network) in ipwireless_ppp_mru() argument
516 return network->mru; in ipwireless_ppp_mru()