aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/net_kern.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-05-04treewide: replace dev->trans_start update with helperFlorian Westphal1-2/+2
Replace all trans_start updates with netif_trans_update helper. change was done via spatch: struct net_device *d; @@ - d->trans_start = jiffies + netif_trans_update(d) Compile tested only. Cc: user-mode-linux-devel@lists.sourceforge.net Cc: linux-xtensa@linux-xtensa.org Cc: linux1394-devel@lists.sourceforge.net Cc: linux-rdma@vger.kernel.org Cc: netdev@vger.kernel.org Cc: MPT-FusionLinux.pdl@broadcom.com Cc: linux-scsi@vger.kernel.org Cc: linux-can@vger.kernel.org Cc: linux-parisc@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: linux-hams@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: linux-wireless@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: devel@driverdev.osuosl.org Cc: b.a.t.m.a.n@lists.open-mesh.org Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Acked-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-11-06um: net: replace GFP_KERNEL with GFP_ATOMIC when spinlock is heldSaurabh Sengar1-8/+9
since GFP_KERNEL with GFP_ATOMIC while spinlock is held, as code while holding a spinlock should be atomic. GFP_KERNEL may sleep and can cause deadlock, where as GFP_ATOMIC may fail but certainly avoids deadlockdex f70dd54..d898f6c 100644 Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
2014-10-13um: net: Eliminate NULL test after alloc_bootmemHimangi Saraogi1-4/+0
alloc_bootmem and related functions never return NULL. Thus a NULL test or memset after calls to these functions is unnecessary. The following Coccinelle semantic patch was used for making the change: @@ expression E; statement S; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) ... when != E - if (E == NULL) S Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Richard Weinberger <richard@nod.at>
2014-03-24uml/net_kern: Call dev_consume_skb_any instead of dev_kfree_skb.Eric W. Biederman1-1/+1
Replace dev_kfree_skb with dev_consume_skb_any in uml_net_start_xmit as it can be called in hard irq and other contexts. dev_consume_skb_any is used as uml_net_start_xmit typically consumes (not drops) packets. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2013-03-11net : enable tx time stamping in the vde driver.Paul Chavent1-0/+2
This new version moves the skb_tx_timestamp in the main uml driver. This should avoid the need to call this function in each transport (vde, slirp, tuntap, ...). It also add support for ethtool get_ts_info. Signed-off-by: Paul Chavent <paul.chavent@onera.fr> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
2013-01-06ethtool: fix drvinfo strings set in driversJiri Pirko1-2/+2
Use strlcpy where possible to ensure the string is \0 terminated. Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN and custom defines. Use snprintf instead of sprint. Remove unnecessary inits of ->fw_version Remove unnecessary inits of drvinfo struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-03um: net: use eth_hw_addr_random() to generate random macJiri Pirko1-14/+8
Also remove unused "mac" from uml_net struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-09um: get rid of pointless include "..." where include <...> will doAl Viro1-5/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
2012-07-16arch: Use eth_random_addrJoe Perches1-1/+1
Convert the existing uses of random_ether_addr to the new eth_random_addr. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-21um: Implement um_free_irq()Richard Weinberger1-2/+2
Instead of using chip->release() we can achieve the same using a simple wrapper for free_irq(). We have already um_request_irq(), so um_free_irq() is the perfect counterpart. Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
2012-03-27Merge branch 'for-linus-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/umlLinus Torvalds1-1/+1
Pull UML changes from Richard Weinberger: "Mostly bug fixes and cleanups" * 'for-linus-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: (35 commits) um: Update defconfig um: Switch to large mcmodel on x86_64 MTD: Relax dependencies um: Wire CONFIG_GENERIC_IO up um: Serve io_remap_pfn_range() Introduce CONFIG_GENERIC_IO um: allow SUBARCH=x86 um: most of the SUBARCH uses can be killed um: deadlock in line_write_interrupt() um: don't bother trying to rebuild CHECKFLAGS for USER_OBJS um: use the right ifdef around exports in user_syms.c um: a bunch of headers can be killed by using generic-y um: ptrace-generic.h doesn't need user.h um: kill HOST_TASK_PID um: remove pointless include of asm/fixmap.h from asm/pgtable.h um: asm-offsets.h might as well come from underlying arch... um: merge processor_{32,64}.h a bit... um: switch close_chan() to struct line um: race fix: initialize delayed_work *before* registering IRQ um: line->have_irq is never checked... ...
2012-03-25um: irq: Remove IRQF_DISABLEDYong Zhang1-1/+1
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
2012-02-17UML net: set addr_assign_type if random_ether_addr() usedDanny Kukawka1-3/+8
Set addr_assign_type correctly to NET_ADDR_RANDOM in case a random MAC address was generated and assigned to the netdevice. Return state from setup_etheraddr() about returning a random MAC address or not and check this state in eth_configure(). Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-17net: remove use of ndo_set_multicast_list in driversJiri Pirko1-1/+1
replace it by ndo_set_rx_mode Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-07-25um: add netpoll supportRichard Weinberger1-0/+12
To make netconsole usable on UML, its ethernet driver needs netpoll support. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-09-29um: Proper Fix for f25c80a4: remove duplicate structure field initializationBoaz Harrosh1-14/+3
uml_net_set_mac() was broken and luckily it was never used, before. What it was trying to do is spin_lock before memcopy the mac address. Linus attempted to fix it in assumption that someone decided the lock was needed. But since it was never ever used at all, and was just dead code, I think we can assume that it is not needed, after all. On the other hand patch [f25c80a4] was trying to use eth_mac_addr() in eth_configure(), *which was the real fallout*. Because of state checks done inside eth_mac_addr() the address was never set. I have not reintroduced the memcpy wrapper, but I've put a comment for future cats. The code now is back to exactly as it was before [f25c80a4]. With the cleanup applied. If the spin_lock is indeed needed then a contender should supply a test case that fails, then fix it with the proper locking, as a separate unrelated patch. CC: Julia Lawall <julia@diku.dk> CC: David S. Miller <davem@davemloft.net> CC: Andrew Morton <akpm@linux-foundation.org> CC: Al Viro <viro@ZenIV.linux.org.uk> Tested-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21arch/um/drivers: remove duplicate structure field initializationJulia Lawall1-8/+2
There are two initializations of ndo_set_mac_address, one to a local function that is not used otherwise and one to a function that is defined elsewhere. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ identifier I, s, fld; position p0,p; expression E; @@ struct I s =@p0 { ... .fld@p = E, ...}; @s@ identifier I, s, r.fld; position r.p0,p; expression E; @@ struct I s =@p0 { ... .fld@p = E, ...}; @script:python@ p0 << r.p0; fld << r.fld; ps << s.p; pr << r.p; @@ if int(ps[0].line)<int(pr[0].line) or int(ps[0].column)<int(pr[0].column): cocci.print_main(fld,p0) // </smpl> akpm: - Use the standard eth_mac_addr() in uml_net_set_mac() - Remove unneeded and racy local set_ether_mac() - Remove duplicated (and incorrect) uml_netdev_ops.ndo_set_mac_address initializer. Fixes 8bb95b39a16ed55226810596f92216c53329d2fe ("uml: convert network device to netdevice ops"). [akpm@linux-foundation.org: rework as above] Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo1-0/+1
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2009-09-21trivial: remove unnecessary semicolonsJoe Perches1-1/+1
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-02netdev: drivers should make ethtool_ops constStephen Hemminger1-1/+1
No need to put ethtool_ops in data, they should be const. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-05net: use NETDEV_TX_OK instead of 0 in ndo_start_xmit() functionsPatrick McHardy1-1/+1
This patch is the result of an automatic spatch transformation to convert all ndo_start_xmit() return values of 0 to NETDEV_TX_OK. Some occurences are missed by the automatic conversion, those will be handled in a seperate patch. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-15uml: remove driver_data direct access of struct deviceGreg Kroah-Hartman1-2/+2
In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: user-mode-linux-devel@lists.sourceforge.net Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-02uml: fix compile error from net_device_ops conversionMiklos Szeredi1-1/+1
Fix the following compile error: arch/um/drivers/net_kern.c: In function 'uml_inetaddr_event': arch/um/drivers/net_kern.c:760: error: 'struct net_device' has no member named 'open' This was introduced by commit 8bb95b39, "uml: convert network device to netdevice ops". Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: David S. Miller <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-03-27uml: convert network device to netdevice opsStephen Hemminger1-7/+13
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-27uml: convert network device to internal network device statsStephen Hemminger1-13/+6
Convert the UML network device to use internal network device stats. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04um: Kill directly reference of netdev->privWang Chen1-11/+11
Simply replace netdev->priv with netdev_priv(). Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-27net: convert more to %pMJohannes Berg1-6/+1
A number of places still use %02x:...:%02x because it's in debug statements or for no real reason. Make a few of them use %pM. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-28uml: make several things staticWANG Cong1-3/+3
Make several things static, because they no longer need to be global. Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: WANG Cong <wangcong@zeuux.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-26[UML]: uml-net: don't set IFF_ALLMULTI in set_multicast_listPatrick McHardy1-5/+1
IFF_ALLMULTI is an indication from the network stack to the driver to disable multicast filters, drivers should never set it directly. Since the UML networking device doesn't have any filtering capabilites, it doesn't the set_multicast_list function at all, it is kept so userspace can still issue SIOCADDMULTI/SIOCDELMULTI ioctls however. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-05uml: use of a public MAC is a warning, not an errorJeff Dike1-5/+4
Downgrade one of the MAC validity checks. If it's one that could be possibly assigned to a physical NIC, then nothing will break. So, emit a warning in this case, but keep the requested MAC. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-05uml: SMP locking commentaryJeff Dike1-1/+6
Add some more commentary about various pieces of global data not needing locking. Also got rid of unmap_physmem since that is no longer used. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-12-11[UM]: Fix use of skb after netif_rxJulia Lawall1-1/+1
Recently, Wang Chen submitted a patch (d30f53aeb31d453a5230f526bea592af07944564) to move a call to netif_rx(skb) after a subsequent reference to skb, because netif_rx may call kfree_skb on its argument. The same problem occurs in some other drivers as well. This was found using the following semantic match. (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression skb, e,e1; @@ ( netif_rx(skb); | netif_rx_ni(skb); ) ... when != skb = e ( skb = e1 | * skb ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-14uml: fix build for !CONFIG_TCPJeff Dike1-2/+12
Make UML build in the absence of CONFIG_INET by making the inetaddr_notifier registration depend on it. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16uml: correctly handle skb allocation failuresJeff Dike1-0/+47
Handle memory allocation failures when reading packets. We have to read something from the host, even if we can't allocate any memory. If we don't, the host side of the device may fill up and stop delivering interrupts because no new packets can be queued. A single sk_buff is allocated whenever an MTU is seen which is larger than any seen earlier. This is used to read packets if there is a memory allocation failure. The large MTU check is done from eth_configure, which is called when a interface is added to the system. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16uml: network driver MTU cleanupsJeff Dike1-34/+8
A bunch of MTU-related cleanups in the network code. First, there is the addition of the notion of a maximally-sized packet, which is the MTU plus headers. This is used to size the skb that will receive a packet. This allows ether_adjust_skb to go away, as it was used to resize the skb after it was allocated. Since the skb passed into the low-level read routine is no longer resized, and possibly reallocated, there, they (and the write routines) don't need to get an sk_buff **. They just need the sk_buff * now. The callers of ether_adjust_skb still need to do the skb_put, so that's now inlined. The MAX_PACKET definitions in most of the drivers are gone. The set_mtu methods were all the same and did nothing, so they can be removed. The ethertap driver had a typo which doubled the size of the packet rather than adding two bytes to it. It also wasn't defining its setup_size, causing a zero-byte kmalloc and crash when the invalid pointer returned from kmalloc was dereferenced. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16uml: network formattingJeff Dike1-100/+97
Style and other non-functional changes in the UML networking code, including include tidying style violations copyright updates printks getting severities userspace code calling libc directly rather than using the os_* wrappers There's also a exit path cleanup in the pcap driver. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-24uml: more __init annotationsJeff Dike1-1/+1
2.6.23-rc1 turned up another batch of references from non-__init code to __init code. In most cases, these were missing __init annotations. In one case (os_drop_memory), the annotation was present but wrong. init_maps is __init, but for some reason was being very careful about the mechanism by which it allocated memory, checking whether it was OK to use kmalloc (at this point in the boot, it definitely isn't) and using either alloc_bootmem_low_pages or kmalloc/vmalloc. So, the kmalloc/vmalloc code is removed. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08uml: network and pcap cleanupJeff Dike1-6/+9
Some network device cleanup. When setup_etheraddr found a globally valid MAC being assigned to an interface, it went ahead and used it rather than assigning a random MAC like the other cases do. This isn't really an error like the others, but it seems consistent to make it behave the same. We were getting some duplicate kfree() in the error case in eth_configure because platform_device_unregister frees buffers that the error cases following tried to free again. The pcap initialization routine wasn't doing the proper printk of its information, causing a printk of the first part of that line to be unterminated by a newline. The pcap code had a bunch of style violations, which are now fixed. pcap_setup wasn't returning false when it detected an unrecognized option. The printks in pcap_user all got UM_KERN_BLAH prepended to their format strings. pcap_remove now checks for a non-NULL pcap structure before it calls pcap_close. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Acked-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-07uml: drivers get release methodsJeff Dike1-4/+15
Define release methods for the ubd and net drivers. They contain as much of the remove methods as make sense. All error checking must have already been done as well as anything else that might be holding a reference on the device kobject. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-07uml: Replace one-element array with zero-element arrayPaolo 'Blaisorblade' Giarrusso1-11/+3
To look at users I did: $ find arch/um/ include/asm-um -name '*.[ch]'|xargs grep -r 'net_kern\.h' +-l|xargs grep '\<user\>' Most users just cast user to the appropriate pointer, the remaining ones are fixed here. In net_kern.c, I'm almost sure that save trick is not needed anymore, but I've not verified it. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-07uml: Eliminate temporary buffer in eth_configurePaolo 'Blaisorblade' Giarrusso1-12/+13
Avoid using the temporary buffer introduced by previous patch to hold the device name. Btw, avoid leaking device on an error path. Other error paths may need cleanup. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-07uml: improve checking and diagnostics of ethernet MACsPaolo 'Blaisorblade' Giarrusso1-9/+29
Improve checking and diagnostics for broadcast and multicast Ethernet MAC addresses, and distinguish between those cases in output; also make sure the device is assigned a MAC address valid only locally to avoid collisions. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-07uml: remove user_util.hJeff Dike1-1/+0
user_util.h isn't needed any more, so delete it and remove all includes of it. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-07uml: network interface hotplug error handlingJeff Dike1-35/+46
This fixes a number of problems associated with network interface hotplug. The userspace initialization function can fail in some cases, but the failure was never passed back to eth_configure, which proceeded with the configuration. This results in a zombie device that is present, but can't work. This is fixed by allowing the initialization routines to return an error, which is checked, and the configuration aborted on failure. eth_configure failed to check for many failures. Even when it did check, it didn't undo whatever initializations has already happened, so a present, but partially initialized and non-working device could result. It now checks everything that can fail, and bails out, undoing whatever had been done. The return value of eth_configure was always ignored, so it is now just void. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-25[SK_BUFF]: Introduce skb_reset_mac_header(skb)Arnaldo Carvalho de Melo1-1/+1
For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in 64bit land while possibly keeping it as a pointer on 32bit. This one touches just the most simple case, next will handle the slightly more "complex" cases. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-02-11[PATCH] uml: network driver locking and code cleanupJeff Dike1-24/+18
Add some missing locking to walks of the transports and opened lists. Delete some dead code. Comment the lack of some locking. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-11[PATCH] uml: mconsole lockingJeff Dike1-0/+1
Locking fixes. Locking was totally lacking for the mconsole_devices, which got a spin lock, and the unplugged pages data, which got a mutex. The locking of the mconsole console output code was confused. Now, the console_lock (renamed to client_lock) protects the clients list. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-11[PATCH] uml: network driver whitespace and style fixesJeff Dike1-14/+15
Some whitespace and coding style cleanups in the network driver code. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-11[PATCH] uml: add locking to network transport registrationJeff Dike1-4/+5
The registration of host network transports needed some locking. The transport list itself is locked, but calls to the registration routines are not. This is compensated for by checking that a transport structure is not yet on any list. I also took the opportunity to const all fields in the transport structure except the list, which obviously can be modified. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-11[PATCH] uml: return hotplug errors to hostJeff Dike1-51/+46
I noticed that errors happening while hotplugging devices from the host were never returned back to the mconsole client. In some cases, success was returned instead of even an information-free error. This patch cleans that up by having the low-level configuration code pass back an error string along with an error code. At the top level, which knows whether it is early boot time or responding to an mconsole request, the string is printk'd or returned to the mconsole client. There are also whitespace and trivial code cleanups in the surrounding code. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>