aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-12-06 01:31:52 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-06 01:31:52 -0500
commit8a1ec21e6c856b996cffcd4b33f037f6748a3ab4 (patch)
tree048a099c0ee072c66f7ce21ed8f7f58c425b59b4
parent098401a600b6344771900fe164c5eafb668ce99c (diff)
tty: Flags should be accessed via the foo_bit interfaces
We have various drivers that poke around directly and we need to clean this up before it causes problems. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/irda/irtty-sir.c7
-rw-r--r--drivers/net/slip.c11
-rw-r--r--drivers/net/wan/x25_asy.c8
-rw-r--r--drivers/net/wireless/strip.c8
4 files changed, 15 insertions, 19 deletions
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index 6bcee01c684c..d53aa9582137 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -191,7 +191,7 @@ static int irtty_do_write(struct sir_dev *dev, const unsigned char *ptr, size_t
191 tty = priv->tty; 191 tty = priv->tty;
192 if (!tty->ops->write) 192 if (!tty->ops->write)
193 return 0; 193 return 0;
194 tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); 194 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
195 writelen = tty_write_room(tty); 195 writelen = tty_write_room(tty);
196 if (writelen > len) 196 if (writelen > len)
197 writelen = len; 197 writelen = len;
@@ -263,8 +263,7 @@ static void irtty_write_wakeup(struct tty_struct *tty)
263 IRDA_ASSERT(priv != NULL, return;); 263 IRDA_ASSERT(priv != NULL, return;);
264 IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return;); 264 IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return;);
265 265
266 tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 266 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
267
268 if (priv->dev) 267 if (priv->dev)
269 sirdev_write_complete(priv->dev); 268 sirdev_write_complete(priv->dev);
270} 269}
@@ -522,7 +521,7 @@ static void irtty_close(struct tty_struct *tty)
522 521
523 /* Stop tty */ 522 /* Stop tty */
524 irtty_stop_receiver(tty, TRUE); 523 irtty_stop_receiver(tty, TRUE);
525 tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 524 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
526 if (tty->ops->stop) 525 if (tty->ops->stop)
527 tty->ops->stop(tty); 526 tty->ops->stop(tty);
528 527
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index 25cec06d6dcc..8e1c0baf6958 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -401,7 +401,7 @@ static void sl_encaps(struct slip *sl, unsigned char *icp, int len)
401 * if we did not request it before write operation. 401 * if we did not request it before write operation.
402 * 14 Oct 1994 Dmitry Gorodchanin. 402 * 14 Oct 1994 Dmitry Gorodchanin.
403 */ 403 */
404 sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); 404 set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
405 actual = sl->tty->ops->write(sl->tty, sl->xbuff, count); 405 actual = sl->tty->ops->write(sl->tty, sl->xbuff, count);
406#ifdef SL_CHECK_TRANSMIT 406#ifdef SL_CHECK_TRANSMIT
407 sl->dev->trans_start = jiffies; 407 sl->dev->trans_start = jiffies;
@@ -431,7 +431,7 @@ static void slip_write_wakeup(struct tty_struct *tty)
431 /* Now serial buffer is almost free & we can start 431 /* Now serial buffer is almost free & we can start
432 * transmission of another packet */ 432 * transmission of another packet */
433 sl->tx_packets++; 433 sl->tx_packets++;
434 tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 434 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
435 sl_unlock(sl); 435 sl_unlock(sl);
436 return; 436 return;
437 } 437 }
@@ -464,7 +464,7 @@ static void sl_tx_timeout(struct net_device *dev)
464 (tty_chars_in_buffer(sl->tty) || sl->xleft) ? 464 (tty_chars_in_buffer(sl->tty) || sl->xleft) ?
465 "bad line quality" : "driver error"); 465 "bad line quality" : "driver error");
466 sl->xleft = 0; 466 sl->xleft = 0;
467 sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 467 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
468 sl_unlock(sl); 468 sl_unlock(sl);
469#endif 469#endif
470 } 470 }
@@ -514,10 +514,9 @@ sl_close(struct net_device *dev)
514 struct slip *sl = netdev_priv(dev); 514 struct slip *sl = netdev_priv(dev);
515 515
516 spin_lock_bh(&sl->lock); 516 spin_lock_bh(&sl->lock);
517 if (sl->tty) { 517 if (sl->tty)
518 /* TTY discipline is running. */ 518 /* TTY discipline is running. */
519 sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 519 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
520 }
521 netif_stop_queue(dev); 520 netif_stop_queue(dev);
522 sl->rcount = 0; 521 sl->rcount = 0;
523 sl->xleft = 0; 522 sl->xleft = 0;
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 85d789147300..7c5ac40f8725 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -242,7 +242,7 @@ static void x25_asy_encaps(struct x25_asy *sl, unsigned char *icp, int len)
242 * if we did not request it before write operation. 242 * if we did not request it before write operation.
243 * 14 Oct 1994 Dmitry Gorodchanin. 243 * 14 Oct 1994 Dmitry Gorodchanin.
244 */ 244 */
245 sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); 245 set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
246 actual = sl->tty->ops->write(sl->tty, sl->xbuff, count); 246 actual = sl->tty->ops->write(sl->tty, sl->xbuff, count);
247 sl->xleft = count - actual; 247 sl->xleft = count - actual;
248 sl->xhead = sl->xbuff + actual; 248 sl->xhead = sl->xbuff + actual;
@@ -267,7 +267,7 @@ static void x25_asy_write_wakeup(struct tty_struct *tty)
267 /* Now serial buffer is almost free & we can start 267 /* Now serial buffer is almost free & we can start
268 * transmission of another packet */ 268 * transmission of another packet */
269 sl->stats.tx_packets++; 269 sl->stats.tx_packets++;
270 tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 270 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
271 x25_asy_unlock(sl); 271 x25_asy_unlock(sl);
272 return; 272 return;
273 } 273 }
@@ -290,7 +290,7 @@ static void x25_asy_timeout(struct net_device *dev)
290 (tty_chars_in_buffer(sl->tty) || sl->xleft) ? 290 (tty_chars_in_buffer(sl->tty) || sl->xleft) ?
291 "bad line quality" : "driver error"); 291 "bad line quality" : "driver error");
292 sl->xleft = 0; 292 sl->xleft = 0;
293 sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 293 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
294 x25_asy_unlock(sl); 294 x25_asy_unlock(sl);
295 } 295 }
296 spin_unlock(&sl->lock); 296 spin_unlock(&sl->lock);
@@ -500,7 +500,7 @@ static int x25_asy_close(struct net_device *dev)
500 500
501 spin_lock(&sl->lock); 501 spin_lock(&sl->lock);
502 if (sl->tty) 502 if (sl->tty)
503 sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 503 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
504 504
505 netif_stop_queue(dev); 505 netif_stop_queue(dev);
506 sl->rcount = 0; 506 sl->rcount = 0;
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index cf0d070ced13..f93caf4be328 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -1252,7 +1252,7 @@ static void strip_write_some_more(struct tty_struct *tty)
1252#endif 1252#endif
1253 } else { /* Else start transmission of another packet */ 1253 } else { /* Else start transmission of another packet */
1254 1254
1255 tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 1255 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
1256 strip_unlock(strip_info); 1256 strip_unlock(strip_info);
1257 } 1257 }
1258} 1258}
@@ -1455,8 +1455,7 @@ static void strip_send(struct strip *strip_info, struct sk_buff *skb)
1455 */ 1455 */
1456 strip_info->tx_head = strip_info->tx_buff; 1456 strip_info->tx_head = strip_info->tx_buff;
1457 strip_info->tx_left = ptr - strip_info->tx_buff; 1457 strip_info->tx_left = ptr - strip_info->tx_buff;
1458 strip_info->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); 1458 set_bit(TTY_DO_WRITE_WAKEUP, &strip_info->tty->flags);
1459
1460 /* 1459 /*
1461 * 4. Debugging check to make sure we're not overflowing the buffer. 1460 * 4. Debugging check to make sure we're not overflowing the buffer.
1462 */ 1461 */
@@ -2454,8 +2453,7 @@ static int strip_close_low(struct net_device *dev)
2454 2453
2455 if (strip_info->tty == NULL) 2454 if (strip_info->tty == NULL)
2456 return -EBUSY; 2455 return -EBUSY;
2457 strip_info->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); 2456 clear_bit(TTY_DO_WRITE_WAKEUP, &strip_info->tty->flags);
2458
2459 netif_stop_queue(dev); 2457 netif_stop_queue(dev);
2460 2458
2461 /* 2459 /*