aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/Kconfig.common1
-rw-r--r--arch/um/Kconfig.net2
-rw-r--r--arch/um/Kconfig.um8
-rw-r--r--arch/um/drivers/chan.h3
-rw-r--r--arch/um/drivers/chan_kern.c25
-rw-r--r--arch/um/drivers/line.c7
-rw-r--r--arch/um/drivers/net_kern.c26
-rw-r--r--arch/um/include/shared/net_kern.h1
-rw-r--r--arch/um/kernel/signal.c10
9 files changed, 30 insertions, 53 deletions
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index 648121b037d5..bceee6623b00 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -12,6 +12,7 @@ config UML
12 select GENERIC_CPU_DEVICES 12 select GENERIC_CPU_DEVICES
13 select GENERIC_IO 13 select GENERIC_IO
14 select GENERIC_CLOCKEVENTS 14 select GENERIC_CLOCKEVENTS
15 select TTY # Needed for line.c
15 16
16config MMU 17config MMU
17 bool 18 bool
diff --git a/arch/um/Kconfig.net b/arch/um/Kconfig.net
index 3160b1a5adb7..820a56f00332 100644
--- a/arch/um/Kconfig.net
+++ b/arch/um/Kconfig.net
@@ -157,7 +157,7 @@ config UML_NET_MCAST
157 157
158config UML_NET_PCAP 158config UML_NET_PCAP
159 bool "pcap transport" 159 bool "pcap transport"
160 depends on UML_NET && EXPERIMENTAL 160 depends on UML_NET
161 help 161 help
162 The pcap transport makes a pcap packet stream on the host look 162 The pcap transport makes a pcap packet stream on the host look
163 like an ethernet device inside UML. This is useful for making 163 like an ethernet device inside UML. This is useful for making
diff --git a/arch/um/Kconfig.um b/arch/um/Kconfig.um
index bf87f25eb2de..a7520c90f62d 100644
--- a/arch/um/Kconfig.um
+++ b/arch/um/Kconfig.um
@@ -45,8 +45,8 @@ config HOSTFS
45 say Y or M here; otherwise say N. 45 say Y or M here; otherwise say N.
46 46
47config HPPFS 47config HPPFS
48 tristate "HoneyPot ProcFS (EXPERIMENTAL)" 48 tristate "HoneyPot ProcFS"
49 depends on EXPERIMENTAL && PROC_FS 49 depends on PROC_FS
50 help 50 help
51 hppfs (HoneyPot ProcFS) is a filesystem which allows UML /proc 51 hppfs (HoneyPot ProcFS) is a filesystem which allows UML /proc
52 entries to be overridden, removed, or fabricated from the host. 52 entries to be overridden, removed, or fabricated from the host.
@@ -96,7 +96,7 @@ config MAGIC_SYSRQ
96 unless you really know what this hack does. 96 unless you really know what this hack does.
97 97
98config SMP 98config SMP
99 bool "Symmetric multi-processing support (EXPERIMENTAL)" 99 bool "Symmetric multi-processing support"
100 default n 100 default n
101 depends on BROKEN 101 depends on BROKEN
102 help 102 help
@@ -126,7 +126,7 @@ config NR_CPUS
126 default "32" 126 default "32"
127 127
128config HIGHMEM 128config HIGHMEM
129 bool "Highmem support (EXPERIMENTAL)" 129 bool "Highmem support"
130 depends on !64BIT && BROKEN 130 depends on !64BIT && BROKEN
131 default n 131 default n
132 help 132 help
diff --git a/arch/um/drivers/chan.h b/arch/um/drivers/chan.h
index 02b5a76e98d9..78f1b8999964 100644
--- a/arch/um/drivers/chan.h
+++ b/arch/um/drivers/chan.h
@@ -27,8 +27,7 @@ struct chan {
27 void *data; 27 void *data;
28}; 28};
29 29
30extern void chan_interrupt(struct line *line, 30extern void chan_interrupt(struct line *line, int irq);
31 struct tty_struct *tty, int irq);
32extern int parse_chan_pair(char *str, struct line *line, int device, 31extern int parse_chan_pair(char *str, struct line *line, int device,
33 const struct chan_opts *opts, char **error_out); 32 const struct chan_opts *opts, char **error_out);
34extern int write_chan(struct chan *chan, const char *buf, int len, 33extern 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 e9a0abc6a32f..15c553c239a1 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 = {
81}; 81};
82#endif /* CONFIG_NOCONFIG_CHAN */ 82#endif /* CONFIG_NOCONFIG_CHAN */
83 83
84static void tty_receive_char(struct tty_struct *tty, char ch)
85{
86 if (tty)
87 tty_insert_flip_char(tty, ch, TTY_NORMAL);
88}
89
90static int open_one_chan(struct chan *chan) 84static int open_one_chan(struct chan *chan)
91{ 85{
92 int fd, err; 86 int fd, err;
@@ -137,11 +131,9 @@ void chan_enable_winch(struct chan *chan, struct tty_struct *tty)
137static void line_timer_cb(struct work_struct *work) 131static void line_timer_cb(struct work_struct *work)
138{ 132{
139 struct line *line = container_of(work, struct line, task.work); 133 struct line *line = container_of(work, struct line, task.work);
140 struct tty_struct *tty = tty_port_tty_get(&line->port);
141 134
142 if (!line->throttled) 135 if (!line->throttled)
143 chan_interrupt(line, tty, line->driver->read_irq); 136 chan_interrupt(line, line->driver->read_irq);
144 tty_kref_put(tty);
145} 137}
146 138
147int enable_chan(struct line *line) 139int enable_chan(struct line *line)
@@ -552,8 +544,9 @@ int parse_chan_pair(char *str, struct line *line, int device,
552 return 0; 544 return 0;
553} 545}
554 546
555void chan_interrupt(struct line *line, struct tty_struct *tty, int irq) 547void chan_interrupt(struct line *line, int irq)
556{ 548{
549 struct tty_port *port = &line->port;
557 struct chan *chan = line->chan_in; 550 struct chan *chan = line->chan_in;
558 int err; 551 int err;
559 char c; 552 char c;
@@ -562,21 +555,24 @@ void chan_interrupt(struct line *line, struct tty_struct *tty, int irq)
562 goto out; 555 goto out;
563 556
564 do { 557 do {
565 if (tty && !tty_buffer_request_room(tty, 1)) { 558 if (!tty_buffer_request_room(port, 1)) {
566 schedule_delayed_work(&line->task, 1); 559 schedule_delayed_work(&line->task, 1);
567 goto out; 560 goto out;
568 } 561 }
569 err = chan->ops->read(chan->fd, &c, chan->data); 562 err = chan->ops->read(chan->fd, &c, chan->data);
570 if (err > 0) 563 if (err > 0)
571 tty_receive_char(tty, c); 564 tty_insert_flip_char(port, c, TTY_NORMAL);
572 } while (err > 0); 565 } while (err > 0);
573 566
574 if (err == 0) 567 if (err == 0)
575 reactivate_fd(chan->fd, irq); 568 reactivate_fd(chan->fd, irq);
576 if (err == -EIO) { 569 if (err == -EIO) {
577 if (chan->primary) { 570 if (chan->primary) {
578 if (tty != NULL) 571 struct tty_struct *tty = tty_port_tty_get(&line->port);
572 if (tty != NULL) {
579 tty_hangup(tty); 573 tty_hangup(tty);
574 tty_kref_put(tty);
575 }
580 if (line->chan_out != chan) 576 if (line->chan_out != chan)
581 close_one_chan(line->chan_out, 1); 577 close_one_chan(line->chan_out, 1);
582 } 578 }
@@ -585,6 +581,5 @@ void chan_interrupt(struct line *line, struct tty_struct *tty, int irq)
585 return; 581 return;
586 } 582 }
587 out: 583 out:
588 if (tty) 584 tty_flip_buffer_push(port);
589 tty_flip_buffer_push(tty);
590} 585}
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 9ffc28bd4b7a..f1b38571f94e 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)
19{ 19{
20 struct chan *chan = data; 20 struct chan *chan = data;
21 struct line *line = chan->line; 21 struct line *line = chan->line;
22 struct tty_struct *tty = tty_port_tty_get(&line->port);
23 22
24 if (line) 23 if (line)
25 chan_interrupt(line, tty, irq); 24 chan_interrupt(line, irq);
26 tty_kref_put(tty); 25
27 return IRQ_HANDLED; 26 return IRQ_HANDLED;
28} 27}
29 28
@@ -234,7 +233,7 @@ void line_unthrottle(struct tty_struct *tty)
234 struct line *line = tty->driver_data; 233 struct line *line = tty->driver_data;
235 234
236 line->throttled = 0; 235 line->throttled = 0;
237 chan_interrupt(line, tty, line->driver->read_irq); 236 chan_interrupt(line, line->driver->read_irq);
238 237
239 /* 238 /*
240 * Maybe there is enough stuff pending that calling the interrupt 239 * 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 b1314ebf1f72..d8926c303629 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)
274static void uml_net_get_drvinfo(struct net_device *dev, 274static void uml_net_get_drvinfo(struct net_device *dev,
275 struct ethtool_drvinfo *info) 275 struct ethtool_drvinfo *info)
276{ 276{
277 strcpy(info->driver, DRIVER_NAME); 277 strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
278 strcpy(info->version, "42"); 278 strlcpy(info->version, "42", sizeof(info->version));
279} 279}
280 280
281static const struct ethtool_ops uml_net_ethtool_ops = { 281static const struct ethtool_ops uml_net_ethtool_ops = {
@@ -293,8 +293,9 @@ static void uml_net_user_timer_expire(unsigned long _conn)
293#endif 293#endif
294} 294}
295 295
296static int setup_etheraddr(char *str, unsigned char *addr, char *name) 296static void setup_etheraddr(struct net_device *dev, char *str)
297{ 297{
298 unsigned char *addr = dev->dev_addr;
298 char *end; 299 char *end;
299 int i; 300 int i;
300 301
@@ -334,13 +335,12 @@ static int setup_etheraddr(char *str, unsigned char *addr, char *name)
334 addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], 335 addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4],
335 addr[5]); 336 addr[5]);
336 } 337 }
337 return 0; 338 return;
338 339
339random: 340random:
340 printk(KERN_INFO 341 printk(KERN_INFO
341 "Choosing a random ethernet address for device %s\n", name); 342 "Choosing a random ethernet address for device %s\n", dev->name);
342 eth_random_addr(addr); 343 eth_hw_addr_random(dev);
343 return 1;
344} 344}
345 345
346static DEFINE_SPINLOCK(devices_lock); 346static DEFINE_SPINLOCK(devices_lock);
@@ -392,7 +392,6 @@ static void eth_configure(int n, void *init, char *mac,
392 struct net_device *dev; 392 struct net_device *dev;
393 struct uml_net_private *lp; 393 struct uml_net_private *lp;
394 int err, size; 394 int err, size;
395 int random_mac;
396 395
397 size = transport->private_size + sizeof(struct uml_net_private); 396 size = transport->private_size + sizeof(struct uml_net_private);
398 397
@@ -419,9 +418,9 @@ static void eth_configure(int n, void *init, char *mac,
419 */ 418 */
420 snprintf(dev->name, sizeof(dev->name), "eth%d", n); 419 snprintf(dev->name, sizeof(dev->name), "eth%d", n);
421 420
422 random_mac = setup_etheraddr(mac, device->mac, dev->name); 421 setup_etheraddr(dev, mac);
423 422
424 printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac); 423 printk(KERN_INFO "Netdevice %d (%pM) : ", n, dev->dev_addr);
425 424
426 lp = netdev_priv(dev); 425 lp = netdev_priv(dev);
427 /* This points to the transport private data. It's still clear, but we 426 /* 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,
468 init_timer(&lp->tl); 467 init_timer(&lp->tl);
469 spin_lock_init(&lp->lock); 468 spin_lock_init(&lp->lock);
470 lp->tl.function = uml_net_user_timer_expire; 469 lp->tl.function = uml_net_user_timer_expire;
471 memcpy(lp->mac, device->mac, sizeof(lp->mac)); 470 memcpy(lp->mac, dev->dev_addr, sizeof(lp->mac));
472 471
473 if ((transport->user->init != NULL) && 472 if ((transport->user->init != NULL) &&
474 ((*transport->user->init)(&lp->user, dev) != 0)) 473 ((*transport->user->init)(&lp->user, dev) != 0))
475 goto out_unregister; 474 goto out_unregister;
476 475
477 /* don't use eth_mac_addr, it will not work here */
478 memcpy(dev->dev_addr, device->mac, ETH_ALEN);
479 if (random_mac)
480 dev->addr_assign_type |= NET_ADDR_RANDOM;
481
482 dev->mtu = transport->user->mtu; 476 dev->mtu = transport->user->mtu;
483 dev->netdev_ops = &uml_netdev_ops; 477 dev->netdev_ops = &uml_netdev_ops;
484 dev->ethtool_ops = &uml_net_ethtool_ops; 478 dev->ethtool_ops = &uml_net_ethtool_ops;
diff --git a/arch/um/include/shared/net_kern.h b/arch/um/include/shared/net_kern.h
index 5c367f22595b..012ac87d4900 100644
--- a/arch/um/include/shared/net_kern.h
+++ b/arch/um/include/shared/net_kern.h
@@ -18,7 +18,6 @@ struct uml_net {
18 struct net_device *dev; 18 struct net_device *dev;
19 struct platform_device pdev; 19 struct platform_device pdev;
20 int index; 20 int index;
21 unsigned char mac[ETH_ALEN];
22}; 21};
23 22
24struct uml_net_private { 23struct uml_net_private {
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c
index 48ccf718e290..3e831b3fd07b 100644
--- a/arch/um/kernel/signal.c
+++ b/arch/um/kernel/signal.c
@@ -122,13 +122,3 @@ int do_signal(void)
122{ 122{
123 return kern_do_signal(&current->thread.regs); 123 return kern_do_signal(&current->thread.regs);
124} 124}
125
126/*
127 * Atomically swap in the new signal mask, and wait for a signal.
128 */
129long sys_sigsuspend(int history0, int history1, old_sigset_t mask)
130{
131 sigset_t blocked;
132 siginitset(&blocked, mask);
133 return sigsuspend(&blocked);
134}