aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/amazon/files/drivers
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2010-01-31 15:13:14 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2010-01-31 15:13:14 +0000
commit6a78996e768731f8018c2081dbbcec2d48027a89 (patch)
tree50e23602247ee97b74043a661293341ed465f96e /target/linux/amazon/files/drivers
parent4d1bfc37607ebbd9842c2555bd4ded9c0c231649 (diff)
downloadupstream-6a78996e768731f8018c2081dbbcec2d48027a89.tar.gz
upstream-6a78996e768731f8018c2081dbbcec2d48027a89.tar.bz2
upstream-6a78996e768731f8018c2081dbbcec2d48027a89.zip
Add kernel 2.6.32 support
SVN-Revision: 19458
Diffstat (limited to 'target/linux/amazon/files/drivers')
-rw-r--r--target/linux/amazon/files/drivers/net/amazon_sw.c21
-rw-r--r--target/linux/amazon/files/drivers/serial/amazon_asc.c12
2 files changed, 20 insertions, 13 deletions
diff --git a/target/linux/amazon/files/drivers/net/amazon_sw.c b/target/linux/amazon/files/drivers/net/amazon_sw.c
index 1101d840de..54a70622e4 100644
--- a/target/linux/amazon/files/drivers/net/amazon_sw.c
+++ b/target/linux/amazon/files/drivers/net/amazon_sw.c
@@ -778,6 +778,17 @@ int switch_set_mac_address(struct net_device *dev, void *p)
return OK;
}
+static const struct net_device_ops amazon_mii_ops = {
+ .ndo_init = switch_init,
+ .ndo_open = switch_open,
+ .ndo_stop = switch_release,
+ .ndo_start_xmit = switch_tx,
+ .ndo_do_ioctl = switch_ioctl,
+ .ndo_get_stats = switch_stats,
+ .ndo_change_mtu = switch_change_mtu,
+ .ndo_set_mac_address = switch_set_mac_address,
+ .ndo_tx_timeout = switch_tx_timeout,
+};
int switch_init(struct net_device *dev)
{
@@ -787,14 +798,6 @@ int switch_init(struct net_device *dev)
struct switch_priv *priv;
ether_setup(dev); /* assign some of the fields */
printk(KERN_INFO "amazon_mii0: %s up using ", dev->name);
- dev->open = switch_open;
- dev->stop = switch_release;
- dev->hard_start_xmit = switch_tx;
- dev->do_ioctl = switch_ioctl;
- dev->get_stats = switch_stats;
- dev->change_mtu = switch_change_mtu;
- dev->set_mac_address = switch_set_mac_address;
- dev->tx_timeout = switch_tx_timeout;
dev->watchdog_timeo = timeout;
priv = netdev_priv(dev);
@@ -836,7 +839,7 @@ static int amazon_mii_probe(struct platform_device *dev)
for (i = 0; i < AMAZON_SW_INT_NO; i++) {
switch_devs[i] = alloc_etherdev(sizeof(struct switch_priv));
- switch_devs[i]->init = switch_init;
+ switch_devs[i]->netdev_ops = &amazon_mii_ops;
strcpy(switch_devs[i]->name, "eth%d");
priv = (struct switch_priv *) netdev_priv(switch_devs[i]);
priv->num = i;
diff --git a/target/linux/amazon/files/drivers/serial/amazon_asc.c b/target/linux/amazon/files/drivers/serial/amazon_asc.c
index f7fa907b00..fe7050c790 100644
--- a/target/linux/amazon/files/drivers/serial/amazon_asc.c
+++ b/target/linux/amazon/files/drivers/serial/amazon_asc.c
@@ -108,10 +108,10 @@ static void amazonasc_enable_ms(struct uart_port *port)
static void
amazonasc_rx_chars(struct uart_port *port)
{
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26))
- struct tty_struct *tty = port->info->port.tty;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 31))
+ struct tty_struct *tty = port->state->port.tty;
#else
- struct tty_struct *tty = port->info->tty;
+ struct tty_struct *tty = port->info->port.tty;
#endif
unsigned int ch = 0, rsr = 0, fifocnt;
@@ -169,7 +169,11 @@ amazonasc_rx_chars(struct uart_port *port)
static void amazonasc_tx_chars(struct uart_port *port)
{
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 31))
+ struct circ_buf *xmit = &port->state->xmit;
+#else
struct circ_buf *xmit = &port->info->xmit;
+#endif
if (uart_tx_stopped(port)) {
amazonasc_stop_tx(port);
@@ -679,7 +683,7 @@ static int __init amazon_asc_probe(struct platform_device *dev)
return res;
}
-static int __exit amazon_asc_remove(struct platform_device *dev)
+static int amazon_asc_remove(struct platform_device *dev)
{
uart_unregister_driver(&amazonasc_reg);
return 0;