diff options
Diffstat (limited to 'drivers/serial/crisv10.c')
-rw-r--r-- | drivers/serial/crisv10.c | 68 |
1 files changed, 22 insertions, 46 deletions
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index be12623d8544..89700141f87e 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c | |||
@@ -481,8 +481,6 @@ static char *serial_version = "$Revision: 1.25 $"; | |||
481 | #include "serial_compat.h" | 481 | #include "serial_compat.h" |
482 | #endif | 482 | #endif |
483 | 483 | ||
484 | #define _INLINE_ inline | ||
485 | |||
486 | struct tty_driver *serial_driver; | 484 | struct tty_driver *serial_driver; |
487 | 485 | ||
488 | /* serial subtype definitions */ | 486 | /* serial subtype definitions */ |
@@ -591,8 +589,6 @@ static void rs_throttle(struct tty_struct * tty); | |||
591 | static void rs_wait_until_sent(struct tty_struct *tty, int timeout); | 589 | static void rs_wait_until_sent(struct tty_struct *tty, int timeout); |
592 | static int rs_write(struct tty_struct * tty, int from_user, | 590 | static int rs_write(struct tty_struct * tty, int from_user, |
593 | const unsigned char *buf, int count); | 591 | const unsigned char *buf, int count); |
594 | extern _INLINE_ int rs_raw_write(struct tty_struct * tty, int from_user, | ||
595 | const unsigned char *buf, int count); | ||
596 | #ifdef CONFIG_ETRAX_RS485 | 592 | #ifdef CONFIG_ETRAX_RS485 |
597 | static int e100_write_rs485(struct tty_struct * tty, int from_user, | 593 | static int e100_write_rs485(struct tty_struct * tty, int from_user, |
598 | const unsigned char *buf, int count); | 594 | const unsigned char *buf, int count); |
@@ -1538,8 +1534,7 @@ e100_enable_rxdma_irq(struct e100_serial *info) | |||
1538 | 1534 | ||
1539 | /* the tx DMA uses only dma_descr interrupt */ | 1535 | /* the tx DMA uses only dma_descr interrupt */ |
1540 | 1536 | ||
1541 | static _INLINE_ void | 1537 | static void e100_disable_txdma_irq(struct e100_serial *info) |
1542 | e100_disable_txdma_irq(struct e100_serial *info) | ||
1543 | { | 1538 | { |
1544 | #ifdef SERIAL_DEBUG_INTR | 1539 | #ifdef SERIAL_DEBUG_INTR |
1545 | printk("txdma_irq(%d): 0\n",info->line); | 1540 | printk("txdma_irq(%d): 0\n",info->line); |
@@ -1548,8 +1543,7 @@ e100_disable_txdma_irq(struct e100_serial *info) | |||
1548 | *R_IRQ_MASK2_CLR = info->irq; | 1543 | *R_IRQ_MASK2_CLR = info->irq; |
1549 | } | 1544 | } |
1550 | 1545 | ||
1551 | static _INLINE_ void | 1546 | static void e100_enable_txdma_irq(struct e100_serial *info) |
1552 | e100_enable_txdma_irq(struct e100_serial *info) | ||
1553 | { | 1547 | { |
1554 | #ifdef SERIAL_DEBUG_INTR | 1548 | #ifdef SERIAL_DEBUG_INTR |
1555 | printk("txdma_irq(%d): 1\n",info->line); | 1549 | printk("txdma_irq(%d): 1\n",info->line); |
@@ -1558,8 +1552,7 @@ e100_enable_txdma_irq(struct e100_serial *info) | |||
1558 | *R_IRQ_MASK2_SET = info->irq; | 1552 | *R_IRQ_MASK2_SET = info->irq; |
1559 | } | 1553 | } |
1560 | 1554 | ||
1561 | static _INLINE_ void | 1555 | static void e100_disable_txdma_channel(struct e100_serial *info) |
1562 | e100_disable_txdma_channel(struct e100_serial *info) | ||
1563 | { | 1556 | { |
1564 | unsigned long flags; | 1557 | unsigned long flags; |
1565 | 1558 | ||
@@ -1599,8 +1592,7 @@ e100_disable_txdma_channel(struct e100_serial *info) | |||
1599 | } | 1592 | } |
1600 | 1593 | ||
1601 | 1594 | ||
1602 | static _INLINE_ void | 1595 | static void e100_enable_txdma_channel(struct e100_serial *info) |
1603 | e100_enable_txdma_channel(struct e100_serial *info) | ||
1604 | { | 1596 | { |
1605 | unsigned long flags; | 1597 | unsigned long flags; |
1606 | 1598 | ||
@@ -1625,8 +1617,7 @@ e100_enable_txdma_channel(struct e100_serial *info) | |||
1625 | restore_flags(flags); | 1617 | restore_flags(flags); |
1626 | } | 1618 | } |
1627 | 1619 | ||
1628 | static _INLINE_ void | 1620 | static void e100_disable_rxdma_channel(struct e100_serial *info) |
1629 | e100_disable_rxdma_channel(struct e100_serial *info) | ||
1630 | { | 1621 | { |
1631 | unsigned long flags; | 1622 | unsigned long flags; |
1632 | 1623 | ||
@@ -1665,8 +1656,7 @@ e100_disable_rxdma_channel(struct e100_serial *info) | |||
1665 | } | 1656 | } |
1666 | 1657 | ||
1667 | 1658 | ||
1668 | static _INLINE_ void | 1659 | static void e100_enable_rxdma_channel(struct e100_serial *info) |
1669 | e100_enable_rxdma_channel(struct e100_serial *info) | ||
1670 | { | 1660 | { |
1671 | unsigned long flags; | 1661 | unsigned long flags; |
1672 | 1662 | ||
@@ -1913,9 +1903,7 @@ rs_start(struct tty_struct *tty) | |||
1913 | * This routine is used by the interrupt handler to schedule | 1903 | * This routine is used by the interrupt handler to schedule |
1914 | * processing in the software interrupt portion of the driver. | 1904 | * processing in the software interrupt portion of the driver. |
1915 | */ | 1905 | */ |
1916 | static _INLINE_ void | 1906 | static void rs_sched_event(struct e100_serial *info, int event) |
1917 | rs_sched_event(struct e100_serial *info, | ||
1918 | int event) | ||
1919 | { | 1907 | { |
1920 | if (info->event & (1 << event)) | 1908 | if (info->event & (1 << event)) |
1921 | return; | 1909 | return; |
@@ -2155,8 +2143,9 @@ add_char_and_flag(struct e100_serial *info, unsigned char data, unsigned char fl | |||
2155 | return 1; | 2143 | return 1; |
2156 | } | 2144 | } |
2157 | 2145 | ||
2158 | extern _INLINE_ unsigned int | 2146 | static unsigned int handle_descr_data(struct e100_serial *info, |
2159 | handle_descr_data(struct e100_serial *info, struct etrax_dma_descr *descr, unsigned int recvl) | 2147 | struct etrax_dma_descr *descr, |
2148 | unsigned int recvl) | ||
2160 | { | 2149 | { |
2161 | struct etrax_recv_buffer *buffer = phys_to_virt(descr->buf) - sizeof *buffer; | 2150 | struct etrax_recv_buffer *buffer = phys_to_virt(descr->buf) - sizeof *buffer; |
2162 | 2151 | ||
@@ -2182,8 +2171,7 @@ handle_descr_data(struct e100_serial *info, struct etrax_dma_descr *descr, unsig | |||
2182 | return recvl; | 2171 | return recvl; |
2183 | } | 2172 | } |
2184 | 2173 | ||
2185 | static _INLINE_ unsigned int | 2174 | static unsigned int handle_all_descr_data(struct e100_serial *info) |
2186 | handle_all_descr_data(struct e100_serial *info) | ||
2187 | { | 2175 | { |
2188 | struct etrax_dma_descr *descr; | 2176 | struct etrax_dma_descr *descr; |
2189 | unsigned int recvl; | 2177 | unsigned int recvl; |
@@ -2230,8 +2218,7 @@ handle_all_descr_data(struct e100_serial *info) | |||
2230 | return ret; | 2218 | return ret; |
2231 | } | 2219 | } |
2232 | 2220 | ||
2233 | static _INLINE_ void | 2221 | static void receive_chars_dma(struct e100_serial *info) |
2234 | receive_chars_dma(struct e100_serial *info) | ||
2235 | { | 2222 | { |
2236 | struct tty_struct *tty; | 2223 | struct tty_struct *tty; |
2237 | unsigned char rstat; | 2224 | unsigned char rstat; |
@@ -2292,8 +2279,7 @@ receive_chars_dma(struct e100_serial *info) | |||
2292 | *info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, restart); | 2279 | *info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, restart); |
2293 | } | 2280 | } |
2294 | 2281 | ||
2295 | static _INLINE_ int | 2282 | static int start_recv_dma(struct e100_serial *info) |
2296 | start_recv_dma(struct e100_serial *info) | ||
2297 | { | 2283 | { |
2298 | struct etrax_dma_descr *descr = info->rec_descr; | 2284 | struct etrax_dma_descr *descr = info->rec_descr; |
2299 | struct etrax_recv_buffer *buffer; | 2285 | struct etrax_recv_buffer *buffer; |
@@ -2348,11 +2334,6 @@ start_receive(struct e100_serial *info) | |||
2348 | } | 2334 | } |
2349 | 2335 | ||
2350 | 2336 | ||
2351 | static _INLINE_ void | ||
2352 | status_handle(struct e100_serial *info, unsigned short status) | ||
2353 | { | ||
2354 | } | ||
2355 | |||
2356 | /* the bits in the MASK2 register are laid out like this: | 2337 | /* the bits in the MASK2 register are laid out like this: |
2357 | DMAI_EOP DMAI_DESCR DMAO_EOP DMAO_DESCR | 2338 | DMAI_EOP DMAI_DESCR DMAO_EOP DMAO_DESCR |
2358 | where I is the input channel and O is the output channel for the port. | 2339 | where I is the input channel and O is the output channel for the port. |
@@ -2454,8 +2435,7 @@ rec_interrupt(int irq, void *dev_id, struct pt_regs * regs) | |||
2454 | return IRQ_RETVAL(handled); | 2435 | return IRQ_RETVAL(handled); |
2455 | } /* rec_interrupt */ | 2436 | } /* rec_interrupt */ |
2456 | 2437 | ||
2457 | static _INLINE_ int | 2438 | static int force_eop_if_needed(struct e100_serial *info) |
2458 | force_eop_if_needed(struct e100_serial *info) | ||
2459 | { | 2439 | { |
2460 | /* We check data_avail bit to determine if data has | 2440 | /* We check data_avail bit to determine if data has |
2461 | * arrived since last time | 2441 | * arrived since last time |
@@ -2499,8 +2479,7 @@ force_eop_if_needed(struct e100_serial *info) | |||
2499 | return 1; | 2479 | return 1; |
2500 | } | 2480 | } |
2501 | 2481 | ||
2502 | extern _INLINE_ void | 2482 | static void flush_to_flip_buffer(struct e100_serial *info) |
2503 | flush_to_flip_buffer(struct e100_serial *info) | ||
2504 | { | 2483 | { |
2505 | struct tty_struct *tty; | 2484 | struct tty_struct *tty; |
2506 | struct etrax_recv_buffer *buffer; | 2485 | struct etrax_recv_buffer *buffer; |
@@ -2611,8 +2590,7 @@ flush_to_flip_buffer(struct e100_serial *info) | |||
2611 | tty_flip_buffer_push(tty); | 2590 | tty_flip_buffer_push(tty); |
2612 | } | 2591 | } |
2613 | 2592 | ||
2614 | static _INLINE_ void | 2593 | static void check_flush_timeout(struct e100_serial *info) |
2615 | check_flush_timeout(struct e100_serial *info) | ||
2616 | { | 2594 | { |
2617 | /* Flip what we've got (if we can) */ | 2595 | /* Flip what we've got (if we can) */ |
2618 | flush_to_flip_buffer(info); | 2596 | flush_to_flip_buffer(info); |
@@ -2741,7 +2719,7 @@ TODO: The break will be delayed until an F or V character is received. | |||
2741 | 2719 | ||
2742 | */ | 2720 | */ |
2743 | 2721 | ||
2744 | extern _INLINE_ | 2722 | static |
2745 | struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info) | 2723 | struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info) |
2746 | { | 2724 | { |
2747 | unsigned long data_read; | 2725 | unsigned long data_read; |
@@ -2875,8 +2853,7 @@ more_data: | |||
2875 | return info; | 2853 | return info; |
2876 | } | 2854 | } |
2877 | 2855 | ||
2878 | extern _INLINE_ | 2856 | static struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info) |
2879 | struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info) | ||
2880 | { | 2857 | { |
2881 | unsigned char rstat; | 2858 | unsigned char rstat; |
2882 | 2859 | ||
@@ -2995,7 +2972,7 @@ struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info) | |||
2995 | return info; | 2972 | return info; |
2996 | } /* handle_ser_rx_interrupt */ | 2973 | } /* handle_ser_rx_interrupt */ |
2997 | 2974 | ||
2998 | extern _INLINE_ void handle_ser_tx_interrupt(struct e100_serial *info) | 2975 | static void handle_ser_tx_interrupt(struct e100_serial *info) |
2999 | { | 2976 | { |
3000 | unsigned long flags; | 2977 | unsigned long flags; |
3001 | 2978 | ||
@@ -3621,9 +3598,8 @@ rs_flush_chars(struct tty_struct *tty) | |||
3621 | restore_flags(flags); | 3598 | restore_flags(flags); |
3622 | } | 3599 | } |
3623 | 3600 | ||
3624 | extern _INLINE_ int | 3601 | static int rs_raw_write(struct tty_struct * tty, int from_user, |
3625 | rs_raw_write(struct tty_struct * tty, int from_user, | 3602 | const unsigned char *buf, int count) |
3626 | const unsigned char *buf, int count) | ||
3627 | { | 3603 | { |
3628 | int c, ret = 0; | 3604 | int c, ret = 0; |
3629 | struct e100_serial *info = (struct e100_serial *)tty->driver_data; | 3605 | struct e100_serial *info = (struct e100_serial *)tty->driver_data; |
@@ -4710,7 +4686,7 @@ rs_open(struct tty_struct *tty, struct file * filp) | |||
4710 | * /proc fs routines.... | 4686 | * /proc fs routines.... |
4711 | */ | 4687 | */ |
4712 | 4688 | ||
4713 | extern _INLINE_ int line_info(char *buf, struct e100_serial *info) | 4689 | static int line_info(char *buf, struct e100_serial *info) |
4714 | { | 4690 | { |
4715 | char stat_buf[30]; | 4691 | char stat_buf[30]; |
4716 | int ret; | 4692 | int ret; |