aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/synclinkmp.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2008-04-28 05:14:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:29 -0400
commit0fab6de09c71a976e5d765e1ff548b14be385153 (patch)
tree74782032b89218366fc999f570c01e7d6a105be6 /drivers/char/synclinkmp.c
parent7a63ce5a1f2fde5ae737f059e2714e441447120c (diff)
synclink drivers bool conversion
Remove more TRUE/FALSE defines and uses Remove == TRUE tests Convert BOOLEAN to bool Convert int to bool where appropriate Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Paul Fulghum <paulkf@microgate.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/synclinkmp.c')
-rw-r--r--drivers/char/synclinkmp.c157
1 files changed, 79 insertions, 78 deletions
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index c96062ea72b4..66e8082aff7b 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -188,9 +188,9 @@ typedef struct _synclinkmp_info {
188 188
189 u32 pending_bh; 189 u32 pending_bh;
190 190
191 int bh_running; /* Protection from multiple */ 191 bool bh_running; /* Protection from multiple */
192 int isr_overflow; 192 int isr_overflow;
193 int bh_requested; 193 bool bh_requested;
194 194
195 int dcd_chkcount; /* check counts to prevent */ 195 int dcd_chkcount; /* check counts to prevent */
196 int cts_chkcount; /* too many IRQs if a signal */ 196 int cts_chkcount; /* too many IRQs if a signal */
@@ -213,11 +213,11 @@ typedef struct _synclinkmp_info {
213 unsigned char *tmp_rx_buf; 213 unsigned char *tmp_rx_buf;
214 unsigned int tmp_rx_buf_count; 214 unsigned int tmp_rx_buf_count;
215 215
216 int rx_enabled; 216 bool rx_enabled;
217 int rx_overflow; 217 bool rx_overflow;
218 218
219 int tx_enabled; 219 bool tx_enabled;
220 int tx_active; 220 bool tx_active;
221 u32 idle_mode; 221 u32 idle_mode;
222 222
223 unsigned char ie0_value; 223 unsigned char ie0_value;
@@ -238,13 +238,13 @@ typedef struct _synclinkmp_info {
238 238
239 unsigned int irq_level; /* interrupt level */ 239 unsigned int irq_level; /* interrupt level */
240 unsigned long irq_flags; 240 unsigned long irq_flags;
241 int irq_requested; /* nonzero if IRQ requested */ 241 bool irq_requested; /* true if IRQ requested */
242 242
243 MGSL_PARAMS params; /* communications parameters */ 243 MGSL_PARAMS params; /* communications parameters */
244 244
245 unsigned char serial_signals; /* current serial signal states */ 245 unsigned char serial_signals; /* current serial signal states */
246 246
247 int irq_occurred; /* for diagnostics use */ 247 bool irq_occurred; /* for diagnostics use */
248 unsigned int init_error; /* Initialization startup error */ 248 unsigned int init_error; /* Initialization startup error */
249 249
250 u32 last_mem_alloc; 250 u32 last_mem_alloc;
@@ -255,7 +255,7 @@ typedef struct _synclinkmp_info {
255 unsigned char* sca_base; /* HD64570 SCA Memory address */ 255 unsigned char* sca_base; /* HD64570 SCA Memory address */
256 u32 phys_sca_base; 256 u32 phys_sca_base;
257 u32 sca_offset; 257 u32 sca_offset;
258 int sca_base_requested; 258 bool sca_base_requested;
259 259
260 unsigned char* lcr_base; /* local config registers (PCI only) */ 260 unsigned char* lcr_base; /* local config registers (PCI only) */
261 u32 phys_lcr_base; 261 u32 phys_lcr_base;
@@ -265,12 +265,12 @@ typedef struct _synclinkmp_info {
265 unsigned char* statctrl_base; /* status/control register memory */ 265 unsigned char* statctrl_base; /* status/control register memory */
266 u32 phys_statctrl_base; 266 u32 phys_statctrl_base;
267 u32 statctrl_offset; 267 u32 statctrl_offset;
268 int sca_statctrl_requested; 268 bool sca_statctrl_requested;
269 269
270 u32 misc_ctrl_value; 270 u32 misc_ctrl_value;
271 char flag_buf[MAX_ASYNC_BUFFER_SIZE]; 271 char flag_buf[MAX_ASYNC_BUFFER_SIZE];
272 char char_buf[MAX_ASYNC_BUFFER_SIZE]; 272 char char_buf[MAX_ASYNC_BUFFER_SIZE];
273 BOOLEAN drop_rts_on_tx_done; 273 bool drop_rts_on_tx_done;
274 274
275 struct _input_signal_events input_signal_events; 275 struct _input_signal_events input_signal_events;
276 276
@@ -571,12 +571,12 @@ static void shutdown(SLMP_INFO *info);
571static void program_hw(SLMP_INFO *info); 571static void program_hw(SLMP_INFO *info);
572static void change_params(SLMP_INFO *info); 572static void change_params(SLMP_INFO *info);
573 573
574static int init_adapter(SLMP_INFO *info); 574static bool init_adapter(SLMP_INFO *info);
575static int register_test(SLMP_INFO *info); 575static bool register_test(SLMP_INFO *info);
576static int irq_test(SLMP_INFO *info); 576static bool irq_test(SLMP_INFO *info);
577static int loopback_test(SLMP_INFO *info); 577static bool loopback_test(SLMP_INFO *info);
578static int adapter_test(SLMP_INFO *info); 578static int adapter_test(SLMP_INFO *info);
579static int memory_test(SLMP_INFO *info); 579static bool memory_test(SLMP_INFO *info);
580 580
581static void reset_adapter(SLMP_INFO *info); 581static void reset_adapter(SLMP_INFO *info);
582static void reset_port(SLMP_INFO *info); 582static void reset_port(SLMP_INFO *info);
@@ -587,7 +587,7 @@ static void rx_stop(SLMP_INFO *info);
587static void rx_start(SLMP_INFO *info); 587static void rx_start(SLMP_INFO *info);
588static void rx_reset_buffers(SLMP_INFO *info); 588static void rx_reset_buffers(SLMP_INFO *info);
589static void rx_free_frame_buffers(SLMP_INFO *info, unsigned int first, unsigned int last); 589static void rx_free_frame_buffers(SLMP_INFO *info, unsigned int first, unsigned int last);
590static int rx_get_frame(SLMP_INFO *info); 590static bool rx_get_frame(SLMP_INFO *info);
591 591
592static void tx_start(SLMP_INFO *info); 592static void tx_start(SLMP_INFO *info);
593static void tx_stop(SLMP_INFO *info); 593static void tx_stop(SLMP_INFO *info);
@@ -2044,8 +2044,8 @@ int bh_action(SLMP_INFO *info)
2044 2044
2045 if (!rc) { 2045 if (!rc) {
2046 /* Mark BH routine as complete */ 2046 /* Mark BH routine as complete */
2047 info->bh_running = 0; 2047 info->bh_running = false;
2048 info->bh_requested = 0; 2048 info->bh_requested = false;
2049 } 2049 }
2050 2050
2051 spin_unlock_irqrestore(&info->lock,flags); 2051 spin_unlock_irqrestore(&info->lock,flags);
@@ -2067,7 +2067,7 @@ void bh_handler(struct work_struct *work)
2067 printk( "%s(%d):%s bh_handler() entry\n", 2067 printk( "%s(%d):%s bh_handler() entry\n",
2068 __FILE__,__LINE__,info->device_name); 2068 __FILE__,__LINE__,info->device_name);
2069 2069
2070 info->bh_running = 1; 2070 info->bh_running = true;
2071 2071
2072 while((action = bh_action(info)) != 0) { 2072 while((action = bh_action(info)) != 0) {
2073 2073
@@ -2152,7 +2152,7 @@ void isr_timer(SLMP_INFO * info)
2152 */ 2152 */
2153 write_reg(info, (unsigned char)(timer + TMCS), 0); 2153 write_reg(info, (unsigned char)(timer + TMCS), 0);
2154 2154
2155 info->irq_occurred = TRUE; 2155 info->irq_occurred = true;
2156 2156
2157 if ( debug_level >= DEBUG_LEVEL_ISR ) 2157 if ( debug_level >= DEBUG_LEVEL_ISR )
2158 printk("%s(%d):%s isr_timer()\n", 2158 printk("%s(%d):%s isr_timer()\n",
@@ -2232,7 +2232,7 @@ void isr_rxrdy(SLMP_INFO * info)
2232 while((status = read_reg(info,CST0)) & BIT0) 2232 while((status = read_reg(info,CST0)) & BIT0)
2233 { 2233 {
2234 int flag = 0; 2234 int flag = 0;
2235 int over = 0; 2235 bool over = false;
2236 DataByte = read_reg(info,TRB); 2236 DataByte = read_reg(info,TRB);
2237 2237
2238 icount->rx++; 2238 icount->rx++;
@@ -2265,7 +2265,7 @@ void isr_rxrdy(SLMP_INFO * info)
2265 * reported immediately, and doesn't 2265 * reported immediately, and doesn't
2266 * affect the current character 2266 * affect the current character
2267 */ 2267 */
2268 over = 1; 2268 over = true;
2269 } 2269 }
2270 } 2270 }
2271 } /* end of if (error) */ 2271 } /* end of if (error) */
@@ -2318,14 +2318,14 @@ static void isr_txeom(SLMP_INFO * info, unsigned char status)
2318 info->icount.txok++; 2318 info->icount.txok++;
2319 } 2319 }
2320 2320
2321 info->tx_active = 0; 2321 info->tx_active = false;
2322 info->tx_count = info->tx_put = info->tx_get = 0; 2322 info->tx_count = info->tx_put = info->tx_get = 0;
2323 2323
2324 del_timer(&info->tx_timer); 2324 del_timer(&info->tx_timer);
2325 2325
2326 if (info->params.mode != MGSL_MODE_ASYNC && info->drop_rts_on_tx_done ) { 2326 if (info->params.mode != MGSL_MODE_ASYNC && info->drop_rts_on_tx_done ) {
2327 info->serial_signals &= ~SerialSignal_RTS; 2327 info->serial_signals &= ~SerialSignal_RTS;
2328 info->drop_rts_on_tx_done = 0; 2328 info->drop_rts_on_tx_done = false;
2329 set_signals(info); 2329 set_signals(info);
2330 } 2330 }
2331 2331
@@ -2398,7 +2398,7 @@ void isr_txrdy(SLMP_INFO * info)
2398 if ( info->tx_count ) 2398 if ( info->tx_count )
2399 tx_load_fifo( info ); 2399 tx_load_fifo( info );
2400 else { 2400 else {
2401 info->tx_active = 0; 2401 info->tx_active = false;
2402 info->ie0_value &= ~TXRDYE; 2402 info->ie0_value &= ~TXRDYE;
2403 write_reg(info, IE0, info->ie0_value); 2403 write_reg(info, IE0, info->ie0_value);
2404 } 2404 }
@@ -2438,7 +2438,7 @@ void isr_rxdmaerror(SLMP_INFO * info)
2438 printk("%s(%d):%s isr_rxdmaerror(), status=%02x\n", 2438 printk("%s(%d):%s isr_rxdmaerror(), status=%02x\n",
2439 __FILE__,__LINE__,info->device_name,status); 2439 __FILE__,__LINE__,info->device_name,status);
2440 2440
2441 info->rx_overflow = TRUE; 2441 info->rx_overflow = true;
2442 info->pending_bh |= BH_RECEIVE; 2442 info->pending_bh |= BH_RECEIVE;
2443} 2443}
2444 2444
@@ -2691,7 +2691,7 @@ static irqreturn_t synclinkmp_interrupt(int dummy, void *dev_id)
2691 printk("%s(%d):%s queueing bh task.\n", 2691 printk("%s(%d):%s queueing bh task.\n",
2692 __FILE__,__LINE__,port->device_name); 2692 __FILE__,__LINE__,port->device_name);
2693 schedule_work(&port->task); 2693 schedule_work(&port->task);
2694 port->bh_requested = 1; 2694 port->bh_requested = true;
2695 } 2695 }
2696 } 2696 }
2697 2697
@@ -3320,7 +3320,8 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
3320{ 3320{
3321 DECLARE_WAITQUEUE(wait, current); 3321 DECLARE_WAITQUEUE(wait, current);
3322 int retval; 3322 int retval;
3323 int do_clocal = 0, extra_count = 0; 3323 bool do_clocal = false;
3324 bool extra_count = false;
3324 unsigned long flags; 3325 unsigned long flags;
3325 3326
3326 if (debug_level >= DEBUG_LEVEL_INFO) 3327 if (debug_level >= DEBUG_LEVEL_INFO)
@@ -3335,7 +3336,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
3335 } 3336 }
3336 3337
3337 if (tty->termios->c_cflag & CLOCAL) 3338 if (tty->termios->c_cflag & CLOCAL)
3338 do_clocal = 1; 3339 do_clocal = true;
3339 3340
3340 /* Wait for carrier detect and the line to become 3341 /* Wait for carrier detect and the line to become
3341 * free (i.e., not in use by the callout). While we are in 3342 * free (i.e., not in use by the callout). While we are in
@@ -3353,7 +3354,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
3353 3354
3354 spin_lock_irqsave(&info->lock, flags); 3355 spin_lock_irqsave(&info->lock, flags);
3355 if (!tty_hung_up_p(filp)) { 3356 if (!tty_hung_up_p(filp)) {
3356 extra_count = 1; 3357 extra_count = true;
3357 info->count--; 3358 info->count--;
3358 } 3359 }
3359 spin_unlock_irqrestore(&info->lock, flags); 3360 spin_unlock_irqrestore(&info->lock, flags);
@@ -3596,7 +3597,7 @@ int claim_resources(SLMP_INFO *info)
3596 goto errout; 3597 goto errout;
3597 } 3598 }
3598 else 3599 else
3599 info->shared_mem_requested = 1; 3600 info->shared_mem_requested = true;
3600 3601
3601 if (request_mem_region(info->phys_lcr_base + info->lcr_offset,128,"synclinkmp") == NULL) { 3602 if (request_mem_region(info->phys_lcr_base + info->lcr_offset,128,"synclinkmp") == NULL) {
3602 printk( "%s(%d):%s lcr mem addr conflict, Addr=%08X\n", 3603 printk( "%s(%d):%s lcr mem addr conflict, Addr=%08X\n",
@@ -3605,7 +3606,7 @@ int claim_resources(SLMP_INFO *info)
3605 goto errout; 3606 goto errout;
3606 } 3607 }
3607 else 3608 else
3608 info->lcr_mem_requested = 1; 3609 info->lcr_mem_requested = true;
3609 3610
3610 if (request_mem_region(info->phys_sca_base + info->sca_offset,SCA_BASE_SIZE,"synclinkmp") == NULL) { 3611 if (request_mem_region(info->phys_sca_base + info->sca_offset,SCA_BASE_SIZE,"synclinkmp") == NULL) {
3611 printk( "%s(%d):%s sca mem addr conflict, Addr=%08X\n", 3612 printk( "%s(%d):%s sca mem addr conflict, Addr=%08X\n",
@@ -3614,7 +3615,7 @@ int claim_resources(SLMP_INFO *info)
3614 goto errout; 3615 goto errout;
3615 } 3616 }
3616 else 3617 else
3617 info->sca_base_requested = 1; 3618 info->sca_base_requested = true;
3618 3619
3619 if (request_mem_region(info->phys_statctrl_base + info->statctrl_offset,SCA_REG_SIZE,"synclinkmp") == NULL) { 3620 if (request_mem_region(info->phys_statctrl_base + info->statctrl_offset,SCA_REG_SIZE,"synclinkmp") == NULL) {
3620 printk( "%s(%d):%s stat/ctrl mem addr conflict, Addr=%08X\n", 3621 printk( "%s(%d):%s stat/ctrl mem addr conflict, Addr=%08X\n",
@@ -3623,7 +3624,7 @@ int claim_resources(SLMP_INFO *info)
3623 goto errout; 3624 goto errout;
3624 } 3625 }
3625 else 3626 else
3626 info->sca_statctrl_requested = 1; 3627 info->sca_statctrl_requested = true;
3627 3628
3628 info->memory_base = ioremap(info->phys_memory_base,SCA_MEM_SIZE); 3629 info->memory_base = ioremap(info->phys_memory_base,SCA_MEM_SIZE);
3629 if (!info->memory_base) { 3630 if (!info->memory_base) {
@@ -3682,24 +3683,24 @@ void release_resources(SLMP_INFO *info)
3682 3683
3683 if ( info->irq_requested ) { 3684 if ( info->irq_requested ) {
3684 free_irq(info->irq_level, info); 3685 free_irq(info->irq_level, info);
3685 info->irq_requested = 0; 3686 info->irq_requested = false;
3686 } 3687 }
3687 3688
3688 if ( info->shared_mem_requested ) { 3689 if ( info->shared_mem_requested ) {
3689 release_mem_region(info->phys_memory_base,SCA_MEM_SIZE); 3690 release_mem_region(info->phys_memory_base,SCA_MEM_SIZE);
3690 info->shared_mem_requested = 0; 3691 info->shared_mem_requested = false;
3691 } 3692 }
3692 if ( info->lcr_mem_requested ) { 3693 if ( info->lcr_mem_requested ) {
3693 release_mem_region(info->phys_lcr_base + info->lcr_offset,128); 3694 release_mem_region(info->phys_lcr_base + info->lcr_offset,128);
3694 info->lcr_mem_requested = 0; 3695 info->lcr_mem_requested = false;
3695 } 3696 }
3696 if ( info->sca_base_requested ) { 3697 if ( info->sca_base_requested ) {
3697 release_mem_region(info->phys_sca_base + info->sca_offset,SCA_BASE_SIZE); 3698 release_mem_region(info->phys_sca_base + info->sca_offset,SCA_BASE_SIZE);
3698 info->sca_base_requested = 0; 3699 info->sca_base_requested = false;
3699 } 3700 }
3700 if ( info->sca_statctrl_requested ) { 3701 if ( info->sca_statctrl_requested ) {
3701 release_mem_region(info->phys_statctrl_base + info->statctrl_offset,SCA_REG_SIZE); 3702 release_mem_region(info->phys_statctrl_base + info->statctrl_offset,SCA_REG_SIZE);
3702 info->sca_statctrl_requested = 0; 3703 info->sca_statctrl_requested = false;
3703 } 3704 }
3704 3705
3705 if (info->memory_base){ 3706 if (info->memory_base){
@@ -3902,7 +3903,7 @@ void device_init(int adapter_num, struct pci_dev *pdev)
3902 port_array[0]->irq_level ); 3903 port_array[0]->irq_level );
3903 } 3904 }
3904 else { 3905 else {
3905 port_array[0]->irq_requested = 1; 3906 port_array[0]->irq_requested = true;
3906 adapter_test(port_array[0]); 3907 adapter_test(port_array[0]);
3907 } 3908 }
3908 } 3909 }
@@ -4155,8 +4156,8 @@ void rx_stop(SLMP_INFO *info)
4155 write_reg(info, RXDMA + DCMD, SWABORT); /* reset/init Rx DMA */ 4156 write_reg(info, RXDMA + DCMD, SWABORT); /* reset/init Rx DMA */
4156 write_reg(info, RXDMA + DIR, 0); /* disable Rx DMA interrupts */ 4157 write_reg(info, RXDMA + DIR, 0); /* disable Rx DMA interrupts */
4157 4158
4158 info->rx_enabled = 0; 4159 info->rx_enabled = false;
4159 info->rx_overflow = 0; 4160 info->rx_overflow = false;
4160} 4161}
4161 4162
4162/* enable the receiver 4163/* enable the receiver
@@ -4211,8 +4212,8 @@ void rx_start(SLMP_INFO *info)
4211 4212
4212 write_reg(info, CMD, RXENABLE); 4213 write_reg(info, CMD, RXENABLE);
4213 4214
4214 info->rx_overflow = FALSE; 4215 info->rx_overflow = false;
4215 info->rx_enabled = 1; 4216 info->rx_enabled = true;
4216} 4217}
4217 4218
4218/* Enable the transmitter and send a transmit frame if 4219/* Enable the transmitter and send a transmit frame if
@@ -4227,7 +4228,7 @@ void tx_start(SLMP_INFO *info)
4227 if (!info->tx_enabled ) { 4228 if (!info->tx_enabled ) {
4228 write_reg(info, CMD, TXRESET); 4229 write_reg(info, CMD, TXRESET);
4229 write_reg(info, CMD, TXENABLE); 4230 write_reg(info, CMD, TXENABLE);
4230 info->tx_enabled = TRUE; 4231 info->tx_enabled = true;
4231 } 4232 }
4232 4233
4233 if ( info->tx_count ) { 4234 if ( info->tx_count ) {
@@ -4236,7 +4237,7 @@ void tx_start(SLMP_INFO *info)
4236 /* RTS and set a flag indicating that the driver should */ 4237 /* RTS and set a flag indicating that the driver should */
4237 /* negate RTS when the transmission completes. */ 4238 /* negate RTS when the transmission completes. */
4238 4239
4239 info->drop_rts_on_tx_done = 0; 4240 info->drop_rts_on_tx_done = false;
4240 4241
4241 if (info->params.mode != MGSL_MODE_ASYNC) { 4242 if (info->params.mode != MGSL_MODE_ASYNC) {
4242 4243
@@ -4245,7 +4246,7 @@ void tx_start(SLMP_INFO *info)
4245 if ( !(info->serial_signals & SerialSignal_RTS) ) { 4246 if ( !(info->serial_signals & SerialSignal_RTS) ) {
4246 info->serial_signals |= SerialSignal_RTS; 4247 info->serial_signals |= SerialSignal_RTS;
4247 set_signals( info ); 4248 set_signals( info );
4248 info->drop_rts_on_tx_done = 1; 4249 info->drop_rts_on_tx_done = true;
4249 } 4250 }
4250 } 4251 }
4251 4252
@@ -4282,7 +4283,7 @@ void tx_start(SLMP_INFO *info)
4282 write_reg(info, IE0, info->ie0_value); 4283 write_reg(info, IE0, info->ie0_value);
4283 } 4284 }
4284 4285
4285 info->tx_active = 1; 4286 info->tx_active = true;
4286 } 4287 }
4287} 4288}
4288 4289
@@ -4308,8 +4309,8 @@ void tx_stop( SLMP_INFO *info )
4308 info->ie0_value &= ~TXRDYE; 4309 info->ie0_value &= ~TXRDYE;
4309 write_reg(info, IE0, info->ie0_value); /* disable tx data interrupts */ 4310 write_reg(info, IE0, info->ie0_value); /* disable tx data interrupts */
4310 4311
4311 info->tx_enabled = 0; 4312 info->tx_enabled = false;
4312 info->tx_active = 0; 4313 info->tx_active = false;
4313} 4314}
4314 4315
4315/* Fill the transmit FIFO until the FIFO is full or 4316/* Fill the transmit FIFO until the FIFO is full or
@@ -4832,14 +4833,14 @@ void rx_reset_buffers(SLMP_INFO *info)
4832 */ 4833 */
4833void rx_free_frame_buffers(SLMP_INFO *info, unsigned int first, unsigned int last) 4834void rx_free_frame_buffers(SLMP_INFO *info, unsigned int first, unsigned int last)
4834{ 4835{
4835 int done = 0; 4836 bool done = false;
4836 4837
4837 while(!done) { 4838 while(!done) {
4838 /* reset current buffer for reuse */ 4839 /* reset current buffer for reuse */
4839 info->rx_buf_list[first].status = 0xff; 4840 info->rx_buf_list[first].status = 0xff;
4840 4841
4841 if (first == last) { 4842 if (first == last) {
4842 done = 1; 4843 done = true;
4843 /* set new last rx descriptor address */ 4844 /* set new last rx descriptor address */
4844 write_reg16(info, RXDMA + EDA, info->rx_buf_list_ex[first].phys_entry); 4845 write_reg16(info, RXDMA + EDA, info->rx_buf_list_ex[first].phys_entry);
4845 } 4846 }
@@ -4856,14 +4857,14 @@ void rx_free_frame_buffers(SLMP_INFO *info, unsigned int first, unsigned int las
4856/* Return a received frame from the receive DMA buffers. 4857/* Return a received frame from the receive DMA buffers.
4857 * Only frames received without errors are returned. 4858 * Only frames received without errors are returned.
4858 * 4859 *
4859 * Return Value: 1 if frame returned, otherwise 0 4860 * Return Value: true if frame returned, otherwise false
4860 */ 4861 */
4861int rx_get_frame(SLMP_INFO *info) 4862bool rx_get_frame(SLMP_INFO *info)
4862{ 4863{
4863 unsigned int StartIndex, EndIndex; /* index of 1st and last buffers of Rx frame */ 4864 unsigned int StartIndex, EndIndex; /* index of 1st and last buffers of Rx frame */
4864 unsigned short status; 4865 unsigned short status;
4865 unsigned int framesize = 0; 4866 unsigned int framesize = 0;
4866 int ReturnCode = 0; 4867 bool ReturnCode = false;
4867 unsigned long flags; 4868 unsigned long flags;
4868 struct tty_struct *tty = info->tty; 4869 struct tty_struct *tty = info->tty;
4869 unsigned char addr_field = 0xff; 4870 unsigned char addr_field = 0xff;
@@ -5014,7 +5015,7 @@ CheckAgain:
5014 /* Free the buffers used by this frame. */ 5015 /* Free the buffers used by this frame. */
5015 rx_free_frame_buffers( info, StartIndex, EndIndex ); 5016 rx_free_frame_buffers( info, StartIndex, EndIndex );
5016 5017
5017 ReturnCode = 1; 5018 ReturnCode = true;
5018 5019
5019Cleanup: 5020Cleanup:
5020 if ( info->rx_enabled && info->rx_overflow ) { 5021 if ( info->rx_enabled && info->rx_overflow ) {
@@ -5073,12 +5074,12 @@ void tx_load_dma_buffer(SLMP_INFO *info, const char *buf, unsigned int count)
5073 info->last_tx_buf = ++i; 5074 info->last_tx_buf = ++i;
5074} 5075}
5075 5076
5076int register_test(SLMP_INFO *info) 5077bool register_test(SLMP_INFO *info)
5077{ 5078{
5078 static unsigned char testval[] = {0x00, 0xff, 0xaa, 0x55, 0x69, 0x96}; 5079 static unsigned char testval[] = {0x00, 0xff, 0xaa, 0x55, 0x69, 0x96};
5079 static unsigned int count = ARRAY_SIZE(testval); 5080 static unsigned int count = ARRAY_SIZE(testval);
5080 unsigned int i; 5081 unsigned int i;
5081 int rc = TRUE; 5082 bool rc = true;
5082 unsigned long flags; 5083 unsigned long flags;
5083 5084
5084 spin_lock_irqsave(&info->lock,flags); 5085 spin_lock_irqsave(&info->lock,flags);
@@ -5101,7 +5102,7 @@ int register_test(SLMP_INFO *info)
5101 (read_reg(info, SA0) != testval[(i+2)%count]) || 5102 (read_reg(info, SA0) != testval[(i+2)%count]) ||
5102 (read_reg(info, SA1) != testval[(i+3)%count]) ) 5103 (read_reg(info, SA1) != testval[(i+3)%count]) )
5103 { 5104 {
5104 rc = FALSE; 5105 rc = false;
5105 break; 5106 break;
5106 } 5107 }
5107 } 5108 }
@@ -5112,7 +5113,7 @@ int register_test(SLMP_INFO *info)
5112 return rc; 5113 return rc;
5113} 5114}
5114 5115
5115int irq_test(SLMP_INFO *info) 5116bool irq_test(SLMP_INFO *info)
5116{ 5117{
5117 unsigned long timeout; 5118 unsigned long timeout;
5118 unsigned long flags; 5119 unsigned long flags;
@@ -5124,7 +5125,7 @@ int irq_test(SLMP_INFO *info)
5124 5125
5125 /* assume failure */ 5126 /* assume failure */
5126 info->init_error = DiagStatus_IrqFailure; 5127 info->init_error = DiagStatus_IrqFailure;
5127 info->irq_occurred = FALSE; 5128 info->irq_occurred = false;
5128 5129
5129 /* setup timer0 on SCA0 to interrupt */ 5130 /* setup timer0 on SCA0 to interrupt */
5130 5131
@@ -5163,7 +5164,7 @@ int irq_test(SLMP_INFO *info)
5163 5164
5164/* initialize individual SCA device (2 ports) 5165/* initialize individual SCA device (2 ports)
5165 */ 5166 */
5166static int sca_init(SLMP_INFO *info) 5167static bool sca_init(SLMP_INFO *info)
5167{ 5168{
5168 /* set wait controller to single mem partition (low), no wait states */ 5169 /* set wait controller to single mem partition (low), no wait states */
5169 write_reg(info, PABR0, 0); /* wait controller addr boundary 0 */ 5170 write_reg(info, PABR0, 0); /* wait controller addr boundary 0 */
@@ -5199,12 +5200,12 @@ static int sca_init(SLMP_INFO *info)
5199 */ 5200 */
5200 write_reg(info, ITCR, 0); 5201 write_reg(info, ITCR, 0);
5201 5202
5202 return TRUE; 5203 return true;
5203} 5204}
5204 5205
5205/* initialize adapter hardware 5206/* initialize adapter hardware
5206 */ 5207 */
5207int init_adapter(SLMP_INFO *info) 5208bool init_adapter(SLMP_INFO *info)
5208{ 5209{
5209 int i; 5210 int i;
5210 5211
@@ -5257,20 +5258,20 @@ int init_adapter(SLMP_INFO *info)
5257 sca_init(info->port_array[0]); 5258 sca_init(info->port_array[0]);
5258 sca_init(info->port_array[2]); 5259 sca_init(info->port_array[2]);
5259 5260
5260 return TRUE; 5261 return true;
5261} 5262}
5262 5263
5263/* Loopback an HDLC frame to test the hardware 5264/* Loopback an HDLC frame to test the hardware
5264 * interrupt and DMA functions. 5265 * interrupt and DMA functions.
5265 */ 5266 */
5266int loopback_test(SLMP_INFO *info) 5267bool loopback_test(SLMP_INFO *info)
5267{ 5268{
5268#define TESTFRAMESIZE 20 5269#define TESTFRAMESIZE 20
5269 5270
5270 unsigned long timeout; 5271 unsigned long timeout;
5271 u16 count = TESTFRAMESIZE; 5272 u16 count = TESTFRAMESIZE;
5272 unsigned char buf[TESTFRAMESIZE]; 5273 unsigned char buf[TESTFRAMESIZE];
5273 int rc = FALSE; 5274 bool rc = false;
5274 unsigned long flags; 5275 unsigned long flags;
5275 5276
5276 struct tty_struct *oldtty = info->tty; 5277 struct tty_struct *oldtty = info->tty;
@@ -5304,16 +5305,16 @@ int loopback_test(SLMP_INFO *info)
5304 msleep_interruptible(10); 5305 msleep_interruptible(10);
5305 5306
5306 if (rx_get_frame(info)) { 5307 if (rx_get_frame(info)) {
5307 rc = TRUE; 5308 rc = true;
5308 break; 5309 break;
5309 } 5310 }
5310 } 5311 }
5311 5312
5312 /* verify received frame length and contents */ 5313 /* verify received frame length and contents */
5313 if (rc == TRUE && 5314 if (rc &&
5314 ( info->tmp_rx_buf_count != count || 5315 ( info->tmp_rx_buf_count != count ||
5315 memcmp(buf, info->tmp_rx_buf,count))) { 5316 memcmp(buf, info->tmp_rx_buf,count))) {
5316 rc = FALSE; 5317 rc = false;
5317 } 5318 }
5318 5319
5319 spin_lock_irqsave(&info->lock,flags); 5320 spin_lock_irqsave(&info->lock,flags);
@@ -5390,7 +5391,7 @@ int adapter_test( SLMP_INFO *info )
5390 5391
5391/* Test the shared memory on a PCI adapter. 5392/* Test the shared memory on a PCI adapter.
5392 */ 5393 */
5393int memory_test(SLMP_INFO *info) 5394bool memory_test(SLMP_INFO *info)
5394{ 5395{
5395 static unsigned long testval[] = { 0x0, 0x55555555, 0xaaaaaaaa, 5396 static unsigned long testval[] = { 0x0, 0x55555555, 0xaaaaaaaa,
5396 0x66666666, 0x99999999, 0xffffffff, 0x12345678 }; 5397 0x66666666, 0x99999999, 0xffffffff, 0x12345678 };
@@ -5404,7 +5405,7 @@ int memory_test(SLMP_INFO *info)
5404 for ( i = 0 ; i < count ; i++ ) { 5405 for ( i = 0 ; i < count ; i++ ) {
5405 *addr = testval[i]; 5406 *addr = testval[i];
5406 if ( *addr != testval[i] ) 5407 if ( *addr != testval[i] )
5407 return FALSE; 5408 return false;
5408 } 5409 }
5409 5410
5410 /* Test address lines with incrementing pattern over */ 5411 /* Test address lines with incrementing pattern over */
@@ -5419,12 +5420,12 @@ int memory_test(SLMP_INFO *info)
5419 5420
5420 for ( i = 0 ; i < limit ; i++ ) { 5421 for ( i = 0 ; i < limit ; i++ ) {
5421 if ( *addr != i * 4 ) 5422 if ( *addr != i * 4 )
5422 return FALSE; 5423 return false;
5423 addr++; 5424 addr++;
5424 } 5425 }
5425 5426
5426 memset( info->memory_base, 0, SCA_MEM_SIZE ); 5427 memset( info->memory_base, 0, SCA_MEM_SIZE );
5427 return TRUE; 5428 return true;
5428} 5429}
5429 5430
5430/* Load data into PCI adapter shared memory. 5431/* Load data into PCI adapter shared memory.
@@ -5508,7 +5509,7 @@ void tx_timeout(unsigned long context)
5508 info->icount.txtimeout++; 5509 info->icount.txtimeout++;
5509 } 5510 }
5510 spin_lock_irqsave(&info->lock,flags); 5511 spin_lock_irqsave(&info->lock,flags);
5511 info->tx_active = 0; 5512 info->tx_active = false;
5512 info->tx_count = info->tx_put = info->tx_get = 0; 5513 info->tx_count = info->tx_put = info->tx_get = 0;
5513 5514
5514 spin_unlock_irqrestore(&info->lock,flags); 5515 spin_unlock_irqrestore(&info->lock,flags);