Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97832
b: refs/heads/master
c: eb4e545
h: refs/heads/master
v: v3
  • Loading branch information
David Sterba authored and Linus Torvalds committed Jun 6, 2008
1 parent 4abeb65 commit de9bab4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 979b0fea2d9ae5d57237a368d571cbc84655fba6
refs/heads/master: eb4e545d4ac82d9018487edb4419b33b9930c857
20 changes: 12 additions & 8 deletions trunk/drivers/char/pcmcia/ipwireless/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,11 @@ struct ipw_hardware {
int init_loops;
struct timer_list setup_timer;

/* Flag if hw is ready to send next packet */
int tx_ready;
struct list_head tx_queue[NL_NUM_OF_PRIORITIES];
/* True if any packets are queued for transmission */
/* Count of pending packets to be sent */
int tx_queued;
struct list_head tx_queue[NL_NUM_OF_PRIORITIES];

int rx_bytes_queued;
struct list_head rx_queue;
Expand Down Expand Up @@ -404,6 +405,8 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data,

spin_lock_irqsave(&hw->spinlock, flags);

hw->tx_ready = 0;

if (hw->hw_version == HW_VERSION_1) {
outw((unsigned short) length, hw->base_port + IODWR);

Expand Down Expand Up @@ -492,6 +495,7 @@ static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet)

spin_lock_irqsave(&hw->spinlock, flags);
list_add(&packet->queue, &hw->tx_queue[0]);
hw->tx_queued++;
spin_unlock_irqrestore(&hw->spinlock, flags);
} else {
if (packet->packet_callback)
Expand Down Expand Up @@ -949,12 +953,10 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
unsigned long flags;

spin_lock_irqsave(&hw->spinlock, flags);
if (hw->tx_queued && hw->tx_ready != 0) {
if (hw->tx_queued && hw->tx_ready) {
int priority;
struct ipw_tx_packet *packet = NULL;

hw->tx_ready--;

/* Pick a packet */
for (priority = 0; priority < priority_limit; priority++) {
if (!list_empty(&hw->tx_queue[priority])) {
Expand All @@ -963,6 +965,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
struct ipw_tx_packet,
queue);

hw->tx_queued--;
list_del(&packet->queue);

break;
Expand All @@ -973,6 +976,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
spin_unlock_irqrestore(&hw->spinlock, flags);
return 0;
}

spin_unlock_irqrestore(&hw->spinlock, flags);

/* Send */
Expand Down Expand Up @@ -1063,7 +1067,7 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq,
if (irqn & IR_TXINTR) {
ack |= IR_TXINTR;
spin_lock_irqsave(&hw->spinlock, flags);
hw->tx_ready++;
hw->tx_ready = 1;
spin_unlock_irqrestore(&hw->spinlock, flags);
}
/* Received data */
Expand Down Expand Up @@ -1170,7 +1174,7 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq,
if (memrxdone & MEMRX_RX_DONE) {
writew(0, &hw->memory_info_regs->memreg_rx_done);
spin_lock_irqsave(&hw->spinlock, flags);
hw->tx_ready++;
hw->tx_ready = 1;
spin_unlock_irqrestore(&hw->spinlock, flags);
tx = 1;
}
Expand Down Expand Up @@ -1234,7 +1238,7 @@ static void send_packet(struct ipw_hardware *hw, int priority,

spin_lock_irqsave(&hw->spinlock, flags);
list_add_tail(&packet->queue, &hw->tx_queue[priority]);
hw->tx_queued = 1;
hw->tx_queued++;
spin_unlock_irqrestore(&hw->spinlock, flags);

flush_packets_to_hw(hw);
Expand Down

0 comments on commit de9bab4

Please sign in to comment.