Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304162
b: refs/heads/master
c: 7393af8
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Apr 9, 2012
1 parent 6935b6f commit 0d65f92
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 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: e6df3cce07a25d7d65c7d3d2cec87cbf02fd21f0
refs/heads/master: 7393af808fe1564ad34289b507b950445dfc06ac
29 changes: 15 additions & 14 deletions trunk/drivers/tty/ipwireless/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
#define TTYTYPE_RAS_RAW (2)

struct ipw_tty {
struct tty_port port;
int index;
struct ipw_hardware *hardware;
unsigned int channel_idx;
unsigned int secondary_channel_idx;
int tty_type;
struct ipw_network *network;
struct tty_struct *linux_tty;
int open_count;
unsigned int control_lines;
struct mutex ipw_tty_mutex;
int tx_bytes_queued;
Expand Down Expand Up @@ -100,10 +100,10 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)
mutex_unlock(&tty->ipw_tty_mutex);
return -ENODEV;
}
if (tty->open_count == 0)
if (tty->port.count == 0)
tty->tx_bytes_queued = 0;

tty->open_count++;
tty->port.count++;

tty->linux_tty = linux_tty;
linux_tty->driver_data = tty;
Expand All @@ -119,9 +119,9 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)

static void do_ipw_close(struct ipw_tty *tty)
{
tty->open_count--;
tty->port.count--;

if (tty->open_count == 0) {
if (tty->port.count == 0) {
struct tty_struct *linux_tty = tty->linux_tty;

if (linux_tty != NULL) {
Expand All @@ -142,7 +142,7 @@ static void ipw_hangup(struct tty_struct *linux_tty)
return;

mutex_lock(&tty->ipw_tty_mutex);
if (tty->open_count == 0) {
if (tty->port.count == 0) {
mutex_unlock(&tty->ipw_tty_mutex);
return;
}
Expand Down Expand Up @@ -171,7 +171,7 @@ void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data,
return;
}

if (!tty->open_count) {
if (!tty->port.count) {
mutex_unlock(&tty->ipw_tty_mutex);
return;
}
Expand Down Expand Up @@ -213,7 +213,7 @@ static int ipw_write(struct tty_struct *linux_tty,
return -ENODEV;

mutex_lock(&tty->ipw_tty_mutex);
if (!tty->open_count) {
if (!tty->port.count) {
mutex_unlock(&tty->ipw_tty_mutex);
return -EINVAL;
}
Expand Down Expand Up @@ -253,7 +253,7 @@ static int ipw_write_room(struct tty_struct *linux_tty)
if (!tty)
return -ENODEV;

if (!tty->open_count)
if (!tty->port.count)
return -EINVAL;

room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued;
Expand Down Expand Up @@ -295,7 +295,7 @@ static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
if (!tty)
return 0;

if (!tty->open_count)
if (!tty->port.count)
return 0;

return tty->tx_bytes_queued;
Expand Down Expand Up @@ -376,7 +376,7 @@ static int ipw_tiocmget(struct tty_struct *linux_tty)
if (!tty)
return -ENODEV;

if (!tty->open_count)
if (!tty->port.count)
return -EINVAL;

return get_control_lines(tty);
Expand All @@ -392,7 +392,7 @@ ipw_tiocmset(struct tty_struct *linux_tty,
if (!tty)
return -ENODEV;

if (!tty->open_count)
if (!tty->port.count)
return -EINVAL;

return set_control_lines(tty, set, clear);
Expand All @@ -406,7 +406,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty,
if (!tty)
return -ENODEV;

if (!tty->open_count)
if (!tty->port.count)
return -EINVAL;

/* FIXME: Exactly how is the tty object locked here .. */
Expand Down Expand Up @@ -475,6 +475,7 @@ static int add_tty(int j,
ttys[j]->network = network;
ttys[j]->tty_type = tty_type;
mutex_init(&ttys[j]->ipw_tty_mutex);
tty_port_init(&ttys[j]->port);

tty_register_device(ipw_tty_driver, j, NULL);
ipwireless_associate_network_tty(network, channel_idx, ttys[j]);
Expand Down Expand Up @@ -561,7 +562,7 @@ void ipwireless_tty_free(struct ipw_tty *tty)
* are gone */
mutex_lock(&ttyj->ipw_tty_mutex);
}
while (ttyj->open_count)
while (ttyj->port.count)
do_ipw_close(ttyj);
ipwireless_disassociate_network_ttys(network,
ttyj->channel_idx);
Expand Down

0 comments on commit 0d65f92

Please sign in to comment.