Commit 63c4dbd1 authored by David Sterba's avatar David Sterba Committed by Linus Torvalds

ipwireless: Rename spinlock variables to lock

ipwireless: Rename spinlock variables to lock
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2e713165
...@@ -242,7 +242,7 @@ struct ipw_hardware { ...@@ -242,7 +242,7 @@ struct ipw_hardware {
unsigned int base_port; unsigned int base_port;
short hw_version; short hw_version;
unsigned short ll_mtu; unsigned short ll_mtu;
spinlock_t spinlock; spinlock_t lock;
int initializing; int initializing;
int init_loops; int init_loops;
...@@ -400,7 +400,7 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data, ...@@ -400,7 +400,7 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data,
if (ipwireless_debug) if (ipwireless_debug)
dump_data_bytes("send", data, length); dump_data_bytes("send", data, length);
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
hw->tx_ready = 0; hw->tx_ready = 0;
...@@ -437,7 +437,7 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data, ...@@ -437,7 +437,7 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data,
writew(MEMRX_RX, &hw->memory_info_regs->memreg_rx); writew(MEMRX_RX, &hw->memory_info_regs->memreg_rx);
} }
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
end_write_timing(length); end_write_timing(length);
...@@ -490,10 +490,10 @@ static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet) ...@@ -490,10 +490,10 @@ static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet)
*/ */
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
list_add(&packet->queue, &hw->tx_queue[0]); list_add(&packet->queue, &hw->tx_queue[0]);
hw->tx_queued++; hw->tx_queued++;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
} else { } else {
if (packet->packet_callback) if (packet->packet_callback)
packet->packet_callback(packet->callback_data, packet->packet_callback(packet->callback_data,
...@@ -508,7 +508,7 @@ static void ipw_setup_hardware(struct ipw_hardware *hw) ...@@ -508,7 +508,7 @@ static void ipw_setup_hardware(struct ipw_hardware *hw)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
if (hw->hw_version == HW_VERSION_1) { if (hw->hw_version == HW_VERSION_1) {
/* Reset RX FIFO */ /* Reset RX FIFO */
outw(DCR_RXRESET, hw->base_port + IODCR); outw(DCR_RXRESET, hw->base_port + IODCR);
...@@ -527,7 +527,7 @@ static void ipw_setup_hardware(struct ipw_hardware *hw) ...@@ -527,7 +527,7 @@ static void ipw_setup_hardware(struct ipw_hardware *hw)
csr |= 1; csr |= 1;
writew(csr, &hw->memregs_CCR->reg_config_and_status); writew(csr, &hw->memregs_CCR->reg_config_and_status);
} }
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
} }
/* /*
...@@ -546,18 +546,18 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw, ...@@ -546,18 +546,18 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw,
if (!packet) { if (!packet) {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
if (!list_empty(&hw->rx_pool)) { if (!list_empty(&hw->rx_pool)) {
packet = list_first_entry(&hw->rx_pool, packet = list_first_entry(&hw->rx_pool,
struct ipw_rx_packet, queue); struct ipw_rx_packet, queue);
list_del(&packet->queue); list_del(&packet->queue);
hw->rx_pool_size--; hw->rx_pool_size--;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
} else { } else {
static int min_capacity = 256; static int min_capacity = 256;
int new_capacity; int new_capacity;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
new_capacity = new_capacity =
(minimum_free_space > min_capacity (minimum_free_space > min_capacity
? minimum_free_space ? minimum_free_space
...@@ -645,9 +645,9 @@ static void queue_received_packet(struct ipw_hardware *hw, ...@@ -645,9 +645,9 @@ static void queue_received_packet(struct ipw_hardware *hw,
packet = *assem; packet = *assem;
*assem = NULL; *assem = NULL;
/* Count queued DATA bytes only */ /* Count queued DATA bytes only */
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
hw->rx_bytes_queued += packet->length; hw->rx_bytes_queued += packet->length;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
} }
} else { } else {
/* If it's a CTRL packet, don't assemble, just queue it. */ /* If it's a CTRL packet, don't assemble, just queue it. */
...@@ -669,13 +669,13 @@ static void queue_received_packet(struct ipw_hardware *hw, ...@@ -669,13 +669,13 @@ static void queue_received_packet(struct ipw_hardware *hw,
* network layer. * network layer.
*/ */
if (packet) { if (packet) {
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
list_add_tail(&packet->queue, &hw->rx_queue); list_add_tail(&packet->queue, &hw->rx_queue);
/* Block reception of incoming packets if queue is full. */ /* Block reception of incoming packets if queue is full. */
hw->blocking_rx = hw->blocking_rx =
(hw->rx_bytes_queued >= IPWIRELESS_RX_QUEUE_SIZE); (hw->rx_bytes_queued >= IPWIRELESS_RX_QUEUE_SIZE);
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
schedule_work(&hw->work_rx); schedule_work(&hw->work_rx);
} }
} }
...@@ -689,7 +689,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) ...@@ -689,7 +689,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx)
container_of(work_rx, struct ipw_hardware, work_rx); container_of(work_rx, struct ipw_hardware, work_rx);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
while (!list_empty(&hw->rx_queue)) { while (!list_empty(&hw->rx_queue)) {
struct ipw_rx_packet *packet = struct ipw_rx_packet *packet =
list_first_entry(&hw->rx_queue, list_first_entry(&hw->rx_queue,
...@@ -707,7 +707,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) ...@@ -707,7 +707,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx)
if (packet->protocol == TL_PROTOCOLID_COM_DATA) { if (packet->protocol == TL_PROTOCOLID_COM_DATA) {
if (hw->network != NULL) { if (hw->network != NULL) {
/* If the network hasn't been disconnected. */ /* If the network hasn't been disconnected. */
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
/* /*
* This must run unlocked due to tty processing * This must run unlocked due to tty processing
* and mutex locking * and mutex locking
...@@ -718,7 +718,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) ...@@ -718,7 +718,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx)
(unsigned char *)packet (unsigned char *)packet
+ sizeof(struct ipw_rx_packet), + sizeof(struct ipw_rx_packet),
packet->length); packet->length);
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
} }
/* Count queued DATA bytes only */ /* Count queued DATA bytes only */
hw->rx_bytes_queued -= packet->length; hw->rx_bytes_queued -= packet->length;
...@@ -742,7 +742,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) ...@@ -742,7 +742,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx)
if (hw->shutting_down) if (hw->shutting_down)
break; break;
} }
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
} }
static void handle_received_CTRL_packet(struct ipw_hardware *hw, static void handle_received_CTRL_packet(struct ipw_hardware *hw,
...@@ -914,17 +914,17 @@ static int get_packets_from_hw(struct ipw_hardware *hw) ...@@ -914,17 +914,17 @@ static int get_packets_from_hw(struct ipw_hardware *hw)
int received = 0; int received = 0;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
while (hw->rx_ready && !hw->blocking_rx) { while (hw->rx_ready && !hw->blocking_rx) {
received = 1; received = 1;
hw->rx_ready--; hw->rx_ready--;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
do_receive_packet(hw); do_receive_packet(hw);
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
} }
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
return received; return received;
} }
...@@ -940,7 +940,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) ...@@ -940,7 +940,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
int more_to_send = 0; int more_to_send = 0;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
if (hw->tx_queued && hw->tx_ready) { if (hw->tx_queued && hw->tx_ready) {
int priority; int priority;
struct ipw_tx_packet *packet = NULL; struct ipw_tx_packet *packet = NULL;
...@@ -961,17 +961,17 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) ...@@ -961,17 +961,17 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
} }
if (!packet) { if (!packet) {
hw->tx_queued = 0; hw->tx_queued = 0;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
return 0; return 0;
} }
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
/* Send */ /* Send */
do_send_packet(hw, packet); do_send_packet(hw, packet);
/* Check if more to send */ /* Check if more to send */
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
for (priority = 0; priority < priority_limit; priority++) for (priority = 0; priority < priority_limit; priority++)
if (!list_empty(&hw->tx_queue[priority])) { if (!list_empty(&hw->tx_queue[priority])) {
more_to_send = 1; more_to_send = 1;
...@@ -981,7 +981,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) ...@@ -981,7 +981,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
if (!more_to_send) if (!more_to_send)
hw->tx_queued = 0; hw->tx_queued = 0;
} }
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
return more_to_send; return more_to_send;
} }
...@@ -994,9 +994,9 @@ static void ipwireless_do_tasklet(unsigned long hw_) ...@@ -994,9 +994,9 @@ static void ipwireless_do_tasklet(unsigned long hw_)
struct ipw_hardware *hw = (struct ipw_hardware *) hw_; struct ipw_hardware *hw = (struct ipw_hardware *) hw_;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
if (hw->shutting_down) { if (hw->shutting_down) {
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
return; return;
} }
...@@ -1005,7 +1005,7 @@ static void ipwireless_do_tasklet(unsigned long hw_) ...@@ -1005,7 +1005,7 @@ static void ipwireless_do_tasklet(unsigned long hw_)
* Initial setup data sent to hardware * Initial setup data sent to hardware
*/ */
hw->to_setup = 2; hw->to_setup = 2;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
ipw_setup_hardware(hw); ipw_setup_hardware(hw);
ipw_send_setup_packet(hw); ipw_send_setup_packet(hw);
...@@ -1016,7 +1016,7 @@ static void ipwireless_do_tasklet(unsigned long hw_) ...@@ -1016,7 +1016,7 @@ static void ipwireless_do_tasklet(unsigned long hw_)
int priority_limit = get_current_packet_priority(hw); int priority_limit = get_current_packet_priority(hw);
int again; int again;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
do { do {
again = send_pending_packet(hw, priority_limit); again = send_pending_packet(hw, priority_limit);
...@@ -1054,16 +1054,16 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq, ...@@ -1054,16 +1054,16 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq,
/* Transmit complete. */ /* Transmit complete. */
if (irqn & IR_TXINTR) { if (irqn & IR_TXINTR) {
ack |= IR_TXINTR; ack |= IR_TXINTR;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
hw->tx_ready = 1; hw->tx_ready = 1;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
} }
/* Received data */ /* Received data */
if (irqn & IR_RXINTR) { if (irqn & IR_RXINTR) {
ack |= IR_RXINTR; ack |= IR_RXINTR;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
hw->rx_ready++; hw->rx_ready++;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
} }
if (ack != 0) { if (ack != 0) {
outw(ack, hw->base_port + IOIR); outw(ack, hw->base_port + IOIR);
...@@ -1134,9 +1134,9 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, ...@@ -1134,9 +1134,9 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq,
if (hw->serial_number_detected) { if (hw->serial_number_detected) {
if (memtx_serial != hw->last_memtx_serial) { if (memtx_serial != hw->last_memtx_serial) {
hw->last_memtx_serial = memtx_serial; hw->last_memtx_serial = memtx_serial;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
hw->rx_ready++; hw->rx_ready++;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
rx = 1; rx = 1;
} else } else
/* Ignore 'Timer Recovery' duplicates. */ /* Ignore 'Timer Recovery' duplicates. */
...@@ -1151,18 +1151,18 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, ...@@ -1151,18 +1151,18 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq,
printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME
": memreg_tx serial num detected\n"); ": memreg_tx serial num detected\n");
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
hw->rx_ready++; hw->rx_ready++;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
} }
rx = 1; rx = 1;
} }
} }
if (memrxdone & MEMRX_RX_DONE) { if (memrxdone & MEMRX_RX_DONE) {
writew(0, &hw->memory_info_regs->memreg_rx_done); writew(0, &hw->memory_info_regs->memreg_rx_done);
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
hw->tx_ready = 1; hw->tx_ready = 1;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
tx = 1; tx = 1;
} }
if (tx) if (tx)
...@@ -1211,9 +1211,9 @@ static void flush_packets_to_hw(struct ipw_hardware *hw) ...@@ -1211,9 +1211,9 @@ static void flush_packets_to_hw(struct ipw_hardware *hw)
int priority_limit; int priority_limit;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
priority_limit = get_current_packet_priority(hw); priority_limit = get_current_packet_priority(hw);
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
while (send_pending_packet(hw, priority_limit)); while (send_pending_packet(hw, priority_limit));
} }
...@@ -1223,10 +1223,10 @@ static void send_packet(struct ipw_hardware *hw, int priority, ...@@ -1223,10 +1223,10 @@ static void send_packet(struct ipw_hardware *hw, int priority,
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
list_add_tail(&packet->queue, &hw->tx_queue[priority]); list_add_tail(&packet->queue, &hw->tx_queue[priority]);
hw->tx_queued++; hw->tx_queued++;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
flush_packets_to_hw(hw); flush_packets_to_hw(hw);
} }
...@@ -1612,7 +1612,7 @@ struct ipw_hardware *ipwireless_hardware_create(void) ...@@ -1612,7 +1612,7 @@ struct ipw_hardware *ipwireless_hardware_create(void)
INIT_LIST_HEAD(&hw->rx_queue); INIT_LIST_HEAD(&hw->rx_queue);
INIT_LIST_HEAD(&hw->rx_pool); INIT_LIST_HEAD(&hw->rx_pool);
spin_lock_init(&hw->spinlock); spin_lock_init(&hw->lock);
tasklet_init(&hw->tasklet, ipwireless_do_tasklet, (unsigned long) hw); tasklet_init(&hw->tasklet, ipwireless_do_tasklet, (unsigned long) hw);
INIT_WORK(&hw->work_rx, ipw_receive_data_work); INIT_WORK(&hw->work_rx, ipw_receive_data_work);
setup_timer(&hw->setup_timer, ipwireless_setup_timer, setup_timer(&hw->setup_timer, ipwireless_setup_timer,
...@@ -1678,10 +1678,10 @@ static void ipwireless_setup_timer(unsigned long data) ...@@ -1678,10 +1678,10 @@ static void ipwireless_setup_timer(unsigned long data)
if (is_card_present(hw)) { if (is_card_present(hw)) {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&hw->spinlock, flags); spin_lock_irqsave(&hw->lock, flags);
hw->to_setup = 1; hw->to_setup = 1;
hw->tx_ready = 1; hw->tx_ready = 1;
spin_unlock_irqrestore(&hw->spinlock, flags); spin_unlock_irqrestore(&hw->lock, flags);
tasklet_schedule(&hw->tasklet); tasklet_schedule(&hw->tasklet);
} }
......
...@@ -45,7 +45,7 @@ struct ipw_network { ...@@ -45,7 +45,7 @@ struct ipw_network {
/* Number of packets queued up in hardware module. */ /* Number of packets queued up in hardware module. */
int outgoing_packets_queued; int outgoing_packets_queued;
/* Spinlock to avoid interrupts during shutdown */ /* Spinlock to avoid interrupts during shutdown */
spinlock_t spinlock; spinlock_t lock;
struct mutex close_lock; struct mutex close_lock;
/* PPP ioctl data, not actually used anywere */ /* PPP ioctl data, not actually used anywere */
...@@ -67,20 +67,20 @@ static void notify_packet_sent(void *callback_data, unsigned int packet_length) ...@@ -67,20 +67,20 @@ static void notify_packet_sent(void *callback_data, unsigned int packet_length)
struct ipw_network *network = callback_data; struct ipw_network *network = callback_data;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&network->spinlock, flags); spin_lock_irqsave(&network->lock, flags);
network->outgoing_packets_queued--; network->outgoing_packets_queued--;
if (network->ppp_channel != NULL) { if (network->ppp_channel != NULL) {
if (network->ppp_blocked) { if (network->ppp_blocked) {
network->ppp_blocked = 0; network->ppp_blocked = 0;
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
ppp_output_wakeup(network->ppp_channel); ppp_output_wakeup(network->ppp_channel);
if (ipwireless_debug) if (ipwireless_debug)
printk(KERN_INFO IPWIRELESS_PCCARD_NAME printk(KERN_INFO IPWIRELESS_PCCARD_NAME
": ppp unblocked\n"); ": ppp unblocked\n");
} else } else
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
} else } else
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
} }
/* /*
...@@ -92,7 +92,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, ...@@ -92,7 +92,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel,
struct ipw_network *network = ppp_channel->private; struct ipw_network *network = ppp_channel->private;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&network->spinlock, flags); spin_lock_irqsave(&network->lock, flags);
if (network->outgoing_packets_queued < ipwireless_out_queue) { if (network->outgoing_packets_queued < ipwireless_out_queue) {
unsigned char *buf; unsigned char *buf;
static unsigned char header[] = { static unsigned char header[] = {
...@@ -102,7 +102,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, ...@@ -102,7 +102,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel,
int ret; int ret;
network->outgoing_packets_queued++; network->outgoing_packets_queued++;
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
/* /*
* If we have the requested amount of headroom in the skb we * 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,7 +143,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel,
* needs to be unblocked once we are ready to send. * needs to be unblocked once we are ready to send.
*/ */
network->ppp_blocked = 1; network->ppp_blocked = 1;
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
return 0; return 0;
} }
} }
...@@ -248,11 +248,11 @@ static void do_go_online(struct work_struct *work_go_online) ...@@ -248,11 +248,11 @@ static void do_go_online(struct work_struct *work_go_online)
work_go_online); work_go_online);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&network->spinlock, flags); spin_lock_irqsave(&network->lock, flags);
if (!network->ppp_channel) { if (!network->ppp_channel) {
struct ppp_channel *channel; struct ppp_channel *channel;
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
channel = kzalloc(sizeof(struct ppp_channel), GFP_KERNEL); channel = kzalloc(sizeof(struct ppp_channel), GFP_KERNEL);
if (!channel) { if (!channel) {
printk(KERN_ERR IPWIRELESS_PCCARD_NAME printk(KERN_ERR IPWIRELESS_PCCARD_NAME
...@@ -272,10 +272,10 @@ static void do_go_online(struct work_struct *work_go_online) ...@@ -272,10 +272,10 @@ static void do_go_online(struct work_struct *work_go_online)
network->xaccm[3] = 0x60000000U; network->xaccm[3] = 0x60000000U;
network->raccm = ~0U; network->raccm = ~0U;
ppp_register_channel(channel); ppp_register_channel(channel);
spin_lock_irqsave(&network->spinlock, flags); spin_lock_irqsave(&network->lock, flags);
network->ppp_channel = channel; network->ppp_channel = channel;
} }
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
} }
static void do_go_offline(struct work_struct *work_go_offline) 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,16 +286,16 @@ static void do_go_offline(struct work_struct *work_go_offline)
unsigned long flags; unsigned long flags;
mutex_lock(&network->close_lock); mutex_lock(&network->close_lock);
spin_lock_irqsave(&network->spinlock, flags); spin_lock_irqsave(&network->lock, flags);
if (network->ppp_channel != NULL) { if (network->ppp_channel != NULL) {
struct ppp_channel *channel = network->ppp_channel; struct ppp_channel *channel = network->ppp_channel;
network->ppp_channel = NULL; network->ppp_channel = NULL;
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
mutex_unlock(&network->close_lock); mutex_unlock(&network->close_lock);
ppp_unregister_channel(channel); ppp_unregister_channel(channel);
} else { } else {
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
mutex_unlock(&network->close_lock); mutex_unlock(&network->close_lock);
} }
} }
...@@ -380,18 +380,18 @@ void ipwireless_network_packet_received(struct ipw_network *network, ...@@ -380,18 +380,18 @@ void ipwireless_network_packet_received(struct ipw_network *network,
* the PPP layer. * the PPP layer.
*/ */
mutex_lock(&network->close_lock); mutex_lock(&network->close_lock);
spin_lock_irqsave(&network->spinlock, flags); spin_lock_irqsave(&network->lock, flags);
if (network->ppp_channel != NULL) { if (network->ppp_channel != NULL) {
struct sk_buff *skb; struct sk_buff *skb;
spin_unlock_irqrestore(&network->spinlock, spin_unlock_irqrestore(&network->lock,
flags); flags);
/* Send the data to the ppp_generic module. */ /* Send the data to the ppp_generic module. */
skb = ipw_packet_received_skb(data, length); skb = ipw_packet_received_skb(data, length);
ppp_input(network->ppp_channel, skb); ppp_input(network->ppp_channel, skb);
} else } else
spin_unlock_irqrestore(&network->spinlock, spin_unlock_irqrestore(&network->lock,
flags); flags);
mutex_unlock(&network->close_lock); mutex_unlock(&network->close_lock);
} }
...@@ -409,7 +409,7 @@ struct ipw_network *ipwireless_network_create(struct ipw_hardware *hw) ...@@ -409,7 +409,7 @@ struct ipw_network *ipwireless_network_create(struct ipw_hardware *hw)
if (!network) if (!network)
return NULL; return NULL;
spin_lock_init(&network->spinlock); spin_lock_init(&network->lock);
mutex_init(&network->close_lock); mutex_init(&network->close_lock);
network->hardware = hw; network->hardware = hw;
...@@ -477,10 +477,10 @@ int ipwireless_ppp_channel_index(struct ipw_network *network) ...@@ -477,10 +477,10 @@ int ipwireless_ppp_channel_index(struct ipw_network *network)
int ret = -1; int ret = -1;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&network->spinlock, flags); spin_lock_irqsave(&network->lock, flags);
if (network->ppp_channel != NULL) if (network->ppp_channel != NULL)
ret = ppp_channel_index(network->ppp_channel); ret = ppp_channel_index(network->ppp_channel);
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
return ret; return ret;
} }
...@@ -490,10 +490,10 @@ int ipwireless_ppp_unit_number(struct ipw_network *network) ...@@ -490,10 +490,10 @@ int ipwireless_ppp_unit_number(struct ipw_network *network)
int ret = -1; int ret = -1;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&network->spinlock, flags); spin_lock_irqsave(&network->lock, flags);
if (network->ppp_channel != NULL) if (network->ppp_channel != NULL)
ret = ppp_unit_number(network->ppp_channel); ret = ppp_unit_number(network->ppp_channel);
spin_unlock_irqrestore(&network->spinlock, flags); spin_unlock_irqrestore(&network->lock, flags);
return ret; return ret;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment