diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/pcmcia/ipwireless/hardware.c | 96 | ||||
-rw-r--r-- | drivers/char/pcmcia/ipwireless/network.c | 46 |
2 files changed, 71 insertions, 71 deletions
diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c index ce57a7f92e8b..f948791c929d 100644 --- a/drivers/char/pcmcia/ipwireless/hardware.c +++ b/drivers/char/pcmcia/ipwireless/hardware.c | |||
@@ -242,7 +242,7 @@ struct ipw_hardware { | |||
242 | unsigned int base_port; | 242 | unsigned int base_port; |
243 | short hw_version; | 243 | short hw_version; |
244 | unsigned short ll_mtu; | 244 | unsigned short ll_mtu; |
245 | spinlock_t spinlock; | 245 | spinlock_t lock; |
246 | 246 | ||
247 | int initializing; | 247 | int initializing; |
248 | int init_loops; | 248 | int init_loops; |
@@ -400,7 +400,7 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data, | |||
400 | if (ipwireless_debug) | 400 | if (ipwireless_debug) |
401 | dump_data_bytes("send", data, length); | 401 | dump_data_bytes("send", data, length); |
402 | 402 | ||
403 | spin_lock_irqsave(&hw->spinlock, flags); | 403 | spin_lock_irqsave(&hw->lock, flags); |
404 | 404 | ||
405 | hw->tx_ready = 0; | 405 | hw->tx_ready = 0; |
406 | 406 | ||
@@ -437,7 +437,7 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data, | |||
437 | writew(MEMRX_RX, &hw->memory_info_regs->memreg_rx); | 437 | writew(MEMRX_RX, &hw->memory_info_regs->memreg_rx); |
438 | } | 438 | } |
439 | 439 | ||
440 | spin_unlock_irqrestore(&hw->spinlock, flags); | 440 | spin_unlock_irqrestore(&hw->lock, flags); |
441 | 441 | ||
442 | end_write_timing(length); | 442 | end_write_timing(length); |
443 | 443 | ||
@@ -490,10 +490,10 @@ static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet) | |||
490 | */ | 490 | */ |
491 | unsigned long flags; | 491 | unsigned long flags; |
492 | 492 | ||
493 | spin_lock_irqsave(&hw->spinlock, flags); | 493 | spin_lock_irqsave(&hw->lock, flags); |
494 | list_add(&packet->queue, &hw->tx_queue[0]); | 494 | list_add(&packet->queue, &hw->tx_queue[0]); |
495 | hw->tx_queued++; | 495 | hw->tx_queued++; |
496 | spin_unlock_irqrestore(&hw->spinlock, flags); | 496 | spin_unlock_irqrestore(&hw->lock, flags); |
497 | } else { | 497 | } else { |
498 | if (packet->packet_callback) | 498 | if (packet->packet_callback) |
499 | packet->packet_callback(packet->callback_data, | 499 | packet->packet_callback(packet->callback_data, |
@@ -508,7 +508,7 @@ static void ipw_setup_hardware(struct ipw_hardware *hw) | |||
508 | { | 508 | { |
509 | unsigned long flags; | 509 | unsigned long flags; |
510 | 510 | ||
511 | spin_lock_irqsave(&hw->spinlock, flags); | 511 | spin_lock_irqsave(&hw->lock, flags); |
512 | if (hw->hw_version == HW_VERSION_1) { | 512 | if (hw->hw_version == HW_VERSION_1) { |
513 | /* Reset RX FIFO */ | 513 | /* Reset RX FIFO */ |
514 | outw(DCR_RXRESET, hw->base_port + IODCR); | 514 | outw(DCR_RXRESET, hw->base_port + IODCR); |
@@ -527,7 +527,7 @@ static void ipw_setup_hardware(struct ipw_hardware *hw) | |||
527 | csr |= 1; | 527 | csr |= 1; |
528 | writew(csr, &hw->memregs_CCR->reg_config_and_status); | 528 | writew(csr, &hw->memregs_CCR->reg_config_and_status); |
529 | } | 529 | } |
530 | spin_unlock_irqrestore(&hw->spinlock, flags); | 530 | spin_unlock_irqrestore(&hw->lock, flags); |
531 | } | 531 | } |
532 | 532 | ||
533 | /* | 533 | /* |
@@ -546,18 +546,18 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw, | |||
546 | if (!packet) { | 546 | if (!packet) { |
547 | unsigned long flags; | 547 | unsigned long flags; |
548 | 548 | ||
549 | spin_lock_irqsave(&hw->spinlock, flags); | 549 | spin_lock_irqsave(&hw->lock, flags); |
550 | if (!list_empty(&hw->rx_pool)) { | 550 | if (!list_empty(&hw->rx_pool)) { |
551 | packet = list_first_entry(&hw->rx_pool, | 551 | packet = list_first_entry(&hw->rx_pool, |
552 | struct ipw_rx_packet, queue); | 552 | struct ipw_rx_packet, queue); |
553 | list_del(&packet->queue); | 553 | list_del(&packet->queue); |
554 | hw->rx_pool_size--; | 554 | hw->rx_pool_size--; |
555 | spin_unlock_irqrestore(&hw->spinlock, flags); | 555 | spin_unlock_irqrestore(&hw->lock, flags); |
556 | } else { | 556 | } else { |
557 | static int min_capacity = 256; | 557 | static int min_capacity = 256; |
558 | int new_capacity; | 558 | int new_capacity; |
559 | 559 | ||
560 | spin_unlock_irqrestore(&hw->spinlock, flags); | 560 | spin_unlock_irqrestore(&hw->lock, flags); |
561 | new_capacity = | 561 | new_capacity = |
562 | (minimum_free_space > min_capacity | 562 | (minimum_free_space > min_capacity |
563 | ? minimum_free_space | 563 | ? minimum_free_space |
@@ -645,9 +645,9 @@ static void queue_received_packet(struct ipw_hardware *hw, | |||
645 | packet = *assem; | 645 | packet = *assem; |
646 | *assem = NULL; | 646 | *assem = NULL; |
647 | /* Count queued DATA bytes only */ | 647 | /* Count queued DATA bytes only */ |
648 | spin_lock_irqsave(&hw->spinlock, flags); | 648 | spin_lock_irqsave(&hw->lock, flags); |
649 | hw->rx_bytes_queued += packet->length; | 649 | hw->rx_bytes_queued += packet->length; |
650 | spin_unlock_irqrestore(&hw->spinlock, flags); | 650 | spin_unlock_irqrestore(&hw->lock, flags); |
651 | } | 651 | } |
652 | } else { | 652 | } else { |
653 | /* If it's a CTRL packet, don't assemble, just queue it. */ | 653 | /* 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 | * network layer. | 669 | * network layer. |
670 | */ | 670 | */ |
671 | if (packet) { | 671 | if (packet) { |
672 | spin_lock_irqsave(&hw->spinlock, flags); | 672 | spin_lock_irqsave(&hw->lock, flags); |
673 | list_add_tail(&packet->queue, &hw->rx_queue); | 673 | list_add_tail(&packet->queue, &hw->rx_queue); |
674 | /* Block reception of incoming packets if queue is full. */ | 674 | /* Block reception of incoming packets if queue is full. */ |
675 | hw->blocking_rx = | 675 | hw->blocking_rx = |
676 | (hw->rx_bytes_queued >= IPWIRELESS_RX_QUEUE_SIZE); | 676 | (hw->rx_bytes_queued >= IPWIRELESS_RX_QUEUE_SIZE); |
677 | 677 | ||
678 | spin_unlock_irqrestore(&hw->spinlock, flags); | 678 | spin_unlock_irqrestore(&hw->lock, flags); |
679 | schedule_work(&hw->work_rx); | 679 | schedule_work(&hw->work_rx); |
680 | } | 680 | } |
681 | } | 681 | } |
@@ -689,7 +689,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) | |||
689 | container_of(work_rx, struct ipw_hardware, work_rx); | 689 | container_of(work_rx, struct ipw_hardware, work_rx); |
690 | unsigned long flags; | 690 | unsigned long flags; |
691 | 691 | ||
692 | spin_lock_irqsave(&hw->spinlock, flags); | 692 | spin_lock_irqsave(&hw->lock, flags); |
693 | while (!list_empty(&hw->rx_queue)) { | 693 | while (!list_empty(&hw->rx_queue)) { |
694 | struct ipw_rx_packet *packet = | 694 | struct ipw_rx_packet *packet = |
695 | list_first_entry(&hw->rx_queue, | 695 | list_first_entry(&hw->rx_queue, |
@@ -707,7 +707,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) | |||
707 | if (packet->protocol == TL_PROTOCOLID_COM_DATA) { | 707 | if (packet->protocol == TL_PROTOCOLID_COM_DATA) { |
708 | if (hw->network != NULL) { | 708 | if (hw->network != NULL) { |
709 | /* If the network hasn't been disconnected. */ | 709 | /* If the network hasn't been disconnected. */ |
710 | spin_unlock_irqrestore(&hw->spinlock, flags); | 710 | spin_unlock_irqrestore(&hw->lock, flags); |
711 | /* | 711 | /* |
712 | * This must run unlocked due to tty processing | 712 | * This must run unlocked due to tty processing |
713 | * and mutex locking | 713 | * and mutex locking |
@@ -718,7 +718,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) | |||
718 | (unsigned char *)packet | 718 | (unsigned char *)packet |
719 | + sizeof(struct ipw_rx_packet), | 719 | + sizeof(struct ipw_rx_packet), |
720 | packet->length); | 720 | packet->length); |
721 | spin_lock_irqsave(&hw->spinlock, flags); | 721 | spin_lock_irqsave(&hw->lock, flags); |
722 | } | 722 | } |
723 | /* Count queued DATA bytes only */ | 723 | /* Count queued DATA bytes only */ |
724 | hw->rx_bytes_queued -= packet->length; | 724 | hw->rx_bytes_queued -= packet->length; |
@@ -742,7 +742,7 @@ static void ipw_receive_data_work(struct work_struct *work_rx) | |||
742 | if (hw->shutting_down) | 742 | if (hw->shutting_down) |
743 | break; | 743 | break; |
744 | } | 744 | } |
745 | spin_unlock_irqrestore(&hw->spinlock, flags); | 745 | spin_unlock_irqrestore(&hw->lock, flags); |
746 | } | 746 | } |
747 | 747 | ||
748 | static void handle_received_CTRL_packet(struct ipw_hardware *hw, | 748 | 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 | int received = 0; | 914 | int received = 0; |
915 | unsigned long flags; | 915 | unsigned long flags; |
916 | 916 | ||
917 | spin_lock_irqsave(&hw->spinlock, flags); | 917 | spin_lock_irqsave(&hw->lock, flags); |
918 | while (hw->rx_ready && !hw->blocking_rx) { | 918 | while (hw->rx_ready && !hw->blocking_rx) { |
919 | received = 1; | 919 | received = 1; |
920 | hw->rx_ready--; | 920 | hw->rx_ready--; |
921 | spin_unlock_irqrestore(&hw->spinlock, flags); | 921 | spin_unlock_irqrestore(&hw->lock, flags); |
922 | 922 | ||
923 | do_receive_packet(hw); | 923 | do_receive_packet(hw); |
924 | 924 | ||
925 | spin_lock_irqsave(&hw->spinlock, flags); | 925 | spin_lock_irqsave(&hw->lock, flags); |
926 | } | 926 | } |
927 | spin_unlock_irqrestore(&hw->spinlock, flags); | 927 | spin_unlock_irqrestore(&hw->lock, flags); |
928 | 928 | ||
929 | return received; | 929 | return received; |
930 | } | 930 | } |
@@ -940,7 +940,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) | |||
940 | int more_to_send = 0; | 940 | int more_to_send = 0; |
941 | unsigned long flags; | 941 | unsigned long flags; |
942 | 942 | ||
943 | spin_lock_irqsave(&hw->spinlock, flags); | 943 | spin_lock_irqsave(&hw->lock, flags); |
944 | if (hw->tx_queued && hw->tx_ready) { | 944 | if (hw->tx_queued && hw->tx_ready) { |
945 | int priority; | 945 | int priority; |
946 | struct ipw_tx_packet *packet = NULL; | 946 | struct ipw_tx_packet *packet = NULL; |
@@ -961,17 +961,17 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) | |||
961 | } | 961 | } |
962 | if (!packet) { | 962 | if (!packet) { |
963 | hw->tx_queued = 0; | 963 | hw->tx_queued = 0; |
964 | spin_unlock_irqrestore(&hw->spinlock, flags); | 964 | spin_unlock_irqrestore(&hw->lock, flags); |
965 | return 0; | 965 | return 0; |
966 | } | 966 | } |
967 | 967 | ||
968 | spin_unlock_irqrestore(&hw->spinlock, flags); | 968 | spin_unlock_irqrestore(&hw->lock, flags); |
969 | 969 | ||
970 | /* Send */ | 970 | /* Send */ |
971 | do_send_packet(hw, packet); | 971 | do_send_packet(hw, packet); |
972 | 972 | ||
973 | /* Check if more to send */ | 973 | /* Check if more to send */ |
974 | spin_lock_irqsave(&hw->spinlock, flags); | 974 | spin_lock_irqsave(&hw->lock, flags); |
975 | for (priority = 0; priority < priority_limit; priority++) | 975 | for (priority = 0; priority < priority_limit; priority++) |
976 | if (!list_empty(&hw->tx_queue[priority])) { | 976 | if (!list_empty(&hw->tx_queue[priority])) { |
977 | more_to_send = 1; | 977 | more_to_send = 1; |
@@ -981,7 +981,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) | |||
981 | if (!more_to_send) | 981 | if (!more_to_send) |
982 | hw->tx_queued = 0; | 982 | hw->tx_queued = 0; |
983 | } | 983 | } |
984 | spin_unlock_irqrestore(&hw->spinlock, flags); | 984 | spin_unlock_irqrestore(&hw->lock, flags); |
985 | 985 | ||
986 | return more_to_send; | 986 | return more_to_send; |
987 | } | 987 | } |
@@ -994,9 +994,9 @@ static void ipwireless_do_tasklet(unsigned long hw_) | |||
994 | struct ipw_hardware *hw = (struct ipw_hardware *) hw_; | 994 | struct ipw_hardware *hw = (struct ipw_hardware *) hw_; |
995 | unsigned long flags; | 995 | unsigned long flags; |
996 | 996 | ||
997 | spin_lock_irqsave(&hw->spinlock, flags); | 997 | spin_lock_irqsave(&hw->lock, flags); |
998 | if (hw->shutting_down) { | 998 | if (hw->shutting_down) { |
999 | spin_unlock_irqrestore(&hw->spinlock, flags); | 999 | spin_unlock_irqrestore(&hw->lock, flags); |
1000 | return; | 1000 | return; |
1001 | } | 1001 | } |
1002 | 1002 | ||
@@ -1005,7 +1005,7 @@ static void ipwireless_do_tasklet(unsigned long hw_) | |||
1005 | * Initial setup data sent to hardware | 1005 | * Initial setup data sent to hardware |
1006 | */ | 1006 | */ |
1007 | hw->to_setup = 2; | 1007 | hw->to_setup = 2; |
1008 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1008 | spin_unlock_irqrestore(&hw->lock, flags); |
1009 | 1009 | ||
1010 | ipw_setup_hardware(hw); | 1010 | ipw_setup_hardware(hw); |
1011 | ipw_send_setup_packet(hw); | 1011 | ipw_send_setup_packet(hw); |
@@ -1016,7 +1016,7 @@ static void ipwireless_do_tasklet(unsigned long hw_) | |||
1016 | int priority_limit = get_current_packet_priority(hw); | 1016 | int priority_limit = get_current_packet_priority(hw); |
1017 | int again; | 1017 | int again; |
1018 | 1018 | ||
1019 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1019 | spin_unlock_irqrestore(&hw->lock, flags); |
1020 | 1020 | ||
1021 | do { | 1021 | do { |
1022 | again = send_pending_packet(hw, priority_limit); | 1022 | again = send_pending_packet(hw, priority_limit); |
@@ -1054,16 +1054,16 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq, | |||
1054 | /* Transmit complete. */ | 1054 | /* Transmit complete. */ |
1055 | if (irqn & IR_TXINTR) { | 1055 | if (irqn & IR_TXINTR) { |
1056 | ack |= IR_TXINTR; | 1056 | ack |= IR_TXINTR; |
1057 | spin_lock_irqsave(&hw->spinlock, flags); | 1057 | spin_lock_irqsave(&hw->lock, flags); |
1058 | hw->tx_ready = 1; | 1058 | hw->tx_ready = 1; |
1059 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1059 | spin_unlock_irqrestore(&hw->lock, flags); |
1060 | } | 1060 | } |
1061 | /* Received data */ | 1061 | /* Received data */ |
1062 | if (irqn & IR_RXINTR) { | 1062 | if (irqn & IR_RXINTR) { |
1063 | ack |= IR_RXINTR; | 1063 | ack |= IR_RXINTR; |
1064 | spin_lock_irqsave(&hw->spinlock, flags); | 1064 | spin_lock_irqsave(&hw->lock, flags); |
1065 | hw->rx_ready++; | 1065 | hw->rx_ready++; |
1066 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1066 | spin_unlock_irqrestore(&hw->lock, flags); |
1067 | } | 1067 | } |
1068 | if (ack != 0) { | 1068 | if (ack != 0) { |
1069 | outw(ack, hw->base_port + IOIR); | 1069 | outw(ack, hw->base_port + IOIR); |
@@ -1134,9 +1134,9 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, | |||
1134 | if (hw->serial_number_detected) { | 1134 | if (hw->serial_number_detected) { |
1135 | if (memtx_serial != hw->last_memtx_serial) { | 1135 | if (memtx_serial != hw->last_memtx_serial) { |
1136 | hw->last_memtx_serial = memtx_serial; | 1136 | hw->last_memtx_serial = memtx_serial; |
1137 | spin_lock_irqsave(&hw->spinlock, flags); | 1137 | spin_lock_irqsave(&hw->lock, flags); |
1138 | hw->rx_ready++; | 1138 | hw->rx_ready++; |
1139 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1139 | spin_unlock_irqrestore(&hw->lock, flags); |
1140 | rx = 1; | 1140 | rx = 1; |
1141 | } else | 1141 | } else |
1142 | /* Ignore 'Timer Recovery' duplicates. */ | 1142 | /* Ignore 'Timer Recovery' duplicates. */ |
@@ -1151,18 +1151,18 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, | |||
1151 | printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME | 1151 | printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME |
1152 | ": memreg_tx serial num detected\n"); | 1152 | ": memreg_tx serial num detected\n"); |
1153 | 1153 | ||
1154 | spin_lock_irqsave(&hw->spinlock, flags); | 1154 | spin_lock_irqsave(&hw->lock, flags); |
1155 | hw->rx_ready++; | 1155 | hw->rx_ready++; |
1156 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1156 | spin_unlock_irqrestore(&hw->lock, flags); |
1157 | } | 1157 | } |
1158 | rx = 1; | 1158 | rx = 1; |
1159 | } | 1159 | } |
1160 | } | 1160 | } |
1161 | if (memrxdone & MEMRX_RX_DONE) { | 1161 | if (memrxdone & MEMRX_RX_DONE) { |
1162 | writew(0, &hw->memory_info_regs->memreg_rx_done); | 1162 | writew(0, &hw->memory_info_regs->memreg_rx_done); |
1163 | spin_lock_irqsave(&hw->spinlock, flags); | 1163 | spin_lock_irqsave(&hw->lock, flags); |
1164 | hw->tx_ready = 1; | 1164 | hw->tx_ready = 1; |
1165 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1165 | spin_unlock_irqrestore(&hw->lock, flags); |
1166 | tx = 1; | 1166 | tx = 1; |
1167 | } | 1167 | } |
1168 | if (tx) | 1168 | if (tx) |
@@ -1211,9 +1211,9 @@ static void flush_packets_to_hw(struct ipw_hardware *hw) | |||
1211 | int priority_limit; | 1211 | int priority_limit; |
1212 | unsigned long flags; | 1212 | unsigned long flags; |
1213 | 1213 | ||
1214 | spin_lock_irqsave(&hw->spinlock, flags); | 1214 | spin_lock_irqsave(&hw->lock, flags); |
1215 | priority_limit = get_current_packet_priority(hw); | 1215 | priority_limit = get_current_packet_priority(hw); |
1216 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1216 | spin_unlock_irqrestore(&hw->lock, flags); |
1217 | 1217 | ||
1218 | while (send_pending_packet(hw, priority_limit)); | 1218 | while (send_pending_packet(hw, priority_limit)); |
1219 | } | 1219 | } |
@@ -1223,10 +1223,10 @@ static void send_packet(struct ipw_hardware *hw, int priority, | |||
1223 | { | 1223 | { |
1224 | unsigned long flags; | 1224 | unsigned long flags; |
1225 | 1225 | ||
1226 | spin_lock_irqsave(&hw->spinlock, flags); | 1226 | spin_lock_irqsave(&hw->lock, flags); |
1227 | list_add_tail(&packet->queue, &hw->tx_queue[priority]); | 1227 | list_add_tail(&packet->queue, &hw->tx_queue[priority]); |
1228 | hw->tx_queued++; | 1228 | hw->tx_queued++; |
1229 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1229 | spin_unlock_irqrestore(&hw->lock, flags); |
1230 | 1230 | ||
1231 | flush_packets_to_hw(hw); | 1231 | flush_packets_to_hw(hw); |
1232 | } | 1232 | } |
@@ -1612,7 +1612,7 @@ struct ipw_hardware *ipwireless_hardware_create(void) | |||
1612 | 1612 | ||
1613 | INIT_LIST_HEAD(&hw->rx_queue); | 1613 | INIT_LIST_HEAD(&hw->rx_queue); |
1614 | INIT_LIST_HEAD(&hw->rx_pool); | 1614 | INIT_LIST_HEAD(&hw->rx_pool); |
1615 | spin_lock_init(&hw->spinlock); | 1615 | spin_lock_init(&hw->lock); |
1616 | tasklet_init(&hw->tasklet, ipwireless_do_tasklet, (unsigned long) hw); | 1616 | tasklet_init(&hw->tasklet, ipwireless_do_tasklet, (unsigned long) hw); |
1617 | INIT_WORK(&hw->work_rx, ipw_receive_data_work); | 1617 | INIT_WORK(&hw->work_rx, ipw_receive_data_work); |
1618 | setup_timer(&hw->setup_timer, ipwireless_setup_timer, | 1618 | setup_timer(&hw->setup_timer, ipwireless_setup_timer, |
@@ -1678,10 +1678,10 @@ static void ipwireless_setup_timer(unsigned long data) | |||
1678 | if (is_card_present(hw)) { | 1678 | if (is_card_present(hw)) { |
1679 | unsigned long flags; | 1679 | unsigned long flags; |
1680 | 1680 | ||
1681 | spin_lock_irqsave(&hw->spinlock, flags); | 1681 | spin_lock_irqsave(&hw->lock, flags); |
1682 | hw->to_setup = 1; | 1682 | hw->to_setup = 1; |
1683 | hw->tx_ready = 1; | 1683 | hw->tx_ready = 1; |
1684 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1684 | spin_unlock_irqrestore(&hw->lock, flags); |
1685 | tasklet_schedule(&hw->tasklet); | 1685 | tasklet_schedule(&hw->tasklet); |
1686 | } | 1686 | } |
1687 | 1687 | ||
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 | } |