diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2010-02-23 10:43:53 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2010-02-23 10:43:53 +0000 |
commit | 437f2bd5c1001f30bc06ee334f7935d0e4de2551 (patch) | |
tree | 1bb5fdbd5fee299548456da1d002b47563a78974 /target/linux/ubicom32/files/drivers | |
parent | f53f060299aa3c03f0a476178704e9bd69cb3179 (diff) | |
download | upstream-437f2bd5c1001f30bc06ee334f7935d0e4de2551.tar.gz upstream-437f2bd5c1001f30bc06ee334f7935d0e4de2551.tar.bz2 upstream-437f2bd5c1001f30bc06ee334f7935d0e4de2551.zip |
add 2.6.32 support
SVN-Revision: 19823
Diffstat (limited to 'target/linux/ubicom32/files/drivers')
-rw-r--r-- | target/linux/ubicom32/files/drivers/net/ubi32-eth.c | 24 | ||||
-rw-r--r-- | target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c | 10 |
2 files changed, 25 insertions, 9 deletions
diff --git a/target/linux/ubicom32/files/drivers/net/ubi32-eth.c b/target/linux/ubicom32/files/drivers/net/ubi32-eth.c index e6c7392e06..e9c62f4625 100644 --- a/target/linux/ubicom32/files/drivers/net/ubi32-eth.c +++ b/target/linux/ubicom32/files/drivers/net/ubi32-eth.c @@ -634,6 +634,19 @@ void ubi32_eth_cleanup(void) } } + static const struct net_device_ops ubi32_netdev_ops = { + .ndo_open = ubi32_eth_open, + .ndo_stop = ubi32_eth_close, + .ndo_start_xmit = ubi32_eth_start_xmit, + .ndo_tx_timeout = ubi32_eth_tx_timeout, + .ndo_do_ioctl = ubi32_eth_ioctl, + .ndo_change_mtu = ubi32_eth_change_mtu, + .ndo_set_config = ubi32_eth_set_config, + .ndo_get_stats = ubi32_eth_get_stats, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = eth_mac_addr, + }; + int ubi32_eth_init_module(void) { struct ethtionode *eth_node; @@ -706,16 +719,9 @@ int ubi32_eth_init_module(void) spin_lock_init(&priv->lock); - dev->open = ubi32_eth_open; - dev->stop = ubi32_eth_close; - dev->hard_start_xmit = ubi32_eth_start_xmit; - dev->tx_timeout = ubi32_eth_tx_timeout; - dev->watchdog_timeo = UBI32_ETH_VP_TX_TIMEOUT; + dev->netdev_ops = &ubi32_netdev_ops; - dev->set_config = ubi32_eth_set_config; - dev->do_ioctl = ubi32_eth_ioctl; - dev->get_stats = ubi32_eth_get_stats; - dev->change_mtu = ubi32_eth_change_mtu; + dev->watchdog_timeo = UBI32_ETH_VP_TX_TIMEOUT; #ifdef UBICOM32_USE_NAPI netif_napi_add(dev, &priv->napi, ubi32_eth_napi_poll, UBI32_ETH_NAPI_WEIGHT); #endif diff --git a/target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c b/target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c index fc0d6d21b6..f14fcdfd9a 100644 --- a/target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c +++ b/target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c @@ -34,6 +34,7 @@ #include <linux/tty.h> #include <linux/tty_flip.h> #include <linux/serial_core.h> +#include <linux/version.h> #include <asm/ip5000.h> @@ -259,8 +260,13 @@ static void ubi32_mailbox_enable_ms(struct uart_port *port) static void ubi32_mailbox_rx_chars(struct ubi32_mailbox_port *uart) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) + struct uart_state *state = uart->port.state; + struct tty_struct *tty = state->port.tty; +#else struct uart_info *info = uart->port.info; struct tty_struct *tty = info->port.tty; +#endif unsigned int status, ch, flg; status = 0; // XXX? UART_GET_LSR(uart); @@ -308,7 +314,11 @@ static void ubi32_mailbox_rx_chars(struct ubi32_mailbox_port *uart) static void ubi32_mailbox_tx_chars(struct ubi32_mailbox_port *uart) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) + struct circ_buf *xmit = &uart->port.state->xmit; +#else struct circ_buf *xmit = &uart->port.info->xmit; +#endif if (uart->port.x_char) { UART_PUT_CHAR(uart, uart->port.x_char); |