diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-02-17 15:09:59 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-17 15:09:59 -0500 |
commit | 48c871c1f6a7c7044dd76774fb469e65c7e2e4e8 (patch) | |
tree | da3aa535c98cc0957851354ceb0fbff7482d7a9d /drivers/char/ip2/i2lib.c | |
parent | 1a1689344add3333d28d1b5495d8043a3877d01c (diff) | |
parent | 4409d28140d9a6e6e3f4f1fdaf7234c4b965d954 (diff) |
Merge branch 'gfar' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc into upstream
Diffstat (limited to 'drivers/char/ip2/i2lib.c')
-rw-r--r-- | drivers/char/ip2/i2lib.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/drivers/char/ip2/i2lib.c b/drivers/char/ip2/i2lib.c index 78045767ec33..f86fa0c55d36 100644 --- a/drivers/char/ip2/i2lib.c +++ b/drivers/char/ip2/i2lib.c | |||
@@ -80,7 +80,7 @@ static int i2RetryFlushOutput(i2ChanStrPtr); | |||
80 | // Not a documented part of the library routines (careful...) but the Diagnostic | 80 | // Not a documented part of the library routines (careful...) but the Diagnostic |
81 | // i2diag.c finds them useful to help the throughput in certain limited | 81 | // i2diag.c finds them useful to help the throughput in certain limited |
82 | // single-threaded operations. | 82 | // single-threaded operations. |
83 | static void iiSendPendingMail(i2eBordStrPtr); | 83 | static inline void iiSendPendingMail(i2eBordStrPtr); |
84 | static void serviceOutgoingFifo(i2eBordStrPtr); | 84 | static void serviceOutgoingFifo(i2eBordStrPtr); |
85 | 85 | ||
86 | // Functions defined in ip2.c as part of interrupt handling | 86 | // Functions defined in ip2.c as part of interrupt handling |
@@ -150,6 +150,13 @@ i2Validate ( i2ChanStrPtr pCh ) | |||
150 | == (CHANNEL_MAGIC | CHANNEL_SUPPORT)); | 150 | == (CHANNEL_MAGIC | CHANNEL_SUPPORT)); |
151 | } | 151 | } |
152 | 152 | ||
153 | static void iiSendPendingMail_t(unsigned long data) | ||
154 | { | ||
155 | i2eBordStrPtr pB = (i2eBordStrPtr)data; | ||
156 | |||
157 | iiSendPendingMail(pB); | ||
158 | } | ||
159 | |||
153 | //****************************************************************************** | 160 | //****************************************************************************** |
154 | // Function: iiSendPendingMail(pB) | 161 | // Function: iiSendPendingMail(pB) |
155 | // Parameters: Pointer to a board structure | 162 | // Parameters: Pointer to a board structure |
@@ -184,12 +191,9 @@ iiSendPendingMail(i2eBordStrPtr pB) | |||
184 | /\/\|=mhw=|\/\/ */ | 191 | /\/\|=mhw=|\/\/ */ |
185 | 192 | ||
186 | if( ++pB->SendPendingRetry < 16 ) { | 193 | if( ++pB->SendPendingRetry < 16 ) { |
187 | 194 | setup_timer(&pB->SendPendingTimer, | |
188 | init_timer( &(pB->SendPendingTimer) ); | 195 | iiSendPendingMail_t, (unsigned long)pB); |
189 | pB->SendPendingTimer.expires = jiffies + 1; | 196 | mod_timer(&pB->SendPendingTimer, jiffies + 1); |
190 | pB->SendPendingTimer.function = (void*)(unsigned long)iiSendPendingMail; | ||
191 | pB->SendPendingTimer.data = (unsigned long)pB; | ||
192 | add_timer( &(pB->SendPendingTimer) ); | ||
193 | } else { | 197 | } else { |
194 | printk( KERN_ERR "IP2: iiSendPendingMail unable to queue outbound mail\n" ); | 198 | printk( KERN_ERR "IP2: iiSendPendingMail unable to queue outbound mail\n" ); |
195 | } | 199 | } |
@@ -1265,8 +1269,10 @@ i2RetryFlushOutput(i2ChanStrPtr pCh) | |||
1265 | // soon as all the data is completely sent. | 1269 | // soon as all the data is completely sent. |
1266 | //****************************************************************************** | 1270 | //****************************************************************************** |
1267 | static void | 1271 | static void |
1268 | i2DrainWakeup(i2ChanStrPtr pCh) | 1272 | i2DrainWakeup(unsigned long d) |
1269 | { | 1273 | { |
1274 | i2ChanStrPtr pCh = (i2ChanStrPtr)d; | ||
1275 | |||
1270 | ip2trace (CHANN, ITRC_DRAIN, 10, 1, pCh->BookmarkTimer.expires ); | 1276 | ip2trace (CHANN, ITRC_DRAIN, 10, 1, pCh->BookmarkTimer.expires ); |
1271 | 1277 | ||
1272 | pCh->BookmarkTimer.expires = 0; | 1278 | pCh->BookmarkTimer.expires = 0; |
@@ -1292,14 +1298,12 @@ i2DrainOutput(i2ChanStrPtr pCh, int timeout) | |||
1292 | } | 1298 | } |
1293 | if ((timeout > 0) && (pCh->BookmarkTimer.expires == 0 )) { | 1299 | if ((timeout > 0) && (pCh->BookmarkTimer.expires == 0 )) { |
1294 | // One per customer (channel) | 1300 | // One per customer (channel) |
1295 | init_timer( &(pCh->BookmarkTimer) ); | 1301 | setup_timer(&pCh->BookmarkTimer, i2DrainWakeup, |
1296 | pCh->BookmarkTimer.expires = jiffies + timeout; | 1302 | (unsigned long)pCh); |
1297 | pCh->BookmarkTimer.function = (void*)(unsigned long)i2DrainWakeup; | ||
1298 | pCh->BookmarkTimer.data = (unsigned long)pCh; | ||
1299 | 1303 | ||
1300 | ip2trace (CHANN, ITRC_DRAIN, 1, 1, pCh->BookmarkTimer.expires ); | 1304 | ip2trace (CHANN, ITRC_DRAIN, 1, 1, pCh->BookmarkTimer.expires ); |
1301 | 1305 | ||
1302 | add_timer( &(pCh->BookmarkTimer) ); | 1306 | mod_timer(&pCh->BookmarkTimer, jiffies + timeout); |
1303 | } | 1307 | } |
1304 | 1308 | ||
1305 | i2QueueCommands( PTYPE_INLINE, pCh, -1, 1, CMD_BMARK_REQ ); | 1309 | i2QueueCommands( PTYPE_INLINE, pCh, -1, 1, CMD_BMARK_REQ ); |
@@ -1373,15 +1377,7 @@ ip2_owake( PTTY tp) | |||
1373 | ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags, | 1377 | ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags, |
1374 | (1 << TTY_DO_WRITE_WAKEUP) ); | 1378 | (1 << TTY_DO_WRITE_WAKEUP) ); |
1375 | 1379 | ||
1376 | wake_up_interruptible ( &tp->write_wait ); | 1380 | tty_wakeup(tp); |
1377 | if ( ( tp->flags & (1 << TTY_DO_WRITE_WAKEUP) ) | ||
1378 | && tp->ldisc.write_wakeup ) | ||
1379 | { | ||
1380 | (tp->ldisc.write_wakeup) ( tp ); | ||
1381 | |||
1382 | ip2trace (CHANN, ITRC_SICMD, 11, 0 ); | ||
1383 | |||
1384 | } | ||
1385 | } | 1381 | } |
1386 | 1382 | ||
1387 | static inline void | 1383 | static inline void |