diff options
Diffstat (limited to 'drivers/char/pcmcia/ipwireless/network.c')
| -rw-r--r-- | drivers/char/pcmcia/ipwireless/network.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/char/pcmcia/ipwireless/network.c b/drivers/char/pcmcia/ipwireless/network.c index cf12eb400f93..28d9fd727d84 100644 --- a/drivers/char/pcmcia/ipwireless/network.c +++ b/drivers/char/pcmcia/ipwireless/network.c | |||
| @@ -45,7 +45,7 @@ struct ipw_network { | |||
| 45 | /* Number of packets queued up in hardware module. */ | 45 | /* Number of packets queued up in hardware module. */ |
| 46 | int outgoing_packets_queued; | 46 | int outgoing_packets_queued; |
| 47 | /* Spinlock to avoid interrupts during shutdown */ | 47 | /* Spinlock to avoid interrupts during shutdown */ |
| 48 | spinlock_t spinlock; | 48 | spinlock_t lock; |
| 49 | struct mutex close_lock; | 49 | struct mutex close_lock; |
| 50 | 50 | ||
| 51 | /* PPP ioctl data, not actually used anywere */ | 51 | /* PPP ioctl data, not actually used anywere */ |
| @@ -67,20 +67,20 @@ static void notify_packet_sent(void *callback_data, unsigned int packet_length) | |||
| 67 | struct ipw_network *network = callback_data; | 67 | struct ipw_network *network = callback_data; |
| 68 | unsigned long flags; | 68 | unsigned long flags; |
| 69 | 69 | ||
| 70 | spin_lock_irqsave(&network->spinlock, flags); | 70 | spin_lock_irqsave(&network->lock, flags); |
| 71 | network->outgoing_packets_queued--; | 71 | network->outgoing_packets_queued--; |
| 72 | if (network->ppp_channel != NULL) { | 72 | if (network->ppp_channel != NULL) { |
| 73 | if (network->ppp_blocked) { | 73 | if (network->ppp_blocked) { |
| 74 | network->ppp_blocked = 0; | 74 | network->ppp_blocked = 0; |
| 75 | spin_unlock_irqrestore(&network->spinlock, flags); | 75 | spin_unlock_irqrestore(&network->lock, flags); |
| 76 | ppp_output_wakeup(network->ppp_channel); | 76 | ppp_output_wakeup(network->ppp_channel); |
| 77 | if (ipwireless_debug) | 77 | if (ipwireless_debug) |
| 78 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME | 78 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME |
| 79 | ": ppp unblocked\n"); | 79 | ": ppp unblocked\n"); |
| 80 | } else | 80 | } else |
| 81 | spin_unlock_irqrestore(&network->spinlock, flags); | 81 | spin_unlock_irqrestore(&network->lock, flags); |
| 82 | } else | 82 | } else |
| 83 | spin_unlock_irqrestore(&network->spinlock, flags); | 83 | spin_unlock_irqrestore(&network->lock, flags); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | /* | 86 | /* |
| @@ -92,7 +92,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, | |||
| 92 | struct ipw_network *network = ppp_channel->private; | 92 | struct ipw_network *network = ppp_channel->private; |
| 93 | unsigned long flags; | 93 | unsigned long flags; |
| 94 | 94 | ||
| 95 | spin_lock_irqsave(&network->spinlock, flags); | 95 | spin_lock_irqsave(&network->lock, flags); |
| 96 | if (network->outgoing_packets_queued < ipwireless_out_queue) { | 96 | if (network->outgoing_packets_queued < ipwireless_out_queue) { |
| 97 | unsigned char *buf; | 97 | unsigned char *buf; |
| 98 | static unsigned char header[] = { | 98 | static unsigned char header[] = { |
| @@ -102,7 +102,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, | |||
| 102 | int ret; | 102 | int ret; |
| 103 | 103 | ||
| 104 | network->outgoing_packets_queued++; | 104 | network->outgoing_packets_queued++; |
| 105 | spin_unlock_irqrestore(&network->spinlock, flags); | 105 | spin_unlock_irqrestore(&network->lock, flags); |
| 106 | 106 | ||
| 107 | /* | 107 | /* |
| 108 | * If we have the requested amount of headroom in the skb we | 108 | * If we have the requested amount of headroom in the skb we |
| @@ -143,7 +143,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, | |||
| 143 | * needs to be unblocked once we are ready to send. | 143 | * needs to be unblocked once we are ready to send. |
| 144 | */ | 144 | */ |
| 145 | network->ppp_blocked = 1; | 145 | network->ppp_blocked = 1; |
| 146 | spin_unlock_irqrestore(&network->spinlock, flags); | 146 | spin_unlock_irqrestore(&network->lock, flags); |
| 147 | return 0; | 147 | return 0; |
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| @@ -248,11 +248,11 @@ static void do_go_online(struct work_struct *work_go_online) | |||
| 248 | work_go_online); | 248 | work_go_online); |
| 249 | unsigned long flags; | 249 | unsigned long flags; |
| 250 | 250 | ||
| 251 | spin_lock_irqsave(&network->spinlock, flags); | 251 | spin_lock_irqsave(&network->lock, flags); |
| 252 | if (!network->ppp_channel) { | 252 | if (!network->ppp_channel) { |
| 253 | struct ppp_channel *channel; | 253 | struct ppp_channel *channel; |
| 254 | 254 | ||
| 255 | spin_unlock_irqrestore(&network->spinlock, flags); | 255 | spin_unlock_irqrestore(&network->lock, flags); |
| 256 | channel = kzalloc(sizeof(struct ppp_channel), GFP_KERNEL); | 256 | channel = kzalloc(sizeof(struct ppp_channel), GFP_KERNEL); |
| 257 | if (!channel) { | 257 | if (!channel) { |
| 258 | printk(KERN_ERR IPWIRELESS_PCCARD_NAME | 258 | printk(KERN_ERR IPWIRELESS_PCCARD_NAME |
| @@ -272,10 +272,10 @@ static void do_go_online(struct work_struct *work_go_online) | |||
| 272 | network->xaccm[3] = 0x60000000U; | 272 | network->xaccm[3] = 0x60000000U; |
| 273 | network->raccm = ~0U; | 273 | network->raccm = ~0U; |
| 274 | ppp_register_channel(channel); | 274 | ppp_register_channel(channel); |
| 275 | spin_lock_irqsave(&network->spinlock, flags); | 275 | spin_lock_irqsave(&network->lock, flags); |
| 276 | network->ppp_channel = channel; | 276 | network->ppp_channel = channel; |
| 277 | } | 277 | } |
| 278 | spin_unlock_irqrestore(&network->spinlock, flags); | 278 | spin_unlock_irqrestore(&network->lock, flags); |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | static void do_go_offline(struct work_struct *work_go_offline) | 281 | static void do_go_offline(struct work_struct *work_go_offline) |
| @@ -286,16 +286,16 @@ static void do_go_offline(struct work_struct *work_go_offline) | |||
| 286 | unsigned long flags; | 286 | unsigned long flags; |
| 287 | 287 | ||
| 288 | mutex_lock(&network->close_lock); | 288 | mutex_lock(&network->close_lock); |
| 289 | spin_lock_irqsave(&network->spinlock, flags); | 289 | spin_lock_irqsave(&network->lock, flags); |
| 290 | if (network->ppp_channel != NULL) { | 290 | if (network->ppp_channel != NULL) { |
| 291 | struct ppp_channel *channel = network->ppp_channel; | 291 | struct ppp_channel *channel = network->ppp_channel; |
| 292 | 292 | ||
| 293 | network->ppp_channel = NULL; | 293 | network->ppp_channel = NULL; |
| 294 | spin_unlock_irqrestore(&network->spinlock, flags); | 294 | spin_unlock_irqrestore(&network->lock, flags); |
| 295 | mutex_unlock(&network->close_lock); | 295 | mutex_unlock(&network->close_lock); |
| 296 | ppp_unregister_channel(channel); | 296 | ppp_unregister_channel(channel); |
| 297 | } else { | 297 | } else { |
| 298 | spin_unlock_irqrestore(&network->spinlock, flags); | 298 | spin_unlock_irqrestore(&network->lock, flags); |
| 299 | mutex_unlock(&network->close_lock); | 299 | mutex_unlock(&network->close_lock); |
| 300 | } | 300 | } |
| 301 | } | 301 | } |
| @@ -380,18 +380,18 @@ void ipwireless_network_packet_received(struct ipw_network *network, | |||
| 380 | * the PPP layer. | 380 | * the PPP layer. |
| 381 | */ | 381 | */ |
| 382 | mutex_lock(&network->close_lock); | 382 | mutex_lock(&network->close_lock); |
| 383 | spin_lock_irqsave(&network->spinlock, flags); | 383 | spin_lock_irqsave(&network->lock, flags); |
| 384 | if (network->ppp_channel != NULL) { | 384 | if (network->ppp_channel != NULL) { |
| 385 | struct sk_buff *skb; | 385 | struct sk_buff *skb; |
| 386 | 386 | ||
| 387 | spin_unlock_irqrestore(&network->spinlock, | 387 | spin_unlock_irqrestore(&network->lock, |
| 388 | flags); | 388 | flags); |
| 389 | 389 | ||
| 390 | /* Send the data to the ppp_generic module. */ | 390 | /* Send the data to the ppp_generic module. */ |
| 391 | skb = ipw_packet_received_skb(data, length); | 391 | skb = ipw_packet_received_skb(data, length); |
| 392 | ppp_input(network->ppp_channel, skb); | 392 | ppp_input(network->ppp_channel, skb); |
| 393 | } else | 393 | } else |
| 394 | spin_unlock_irqrestore(&network->spinlock, | 394 | spin_unlock_irqrestore(&network->lock, |
| 395 | flags); | 395 | flags); |
| 396 | mutex_unlock(&network->close_lock); | 396 | mutex_unlock(&network->close_lock); |
| 397 | } | 397 | } |
| @@ -409,7 +409,7 @@ struct ipw_network *ipwireless_network_create(struct ipw_hardware *hw) | |||
| 409 | if (!network) | 409 | if (!network) |
| 410 | return NULL; | 410 | return NULL; |
| 411 | 411 | ||
| 412 | spin_lock_init(&network->spinlock); | 412 | spin_lock_init(&network->lock); |
| 413 | mutex_init(&network->close_lock); | 413 | mutex_init(&network->close_lock); |
| 414 | 414 | ||
| 415 | network->hardware = hw; | 415 | network->hardware = hw; |
| @@ -477,10 +477,10 @@ int ipwireless_ppp_channel_index(struct ipw_network *network) | |||
| 477 | int ret = -1; | 477 | int ret = -1; |
| 478 | unsigned long flags; | 478 | unsigned long flags; |
| 479 | 479 | ||
| 480 | spin_lock_irqsave(&network->spinlock, flags); | 480 | spin_lock_irqsave(&network->lock, flags); |
| 481 | if (network->ppp_channel != NULL) | 481 | if (network->ppp_channel != NULL) |
| 482 | ret = ppp_channel_index(network->ppp_channel); | 482 | ret = ppp_channel_index(network->ppp_channel); |
| 483 | spin_unlock_irqrestore(&network->spinlock, flags); | 483 | spin_unlock_irqrestore(&network->lock, flags); |
| 484 | 484 | ||
| 485 | return ret; | 485 | return ret; |
| 486 | } | 486 | } |
| @@ -490,10 +490,10 @@ int ipwireless_ppp_unit_number(struct ipw_network *network) | |||
| 490 | int ret = -1; | 490 | int ret = -1; |
| 491 | unsigned long flags; | 491 | unsigned long flags; |
| 492 | 492 | ||
| 493 | spin_lock_irqsave(&network->spinlock, flags); | 493 | spin_lock_irqsave(&network->lock, flags); |
| 494 | if (network->ppp_channel != NULL) | 494 | if (network->ppp_channel != NULL) |
| 495 | ret = ppp_unit_number(network->ppp_channel); | 495 | ret = ppp_unit_number(network->ppp_channel); |
| 496 | spin_unlock_irqrestore(&network->spinlock, flags); | 496 | spin_unlock_irqrestore(&network->lock, flags); |
| 497 | 497 | ||
| 498 | return ret; | 498 | return ret; |
| 499 | } | 499 | } |
