aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/synclink.c
diff options
context:
space:
mode:
authorAlexandru Juncu <alexj@rosedu.org>2013-07-27 04:14:39 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-29 15:47:37 -0400
commite06922aa836f098c4893218a1c656ce7d73a3b6a (patch)
tree948d19696992bb43a89f07a41ef7a5b9b523f413 /drivers/tty/synclink.c
parentc29782965b428d647742c5f22d9eca7a2d0f820f (diff)
TTY: synclink: replace bitmasks add operation with OR operation.
Found with coccinelle, manually fixed and verified. Signed-off-by: Alexandru Juncu <alexj@rosedu.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/synclink.c')
-rw-r--r--drivers/tty/synclink.c130
1 files changed, 65 insertions, 65 deletions
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index 8eaf1ab8addb..e1ce141bad5e 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -577,22 +577,22 @@ struct mgsl_struct {
577 577
578#define SICR_RXC_ACTIVE BIT15 578#define SICR_RXC_ACTIVE BIT15
579#define SICR_RXC_INACTIVE BIT14 579#define SICR_RXC_INACTIVE BIT14
580#define SICR_RXC (BIT15+BIT14) 580#define SICR_RXC (BIT15|BIT14)
581#define SICR_TXC_ACTIVE BIT13 581#define SICR_TXC_ACTIVE BIT13
582#define SICR_TXC_INACTIVE BIT12 582#define SICR_TXC_INACTIVE BIT12
583#define SICR_TXC (BIT13+BIT12) 583#define SICR_TXC (BIT13|BIT12)
584#define SICR_RI_ACTIVE BIT11 584#define SICR_RI_ACTIVE BIT11
585#define SICR_RI_INACTIVE BIT10 585#define SICR_RI_INACTIVE BIT10
586#define SICR_RI (BIT11+BIT10) 586#define SICR_RI (BIT11|BIT10)
587#define SICR_DSR_ACTIVE BIT9 587#define SICR_DSR_ACTIVE BIT9
588#define SICR_DSR_INACTIVE BIT8 588#define SICR_DSR_INACTIVE BIT8
589#define SICR_DSR (BIT9+BIT8) 589#define SICR_DSR (BIT9|BIT8)
590#define SICR_DCD_ACTIVE BIT7 590#define SICR_DCD_ACTIVE BIT7
591#define SICR_DCD_INACTIVE BIT6 591#define SICR_DCD_INACTIVE BIT6
592#define SICR_DCD (BIT7+BIT6) 592#define SICR_DCD (BIT7|BIT6)
593#define SICR_CTS_ACTIVE BIT5 593#define SICR_CTS_ACTIVE BIT5
594#define SICR_CTS_INACTIVE BIT4 594#define SICR_CTS_INACTIVE BIT4
595#define SICR_CTS (BIT5+BIT4) 595#define SICR_CTS (BIT5|BIT4)
596#define SICR_RCC_UNDERFLOW BIT3 596#define SICR_RCC_UNDERFLOW BIT3
597#define SICR_DPLL_NO_SYNC BIT2 597#define SICR_DPLL_NO_SYNC BIT2
598#define SICR_BRG1_ZERO BIT1 598#define SICR_BRG1_ZERO BIT1
@@ -1161,7 +1161,7 @@ static void mgsl_isr_receive_status( struct mgsl_struct *info )
1161{ 1161{
1162 u16 status = usc_InReg( info, RCSR ); 1162 u16 status = usc_InReg( info, RCSR );
1163 1163
1164 if ( debug_level >= DEBUG_LEVEL_ISR ) 1164 if ( debug_level >= DEBUG_LEVEL_ISR )
1165 printk("%s(%d):mgsl_isr_receive_status status=%04X\n", 1165 printk("%s(%d):mgsl_isr_receive_status status=%04X\n",
1166 __FILE__,__LINE__,status); 1166 __FILE__,__LINE__,status);
1167 1167
@@ -1181,7 +1181,7 @@ static void mgsl_isr_receive_status( struct mgsl_struct *info )
1181 (usc_InReg(info, RICR) & ~RXSTATUS_ABORT_RECEIVED)); 1181 (usc_InReg(info, RICR) & ~RXSTATUS_ABORT_RECEIVED));
1182 } 1182 }
1183 1183
1184 if (status & (RXSTATUS_EXITED_HUNT + RXSTATUS_IDLE_RECEIVED)) { 1184 if (status & (RXSTATUS_EXITED_HUNT | RXSTATUS_IDLE_RECEIVED)) {
1185 if (status & RXSTATUS_EXITED_HUNT) 1185 if (status & RXSTATUS_EXITED_HUNT)
1186 info->icount.exithunt++; 1186 info->icount.exithunt++;
1187 if (status & RXSTATUS_IDLE_RECEIVED) 1187 if (status & RXSTATUS_IDLE_RECEIVED)
@@ -1463,21 +1463,21 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info )
1463 1463
1464 /* get the status of the received byte */ 1464 /* get the status of the received byte */
1465 status = usc_InReg(info, RCSR); 1465 status = usc_InReg(info, RCSR);
1466 if ( status & (RXSTATUS_FRAMING_ERROR + RXSTATUS_PARITY_ERROR + 1466 if ( status & (RXSTATUS_FRAMING_ERROR | RXSTATUS_PARITY_ERROR |
1467 RXSTATUS_OVERRUN + RXSTATUS_BREAK_RECEIVED) ) 1467 RXSTATUS_OVERRUN | RXSTATUS_BREAK_RECEIVED) )
1468 usc_UnlatchRxstatusBits(info,RXSTATUS_ALL); 1468 usc_UnlatchRxstatusBits(info,RXSTATUS_ALL);
1469 1469
1470 icount->rx++; 1470 icount->rx++;
1471 1471
1472 flag = 0; 1472 flag = 0;
1473 if ( status & (RXSTATUS_FRAMING_ERROR + RXSTATUS_PARITY_ERROR + 1473 if ( status & (RXSTATUS_FRAMING_ERROR | RXSTATUS_PARITY_ERROR |
1474 RXSTATUS_OVERRUN + RXSTATUS_BREAK_RECEIVED) ) { 1474 RXSTATUS_OVERRUN | RXSTATUS_BREAK_RECEIVED) ) {
1475 printk("rxerr=%04X\n",status); 1475 printk("rxerr=%04X\n",status);
1476 /* update error statistics */ 1476 /* update error statistics */
1477 if ( status & RXSTATUS_BREAK_RECEIVED ) { 1477 if ( status & RXSTATUS_BREAK_RECEIVED ) {
1478 status &= ~(RXSTATUS_FRAMING_ERROR + RXSTATUS_PARITY_ERROR); 1478 status &= ~(RXSTATUS_FRAMING_ERROR | RXSTATUS_PARITY_ERROR);
1479 icount->brk++; 1479 icount->brk++;
1480 } else if (status & RXSTATUS_PARITY_ERROR) 1480 } else if (status & RXSTATUS_PARITY_ERROR)
1481 icount->parity++; 1481 icount->parity++;
1482 else if (status & RXSTATUS_FRAMING_ERROR) 1482 else if (status & RXSTATUS_FRAMING_ERROR)
1483 icount->frame++; 1483 icount->frame++;
@@ -1488,7 +1488,7 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info )
1488 icount->overrun++; 1488 icount->overrun++;
1489 } 1489 }
1490 1490
1491 /* discard char if tty control flags say so */ 1491 /* discard char if tty control flags say so */
1492 if (status & info->ignore_status_mask) 1492 if (status & info->ignore_status_mask)
1493 continue; 1493 continue;
1494 1494
@@ -1545,8 +1545,8 @@ static void mgsl_isr_misc( struct mgsl_struct *info )
1545 usc_EnableReceiver(info,DISABLE_UNCONDITIONAL); 1545 usc_EnableReceiver(info,DISABLE_UNCONDITIONAL);
1546 usc_DmaCmd(info, DmaCmd_ResetRxChannel); 1546 usc_DmaCmd(info, DmaCmd_ResetRxChannel);
1547 usc_UnlatchRxstatusBits(info, RXSTATUS_ALL); 1547 usc_UnlatchRxstatusBits(info, RXSTATUS_ALL);
1548 usc_ClearIrqPendingBits(info, RECEIVE_DATA + RECEIVE_STATUS); 1548 usc_ClearIrqPendingBits(info, RECEIVE_DATA | RECEIVE_STATUS);
1549 usc_DisableInterrupts(info, RECEIVE_DATA + RECEIVE_STATUS); 1549 usc_DisableInterrupts(info, RECEIVE_DATA | RECEIVE_STATUS);
1550 1550
1551 /* schedule BH handler to restart receiver */ 1551 /* schedule BH handler to restart receiver */
1552 info->pending_bh |= BH_RECEIVE; 1552 info->pending_bh |= BH_RECEIVE;
@@ -1595,7 +1595,7 @@ static void mgsl_isr_receive_dma( struct mgsl_struct *info )
1595 u16 status; 1595 u16 status;
1596 1596
1597 /* clear interrupt pending and IUS bit for Rx DMA IRQ */ 1597 /* clear interrupt pending and IUS bit for Rx DMA IRQ */
1598 usc_OutDmaReg( info, CDIR, BIT9+BIT1 ); 1598 usc_OutDmaReg( info, CDIR, BIT9 | BIT1 );
1599 1599
1600 /* Read the receive DMA status to identify interrupt type. */ 1600 /* Read the receive DMA status to identify interrupt type. */
1601 /* This also clears the status bits. */ 1601 /* This also clears the status bits. */
@@ -1639,7 +1639,7 @@ static void mgsl_isr_transmit_dma( struct mgsl_struct *info )
1639 u16 status; 1639 u16 status;
1640 1640
1641 /* clear interrupt pending and IUS bit for Tx DMA IRQ */ 1641 /* clear interrupt pending and IUS bit for Tx DMA IRQ */
1642 usc_OutDmaReg(info, CDIR, BIT8+BIT0 ); 1642 usc_OutDmaReg(info, CDIR, BIT8 | BIT0 );
1643 1643
1644 /* Read the transmit DMA status to identify interrupt type. */ 1644 /* Read the transmit DMA status to identify interrupt type. */
1645 /* This also clears the status bits. */ 1645 /* This also clears the status bits. */
@@ -1832,8 +1832,8 @@ static void shutdown(struct mgsl_struct * info)
1832 usc_DisableMasterIrqBit(info); 1832 usc_DisableMasterIrqBit(info);
1833 usc_stop_receiver(info); 1833 usc_stop_receiver(info);
1834 usc_stop_transmitter(info); 1834 usc_stop_transmitter(info);
1835 usc_DisableInterrupts(info,RECEIVE_DATA + RECEIVE_STATUS + 1835 usc_DisableInterrupts(info,RECEIVE_DATA | RECEIVE_STATUS |
1836 TRANSMIT_DATA + TRANSMIT_STATUS + IO_PIN + MISC ); 1836 TRANSMIT_DATA | TRANSMIT_STATUS | IO_PIN | MISC );
1837 usc_DisableDmaInterrupts(info,DICR_MASTER + DICR_TRANSMIT + DICR_RECEIVE); 1837 usc_DisableDmaInterrupts(info,DICR_MASTER + DICR_TRANSMIT + DICR_RECEIVE);
1838 1838
1839 /* Disable DMAEN (Port 7, Bit 14) */ 1839 /* Disable DMAEN (Port 7, Bit 14) */
@@ -1886,7 +1886,7 @@ static void mgsl_program_hw(struct mgsl_struct *info)
1886 info->ri_chkcount = 0; 1886 info->ri_chkcount = 0;
1887 info->dsr_chkcount = 0; 1887 info->dsr_chkcount = 0;
1888 1888
1889 usc_EnableStatusIrqs(info,SICR_CTS+SICR_DSR+SICR_DCD+SICR_RI); 1889 usc_EnableStatusIrqs(info,SICR_CTS+SICR_DSR+SICR_DCD+SICR_RI);
1890 usc_EnableInterrupts(info, IO_PIN); 1890 usc_EnableInterrupts(info, IO_PIN);
1891 usc_get_serial_signals(info); 1891 usc_get_serial_signals(info);
1892 1892
@@ -2773,7 +2773,7 @@ static int mgsl_wait_event(struct mgsl_struct * info, int __user * mask_ptr)
2773 if (!waitqueue_active(&info->event_wait_q)) { 2773 if (!waitqueue_active(&info->event_wait_q)) {
2774 /* disable enable exit hunt mode/idle rcvd IRQs */ 2774 /* disable enable exit hunt mode/idle rcvd IRQs */
2775 usc_OutReg(info, RICR, usc_InReg(info,RICR) & 2775 usc_OutReg(info, RICR, usc_InReg(info,RICR) &
2776 ~(RXSTATUS_EXITED_HUNT + RXSTATUS_IDLE_RECEIVED)); 2776 ~(RXSTATUS_EXITED_HUNT | RXSTATUS_IDLE_RECEIVED));
2777 } 2777 }
2778 spin_unlock_irqrestore(&info->irq_spinlock,flags); 2778 spin_unlock_irqrestore(&info->irq_spinlock,flags);
2779 } 2779 }
@@ -3092,7 +3092,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
3092 printk("%s(%d):mgsl_close(%s) entry, count=%d\n", 3092 printk("%s(%d):mgsl_close(%s) entry, count=%d\n",
3093 __FILE__,__LINE__, info->device_name, info->port.count); 3093 __FILE__,__LINE__, info->device_name, info->port.count);
3094 3094
3095 if (tty_port_close_start(&info->port, tty, filp) == 0) 3095 if (tty_port_close_start(&info->port, tty, filp) == 0)
3096 goto cleanup; 3096 goto cleanup;
3097 3097
3098 mutex_lock(&info->port.mutex); 3098 mutex_lock(&info->port.mutex);
@@ -4297,7 +4297,7 @@ static struct mgsl_struct* mgsl_allocate_device(void)
4297 spin_lock_init(&info->irq_spinlock); 4297 spin_lock_init(&info->irq_spinlock);
4298 spin_lock_init(&info->netlock); 4298 spin_lock_init(&info->netlock);
4299 memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS)); 4299 memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS));
4300 info->idle_mode = HDLC_TXIDLE_FLAGS; 4300 info->idle_mode = HDLC_TXIDLE_FLAGS;
4301 info->num_tx_dma_buffers = 1; 4301 info->num_tx_dma_buffers = 1;
4302 info->num_tx_holding_buffers = 0; 4302 info->num_tx_holding_buffers = 0;
4303 } 4303 }
@@ -4722,7 +4722,7 @@ static void usc_set_sdlc_mode( struct mgsl_struct *info )
4722 else if ( info->params.flags & HDLC_FLAG_UNDERRUN_FLAG ) 4722 else if ( info->params.flags & HDLC_FLAG_UNDERRUN_FLAG )
4723 RegValue |= BIT15; 4723 RegValue |= BIT15;
4724 else if ( info->params.flags & HDLC_FLAG_UNDERRUN_CRC ) 4724 else if ( info->params.flags & HDLC_FLAG_UNDERRUN_CRC )
4725 RegValue |= BIT15 + BIT14; 4725 RegValue |= BIT15 | BIT14;
4726 } 4726 }
4727 4727
4728 if ( info->params.preamble != HDLC_PREAMBLE_PATTERN_NONE ) 4728 if ( info->params.preamble != HDLC_PREAMBLE_PATTERN_NONE )
@@ -4763,11 +4763,11 @@ static void usc_set_sdlc_mode( struct mgsl_struct *info )
4763 switch ( info->params.encoding ) { 4763 switch ( info->params.encoding ) {
4764 case HDLC_ENCODING_NRZB: RegValue |= BIT13; break; 4764 case HDLC_ENCODING_NRZB: RegValue |= BIT13; break;
4765 case HDLC_ENCODING_NRZI_MARK: RegValue |= BIT14; break; 4765 case HDLC_ENCODING_NRZI_MARK: RegValue |= BIT14; break;
4766 case HDLC_ENCODING_NRZI_SPACE: RegValue |= BIT14 + BIT13; break; 4766 case HDLC_ENCODING_NRZI_SPACE: RegValue |= BIT14 | BIT13; break;
4767 case HDLC_ENCODING_BIPHASE_MARK: RegValue |= BIT15; break; 4767 case HDLC_ENCODING_BIPHASE_MARK: RegValue |= BIT15; break;
4768 case HDLC_ENCODING_BIPHASE_SPACE: RegValue |= BIT15 + BIT13; break; 4768 case HDLC_ENCODING_BIPHASE_SPACE: RegValue |= BIT15 | BIT13; break;
4769 case HDLC_ENCODING_BIPHASE_LEVEL: RegValue |= BIT15 + BIT14; break; 4769 case HDLC_ENCODING_BIPHASE_LEVEL: RegValue |= BIT15 | BIT14; break;
4770 case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT15 + BIT14 + BIT13; break; 4770 case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT15 | BIT14 | BIT13; break;
4771 } 4771 }
4772 4772
4773 if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_16_CCITT ) 4773 if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_16_CCITT )
@@ -4838,15 +4838,15 @@ static void usc_set_sdlc_mode( struct mgsl_struct *info )
4838 switch ( info->params.encoding ) { 4838 switch ( info->params.encoding ) {
4839 case HDLC_ENCODING_NRZB: RegValue |= BIT13; break; 4839 case HDLC_ENCODING_NRZB: RegValue |= BIT13; break;
4840 case HDLC_ENCODING_NRZI_MARK: RegValue |= BIT14; break; 4840 case HDLC_ENCODING_NRZI_MARK: RegValue |= BIT14; break;
4841 case HDLC_ENCODING_NRZI_SPACE: RegValue |= BIT14 + BIT13; break; 4841 case HDLC_ENCODING_NRZI_SPACE: RegValue |= BIT14 | BIT13; break;
4842 case HDLC_ENCODING_BIPHASE_MARK: RegValue |= BIT15; break; 4842 case HDLC_ENCODING_BIPHASE_MARK: RegValue |= BIT15; break;
4843 case HDLC_ENCODING_BIPHASE_SPACE: RegValue |= BIT15 + BIT13; break; 4843 case HDLC_ENCODING_BIPHASE_SPACE: RegValue |= BIT15 | BIT13; break;
4844 case HDLC_ENCODING_BIPHASE_LEVEL: RegValue |= BIT15 + BIT14; break; 4844 case HDLC_ENCODING_BIPHASE_LEVEL: RegValue |= BIT15 | BIT14; break;
4845 case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT15 + BIT14 + BIT13; break; 4845 case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT15 | BIT14 | BIT13; break;
4846 } 4846 }
4847 4847
4848 if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_16_CCITT ) 4848 if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_16_CCITT )
4849 RegValue |= BIT9 + BIT8; 4849 RegValue |= BIT9 | BIT8;
4850 else if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_32_CCITT ) 4850 else if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_32_CCITT )
4851 RegValue |= ( BIT12 | BIT10 | BIT9 | BIT8); 4851 RegValue |= ( BIT12 | BIT10 | BIT9 | BIT8);
4852 4852
@@ -4957,7 +4957,7 @@ static void usc_set_sdlc_mode( struct mgsl_struct *info )
4957 4957
4958 RegValue = 0x0000; 4958 RegValue = 0x0000;
4959 4959
4960 if ( info->params.flags & (HDLC_FLAG_RXC_DPLL + HDLC_FLAG_TXC_DPLL) ) { 4960 if ( info->params.flags & (HDLC_FLAG_RXC_DPLL | HDLC_FLAG_TXC_DPLL) ) {
4961 u32 XtalSpeed; 4961 u32 XtalSpeed;
4962 u32 DpllDivisor; 4962 u32 DpllDivisor;
4963 u16 Tc; 4963 u16 Tc;
@@ -5019,7 +5019,7 @@ static void usc_set_sdlc_mode( struct mgsl_struct *info )
5019 case HDLC_ENCODING_BIPHASE_MARK: 5019 case HDLC_ENCODING_BIPHASE_MARK:
5020 case HDLC_ENCODING_BIPHASE_SPACE: RegValue |= BIT9; break; 5020 case HDLC_ENCODING_BIPHASE_SPACE: RegValue |= BIT9; break;
5021 case HDLC_ENCODING_BIPHASE_LEVEL: 5021 case HDLC_ENCODING_BIPHASE_LEVEL:
5022 case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT9 + BIT8; break; 5022 case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT9 | BIT8; break;
5023 } 5023 }
5024 } 5024 }
5025 5025
@@ -5056,8 +5056,8 @@ static void usc_set_sdlc_mode( struct mgsl_struct *info )
5056 /* enable Master Interrupt Enable bit (MIE) */ 5056 /* enable Master Interrupt Enable bit (MIE) */
5057 usc_EnableMasterIrqBit( info ); 5057 usc_EnableMasterIrqBit( info );
5058 5058
5059 usc_ClearIrqPendingBits( info, RECEIVE_STATUS + RECEIVE_DATA + 5059 usc_ClearIrqPendingBits( info, RECEIVE_STATUS | RECEIVE_DATA |
5060 TRANSMIT_STATUS + TRANSMIT_DATA + MISC); 5060 TRANSMIT_STATUS | TRANSMIT_DATA | MISC);
5061 5061
5062 /* arm RCC underflow interrupt */ 5062 /* arm RCC underflow interrupt */
5063 usc_OutReg(info, SICR, (u16)(usc_InReg(info,SICR) | BIT3)); 5063 usc_OutReg(info, SICR, (u16)(usc_InReg(info,SICR) | BIT3));
@@ -5175,14 +5175,14 @@ static void usc_set_sdlc_mode( struct mgsl_struct *info )
5175 switch ( info->params.preamble_length ) { 5175 switch ( info->params.preamble_length ) {
5176 case HDLC_PREAMBLE_LENGTH_16BITS: RegValue |= BIT10; break; 5176 case HDLC_PREAMBLE_LENGTH_16BITS: RegValue |= BIT10; break;
5177 case HDLC_PREAMBLE_LENGTH_32BITS: RegValue |= BIT11; break; 5177 case HDLC_PREAMBLE_LENGTH_32BITS: RegValue |= BIT11; break;
5178 case HDLC_PREAMBLE_LENGTH_64BITS: RegValue |= BIT11 + BIT10; break; 5178 case HDLC_PREAMBLE_LENGTH_64BITS: RegValue |= BIT11 | BIT10; break;
5179 } 5179 }
5180 5180
5181 switch ( info->params.preamble ) { 5181 switch ( info->params.preamble ) {
5182 case HDLC_PREAMBLE_PATTERN_FLAGS: RegValue |= BIT8 + BIT12; break; 5182 case HDLC_PREAMBLE_PATTERN_FLAGS: RegValue |= BIT8 | BIT12; break;
5183 case HDLC_PREAMBLE_PATTERN_ONES: RegValue |= BIT8; break; 5183 case HDLC_PREAMBLE_PATTERN_ONES: RegValue |= BIT8; break;
5184 case HDLC_PREAMBLE_PATTERN_10: RegValue |= BIT9; break; 5184 case HDLC_PREAMBLE_PATTERN_10: RegValue |= BIT9; break;
5185 case HDLC_PREAMBLE_PATTERN_01: RegValue |= BIT9 + BIT8; break; 5185 case HDLC_PREAMBLE_PATTERN_01: RegValue |= BIT9 | BIT8; break;
5186 } 5186 }
5187 5187
5188 usc_OutReg( info, CCR, RegValue ); 5188 usc_OutReg( info, CCR, RegValue );
@@ -5221,7 +5221,7 @@ static void usc_enable_loopback(struct mgsl_struct *info, int enable)
5221{ 5221{
5222 if (enable) { 5222 if (enable) {
5223 /* blank external TXD output */ 5223 /* blank external TXD output */
5224 usc_OutReg(info,IOCR,usc_InReg(info,IOCR) | (BIT7+BIT6)); 5224 usc_OutReg(info,IOCR,usc_InReg(info,IOCR) | (BIT7 | BIT6));
5225 5225
5226 /* Clock mode Control Register (CMCR) 5226 /* Clock mode Control Register (CMCR)
5227 * 5227 *
@@ -5260,7 +5260,7 @@ static void usc_enable_loopback(struct mgsl_struct *info, int enable)
5260 outw( 0x0300, info->io_base + CCAR ); 5260 outw( 0x0300, info->io_base + CCAR );
5261 } else { 5261 } else {
5262 /* enable external TXD output */ 5262 /* enable external TXD output */
5263 usc_OutReg(info,IOCR,usc_InReg(info,IOCR) & ~(BIT7+BIT6)); 5263 usc_OutReg(info,IOCR,usc_InReg(info,IOCR) & ~(BIT7 | BIT6));
5264 5264
5265 /* clear Internal Data loopback mode */ 5265 /* clear Internal Data loopback mode */
5266 info->loopback_bits = 0; 5266 info->loopback_bits = 0;
@@ -5447,13 +5447,13 @@ static void usc_process_rxoverrun_sync( struct mgsl_struct *info )
5447 usc_OutDmaReg( info, NRARU, (u16)(phys_addr >> 16) ); 5447 usc_OutDmaReg( info, NRARU, (u16)(phys_addr >> 16) );
5448 5448
5449 usc_UnlatchRxstatusBits( info, RXSTATUS_ALL ); 5449 usc_UnlatchRxstatusBits( info, RXSTATUS_ALL );
5450 usc_ClearIrqPendingBits( info, RECEIVE_DATA + RECEIVE_STATUS ); 5450 usc_ClearIrqPendingBits( info, RECEIVE_DATA | RECEIVE_STATUS );
5451 usc_EnableInterrupts( info, RECEIVE_STATUS ); 5451 usc_EnableInterrupts( info, RECEIVE_STATUS );
5452 5452
5453 /* 1. Arm End of Buffer (EOB) Receive DMA Interrupt (BIT2 of RDIAR) */ 5453 /* 1. Arm End of Buffer (EOB) Receive DMA Interrupt (BIT2 of RDIAR) */
5454 /* 2. Enable Receive DMA Interrupts (BIT1 of DICR) */ 5454 /* 2. Enable Receive DMA Interrupts (BIT1 of DICR) */
5455 5455
5456 usc_OutDmaReg( info, RDIAR, BIT3 + BIT2 ); 5456 usc_OutDmaReg( info, RDIAR, BIT3 | BIT2 );
5457 usc_OutDmaReg( info, DICR, (u16)(usc_InDmaReg(info,DICR) | BIT1) ); 5457 usc_OutDmaReg( info, DICR, (u16)(usc_InDmaReg(info,DICR) | BIT1) );
5458 usc_DmaCmd( info, DmaCmd_InitRxChannel ); 5458 usc_DmaCmd( info, DmaCmd_InitRxChannel );
5459 if ( info->params.flags & HDLC_FLAG_AUTO_DCD ) 5459 if ( info->params.flags & HDLC_FLAG_AUTO_DCD )
@@ -5488,8 +5488,8 @@ static void usc_stop_receiver( struct mgsl_struct *info )
5488 usc_DmaCmd( info, DmaCmd_ResetRxChannel ); 5488 usc_DmaCmd( info, DmaCmd_ResetRxChannel );
5489 5489
5490 usc_UnlatchRxstatusBits( info, RXSTATUS_ALL ); 5490 usc_UnlatchRxstatusBits( info, RXSTATUS_ALL );
5491 usc_ClearIrqPendingBits( info, RECEIVE_DATA + RECEIVE_STATUS ); 5491 usc_ClearIrqPendingBits( info, RECEIVE_DATA | RECEIVE_STATUS );
5492 usc_DisableInterrupts( info, RECEIVE_DATA + RECEIVE_STATUS ); 5492 usc_DisableInterrupts( info, RECEIVE_DATA | RECEIVE_STATUS );
5493 5493
5494 usc_EnableReceiver(info,DISABLE_UNCONDITIONAL); 5494 usc_EnableReceiver(info,DISABLE_UNCONDITIONAL);
5495 5495
@@ -5536,13 +5536,13 @@ static void usc_start_receiver( struct mgsl_struct *info )
5536 usc_OutDmaReg( info, NRARU, (u16)(phys_addr >> 16) ); 5536 usc_OutDmaReg( info, NRARU, (u16)(phys_addr >> 16) );
5537 5537
5538 usc_UnlatchRxstatusBits( info, RXSTATUS_ALL ); 5538 usc_UnlatchRxstatusBits( info, RXSTATUS_ALL );
5539 usc_ClearIrqPendingBits( info, RECEIVE_DATA + RECEIVE_STATUS ); 5539 usc_ClearIrqPendingBits( info, RECEIVE_DATA | RECEIVE_STATUS );
5540 usc_EnableInterrupts( info, RECEIVE_STATUS ); 5540 usc_EnableInterrupts( info, RECEIVE_STATUS );
5541 5541
5542 /* 1. Arm End of Buffer (EOB) Receive DMA Interrupt (BIT2 of RDIAR) */ 5542 /* 1. Arm End of Buffer (EOB) Receive DMA Interrupt (BIT2 of RDIAR) */
5543 /* 2. Enable Receive DMA Interrupts (BIT1 of DICR) */ 5543 /* 2. Enable Receive DMA Interrupts (BIT1 of DICR) */
5544 5544
5545 usc_OutDmaReg( info, RDIAR, BIT3 + BIT2 ); 5545 usc_OutDmaReg( info, RDIAR, BIT3 | BIT2 );
5546 usc_OutDmaReg( info, DICR, (u16)(usc_InDmaReg(info,DICR) | BIT1) ); 5546 usc_OutDmaReg( info, DICR, (u16)(usc_InDmaReg(info,DICR) | BIT1) );
5547 usc_DmaCmd( info, DmaCmd_InitRxChannel ); 5547 usc_DmaCmd( info, DmaCmd_InitRxChannel );
5548 if ( info->params.flags & HDLC_FLAG_AUTO_DCD ) 5548 if ( info->params.flags & HDLC_FLAG_AUTO_DCD )
@@ -5551,7 +5551,7 @@ static void usc_start_receiver( struct mgsl_struct *info )
5551 usc_EnableReceiver(info,ENABLE_UNCONDITIONAL); 5551 usc_EnableReceiver(info,ENABLE_UNCONDITIONAL);
5552 } else { 5552 } else {
5553 usc_UnlatchRxstatusBits(info, RXSTATUS_ALL); 5553 usc_UnlatchRxstatusBits(info, RXSTATUS_ALL);
5554 usc_ClearIrqPendingBits(info, RECEIVE_DATA + RECEIVE_STATUS); 5554 usc_ClearIrqPendingBits(info, RECEIVE_DATA | RECEIVE_STATUS);
5555 usc_EnableInterrupts(info, RECEIVE_DATA); 5555 usc_EnableInterrupts(info, RECEIVE_DATA);
5556 5556
5557 usc_RTCmd( info, RTCmd_PurgeRxFifo ); 5557 usc_RTCmd( info, RTCmd_PurgeRxFifo );
@@ -5925,7 +5925,7 @@ static void usc_set_async_mode( struct mgsl_struct *info )
5925 RegValue = 0; 5925 RegValue = 0;
5926 5926
5927 if ( info->params.data_bits != 8 ) 5927 if ( info->params.data_bits != 8 )
5928 RegValue |= BIT4+BIT3+BIT2; 5928 RegValue |= BIT4 | BIT3 | BIT2;
5929 5929
5930 if ( info->params.parity != ASYNC_PARITY_NONE ) { 5930 if ( info->params.parity != ASYNC_PARITY_NONE ) {
5931 RegValue |= BIT5; 5931 RegValue |= BIT5;
@@ -5982,7 +5982,7 @@ static void usc_set_async_mode( struct mgsl_struct *info )
5982 RegValue = 0; 5982 RegValue = 0;
5983 5983
5984 if ( info->params.data_bits != 8 ) 5984 if ( info->params.data_bits != 8 )
5985 RegValue |= BIT4+BIT3+BIT2; 5985 RegValue |= BIT4 | BIT3 | BIT2;
5986 5986
5987 if ( info->params.parity != ASYNC_PARITY_NONE ) { 5987 if ( info->params.parity != ASYNC_PARITY_NONE ) {
5988 RegValue |= BIT5; 5988 RegValue |= BIT5;
@@ -6129,7 +6129,7 @@ static void usc_loopback_frame( struct mgsl_struct *info )
6129 6129
6130 /* WAIT FOR RECEIVE COMPLETE */ 6130 /* WAIT FOR RECEIVE COMPLETE */
6131 for (i=0 ; i<1000 ; i++) 6131 for (i=0 ; i<1000 ; i++)
6132 if (usc_InReg( info, RCSR ) & (BIT8 + BIT4 + BIT3 + BIT1)) 6132 if (usc_InReg( info, RCSR ) & (BIT8 | BIT4 | BIT3 | BIT1))
6133 break; 6133 break;
6134 6134
6135 /* clear Internal Data loopback mode */ 6135 /* clear Internal Data loopback mode */
@@ -6579,8 +6579,8 @@ static bool mgsl_get_rx_frame(struct mgsl_struct *info)
6579 6579
6580 status = info->rx_buffer_list[EndIndex].status; 6580 status = info->rx_buffer_list[EndIndex].status;
6581 6581
6582 if ( status & (RXSTATUS_SHORT_FRAME + RXSTATUS_OVERRUN + 6582 if ( status & (RXSTATUS_SHORT_FRAME | RXSTATUS_OVERRUN |
6583 RXSTATUS_CRC_ERROR + RXSTATUS_ABORT) ) { 6583 RXSTATUS_CRC_ERROR | RXSTATUS_ABORT) ) {
6584 if ( status & RXSTATUS_SHORT_FRAME ) 6584 if ( status & RXSTATUS_SHORT_FRAME )
6585 info->icount.rxshort++; 6585 info->icount.rxshort++;
6586 else if ( status & RXSTATUS_ABORT ) 6586 else if ( status & RXSTATUS_ABORT )
@@ -6762,8 +6762,8 @@ static bool mgsl_get_raw_rx_frame(struct mgsl_struct *info)
6762 6762
6763 status = info->rx_buffer_list[CurrentIndex].status; 6763 status = info->rx_buffer_list[CurrentIndex].status;
6764 6764
6765 if ( status & (RXSTATUS_SHORT_FRAME + RXSTATUS_OVERRUN + 6765 if ( status & (RXSTATUS_SHORT_FRAME | RXSTATUS_OVERRUN |
6766 RXSTATUS_CRC_ERROR + RXSTATUS_ABORT) ) { 6766 RXSTATUS_CRC_ERROR | RXSTATUS_ABORT) ) {
6767 if ( status & RXSTATUS_SHORT_FRAME ) 6767 if ( status & RXSTATUS_SHORT_FRAME )
6768 info->icount.rxshort++; 6768 info->icount.rxshort++;
6769 else if ( status & RXSTATUS_ABORT ) 6769 else if ( status & RXSTATUS_ABORT )
@@ -6899,7 +6899,7 @@ static void mgsl_load_tx_dma_buffer(struct mgsl_struct *info,
6899 /* set CMR:13 to start transmit when 6899 /* set CMR:13 to start transmit when
6900 * next GoAhead (abort) is received 6900 * next GoAhead (abort) is received
6901 */ 6901 */
6902 info->cmr_value |= BIT13; 6902 info->cmr_value |= BIT13;
6903 } 6903 }
6904 6904
6905 /* begin loading the frame in the next available tx dma 6905 /* begin loading the frame in the next available tx dma
@@ -7278,7 +7278,7 @@ static bool mgsl_dma_test( struct mgsl_struct *info )
7278 7278
7279 spin_unlock_irqrestore(&info->irq_spinlock,flags); 7279 spin_unlock_irqrestore(&info->irq_spinlock,flags);
7280 7280
7281 7281
7282 /******************************/ 7282 /******************************/
7283 /* WAIT FOR TRANSMIT COMPLETE */ 7283 /* WAIT FOR TRANSMIT COMPLETE */
7284 /******************************/ 7284 /******************************/
@@ -7292,7 +7292,7 @@ static bool mgsl_dma_test( struct mgsl_struct *info )
7292 status = usc_InReg( info, TCSR ); 7292 status = usc_InReg( info, TCSR );
7293 spin_unlock_irqrestore(&info->irq_spinlock,flags); 7293 spin_unlock_irqrestore(&info->irq_spinlock,flags);
7294 7294
7295 while ( !(status & (BIT6+BIT5+BIT4+BIT2+BIT1)) ) { 7295 while ( !(status & (BIT6 | BIT5 | BIT4 | BIT2 | BIT1)) ) {
7296 if (time_after(jiffies, EndTime)) { 7296 if (time_after(jiffies, EndTime)) {
7297 rc = false; 7297 rc = false;
7298 break; 7298 break;
@@ -7307,7 +7307,7 @@ static bool mgsl_dma_test( struct mgsl_struct *info )
7307 7307
7308 if ( rc ){ 7308 if ( rc ){
7309 /* CHECK FOR TRANSMIT ERRORS */ 7309 /* CHECK FOR TRANSMIT ERRORS */
7310 if ( status & (BIT5 + BIT1) ) 7310 if ( status & (BIT5 | BIT1) )
7311 rc = false; 7311 rc = false;
7312 } 7312 }
7313 7313
@@ -7333,7 +7333,7 @@ static bool mgsl_dma_test( struct mgsl_struct *info )
7333 /* CHECK FOR RECEIVE ERRORS */ 7333 /* CHECK FOR RECEIVE ERRORS */
7334 status = info->rx_buffer_list[0].status; 7334 status = info->rx_buffer_list[0].status;
7335 7335
7336 if ( status & (BIT8 + BIT3 + BIT1) ) { 7336 if ( status & (BIT8 | BIT3 | BIT1) ) {
7337 /* receive error has occurred */ 7337 /* receive error has occurred */
7338 rc = false; 7338 rc = false;
7339 } else { 7339 } else {
@@ -7605,7 +7605,7 @@ static void usc_loopmode_send_done( struct mgsl_struct * info )
7605{ 7605{
7606 info->loopmode_send_done_requested = false; 7606 info->loopmode_send_done_requested = false;
7607 /* clear CMR:13 to 0 to start echoing RxData to TxData */ 7607 /* clear CMR:13 to 0 to start echoing RxData to TxData */
7608 info->cmr_value &= ~BIT13; 7608 info->cmr_value &= ~BIT13;
7609 usc_OutReg(info, CMR, info->cmr_value); 7609 usc_OutReg(info, CMR, info->cmr_value);
7610} 7610}
7611 7611