diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/Kconfig.common | 1 | ||||
-rw-r--r-- | arch/um/Kconfig.net | 2 | ||||
-rw-r--r-- | arch/um/Kconfig.um | 8 | ||||
-rw-r--r-- | arch/um/drivers/chan.h | 3 | ||||
-rw-r--r-- | arch/um/drivers/chan_kern.c | 25 | ||||
-rw-r--r-- | arch/um/drivers/line.c | 7 | ||||
-rw-r--r-- | arch/um/drivers/net_kern.c | 26 | ||||
-rw-r--r-- | arch/um/include/shared/net_kern.h | 1 |
8 files changed, 30 insertions, 43 deletions
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common index 648121b037d..bceee6623b0 100644 --- a/arch/um/Kconfig.common +++ b/arch/um/Kconfig.common @@ -12,6 +12,7 @@ config UML select GENERIC_CPU_DEVICES select GENERIC_IO select GENERIC_CLOCKEVENTS + select TTY # Needed for line.c config MMU bool diff --git a/arch/um/Kconfig.net b/arch/um/Kconfig.net index 3160b1a5adb..820a56f0033 100644 --- a/arch/um/Kconfig.net +++ b/arch/um/Kconfig.net @@ -157,7 +157,7 @@ config UML_NET_MCAST config UML_NET_PCAP bool "pcap transport" - depends on UML_NET && EXPERIMENTAL + depends on UML_NET help The pcap transport makes a pcap packet stream on the host look like an ethernet device inside UML. This is useful for making diff --git a/arch/um/Kconfig.um b/arch/um/Kconfig.um index bf87f25eb2d..a7520c90f62 100644 --- a/arch/um/Kconfig.um +++ b/arch/um/Kconfig.um @@ -45,8 +45,8 @@ config HOSTFS say Y or M here; otherwise say N. config HPPFS - tristate "HoneyPot ProcFS (EXPERIMENTAL)" - depends on EXPERIMENTAL && PROC_FS + tristate "HoneyPot ProcFS" + depends on PROC_FS help hppfs (HoneyPot ProcFS) is a filesystem which allows UML /proc entries to be overridden, removed, or fabricated from the host. @@ -96,7 +96,7 @@ config MAGIC_SYSRQ unless you really know what this hack does. config SMP - bool "Symmetric multi-processing support (EXPERIMENTAL)" + bool "Symmetric multi-processing support" default n depends on BROKEN help @@ -126,7 +126,7 @@ config NR_CPUS default "32" config HIGHMEM - bool "Highmem support (EXPERIMENTAL)" + bool "Highmem support" depends on !64BIT && BROKEN default n help diff --git a/arch/um/drivers/chan.h b/arch/um/drivers/chan.h index 02b5a76e98d..78f1b899996 100644 --- a/arch/um/drivers/chan.h +++ b/arch/um/drivers/chan.h @@ -27,8 +27,7 @@ struct chan { void *data; }; -extern void chan_interrupt(struct line *line, - struct tty_struct *tty, int irq); +extern void chan_interrupt(struct line *line, int irq); extern int parse_chan_pair(char *str, struct line *line, int device, const struct chan_opts *opts, char **error_out); extern int write_chan(struct chan *chan, const char *buf, int len, diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index e9a0abc6a32..15c553c239a 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c @@ -81,12 +81,6 @@ static const struct chan_ops not_configged_ops = { }; #endif /* CONFIG_NOCONFIG_CHAN */ -static void tty_receive_char(struct tty_struct *tty, char ch) -{ - if (tty) - tty_insert_flip_char(tty, ch, TTY_NORMAL); -} - static int open_one_chan(struct chan *chan) { int fd, err; @@ -137,11 +131,9 @@ void chan_enable_winch(struct chan *chan, struct tty_struct *tty) static void line_timer_cb(struct work_struct *work) { struct line *line = container_of(work, struct line, task.work); - struct tty_struct *tty = tty_port_tty_get(&line->port); if (!line->throttled) - chan_interrupt(line, tty, line->driver->read_irq); - tty_kref_put(tty); + chan_interrupt(line, line->driver->read_irq); } int enable_chan(struct line *line) @@ -552,8 +544,9 @@ int parse_chan_pair(char *str, struct line *line, int device, return 0; } -void chan_interrupt(struct line *line, struct tty_struct *tty, int irq) +void chan_interrupt(struct line *line, int irq) { + struct tty_port *port = &line->port; struct chan *chan = line->chan_in; int err; char c; @@ -562,21 +555,24 @@ void chan_interrupt(struct line *line, struct tty_struct *tty, int irq) goto out; do { - if (tty && !tty_buffer_request_room(tty, 1)) { + if (!tty_buffer_request_room(port, 1)) { schedule_delayed_work(&line->task, 1); goto out; } err = chan->ops->read(chan->fd, &c, chan->data); if (err > 0) - tty_receive_char(tty, c); + tty_insert_flip_char(port, c, TTY_NORMAL); } while (err > 0); if (err == 0) reactivate_fd(chan->fd, irq); if (err == -EIO) { if (chan->primary) { - if (tty != NULL) + struct tty_struct *tty = tty_port_tty_get(&line->port); + if (tty != NULL) { tty_hangup(tty); + tty_kref_put(tty); + } if (line->chan_out != chan) close_one_chan(line->chan_out, 1); } @@ -585,6 +581,5 @@ void chan_interrupt(struct line *line, struct tty_struct *tty, int irq) return; } out: - if (tty) - tty_flip_buffer_push(tty); + tty_flip_buffer_push(port); } diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 9ffc28bd4b7..f1b38571f94 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -19,11 +19,10 @@ static irqreturn_t line_interrupt(int irq, void *data) { struct chan *chan = data; struct line *line = chan->line; - struct tty_struct *tty = tty_port_tty_get(&line->port); if (line) - chan_interrupt(line, tty, irq); - tty_kref_put(tty); + chan_interrupt(line, irq); + return IRQ_HANDLED; } @@ -234,7 +233,7 @@ void line_unthrottle(struct tty_struct *tty) struct line *line = tty->driver_data; line->throttled = 0; - chan_interrupt(line, tty, line->driver->read_irq); + chan_interrupt(line, line->driver->read_irq); /* * Maybe there is enough stuff pending that calling the interrupt diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index b1314ebf1f7..d8926c30362 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c @@ -274,8 +274,8 @@ static void uml_net_poll_controller(struct net_device *dev) static void uml_net_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { - strcpy(info->driver, DRIVER_NAME); - strcpy(info->version, "42"); + strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver)); + strlcpy(info->version, "42", sizeof(info->version)); } static const struct ethtool_ops uml_net_ethtool_ops = { @@ -293,8 +293,9 @@ static void uml_net_user_timer_expire(unsigned long _conn) #endif } -static int setup_etheraddr(char *str, unsigned char *addr, char *name) +static void setup_etheraddr(struct net_device *dev, char *str) { + unsigned char *addr = dev->dev_addr; char *end; int i; @@ -334,13 +335,12 @@ static int setup_etheraddr(char *str, unsigned char *addr, char *name) addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], addr[5]); } - return 0; + return; random: printk(KERN_INFO - "Choosing a random ethernet address for device %s\n", name); - eth_random_addr(addr); - return 1; + "Choosing a random ethernet address for device %s\n", dev->name); + eth_hw_addr_random(dev); } static DEFINE_SPINLOCK(devices_lock); @@ -392,7 +392,6 @@ static void eth_configure(int n, void *init, char *mac, struct net_device *dev; struct uml_net_private *lp; int err, size; - int random_mac; size = transport->private_size + sizeof(struct uml_net_private); @@ -419,9 +418,9 @@ static void eth_configure(int n, void *init, char *mac, */ snprintf(dev->name, sizeof(dev->name), "eth%d", n); - random_mac = setup_etheraddr(mac, device->mac, dev->name); + setup_etheraddr(dev, mac); - printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac); + printk(KERN_INFO "Netdevice %d (%pM) : ", n, dev->dev_addr); lp = netdev_priv(dev); /* This points to the transport private data. It's still clear, but we @@ -468,17 +467,12 @@ static void eth_configure(int n, void *init, char *mac, init_timer(&lp->tl); spin_lock_init(&lp->lock); lp->tl.function = uml_net_user_timer_expire; - memcpy(lp->mac, device->mac, sizeof(lp->mac)); + memcpy(lp->mac, dev->dev_addr, sizeof(lp->mac)); if ((transport->user->init != NULL) && ((*transport->user->init)(&lp->user, dev) != 0)) goto out_unregister; - /* don't use eth_mac_addr, it will not work here */ - memcpy(dev->dev_addr, device->mac, ETH_ALEN); - if (random_mac) - dev->addr_assign_type |= NET_ADDR_RANDOM; - dev->mtu = transport->user->mtu; dev->netdev_ops = ¨_netdev_ops; dev->ethtool_ops = ¨_net_ethtool_ops; diff --git a/arch/um/include/shared/net_kern.h b/arch/um/include/shared/net_kern.h index 5c367f22595..012ac87d490 100644 --- a/arch/um/include/shared/net_kern.h +++ b/arch/um/include/shared/net_kern.h @@ -18,7 +18,6 @@ struct uml_net { struct net_device *dev; struct platform_device pdev; int index; - unsigned char mac[ETH_ALEN]; }; struct uml_net_private { |