aboutsummaryrefslogtreecommitdiffstats
path: root/samples/kobject/kset-example.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2008-01-28[INET]: Give outer DSCP directly to ip*_copy_dscpHerbert Xu4-7/+8
This patch changes the prototype of ipv4_copy_dscp and ipv6_copy_dscp so that they directly take the outer DSCP rather than the outer IP header. This will help us to unify the code for inter-family tunnels. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Move x->outer_mode->output out of locked sectionHerbert Xu2-4/+7
RO mode is the only one that requires a locked output function. So it's easier to move the lock into that function rather than requiring everyone else to run under the lock. In particular, this allows us to move the size check into the output function without causing a potential dead-lock should the ICMP error somehow hit the same SA on transmission. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Forbid BEET + ipcomp for nowHerbert Xu2-19/+20
While BEET can theoretically work with IPComp the current code can't do that because it tries to construct a BEET mode tunnel type which doesn't (and cannot) exist. In fact as it is it won't even attach a tunnel object at all for BEET which is bogus. To support this fully we'd also need to change the policy checks on input to recognise a plain tunnel as a legal variant of an optional BEET transform. This patch simply fails such constructions for now. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Merge common code into xfrm_bundle_createHerbert Xu4-253/+211
Half of the code in xfrm4_bundle_create and xfrm6_bundle_create are common. This patch extracts that logic and puts it into xfrm_bundle_create. The rest of it are then accessed through afinfo. As a result this fixes the problem with inter-family transforms where we treat every xfrm dst in the bundle as if it belongs to the top family. This patch also fixes a long-standing error-path bug where we may free the xfrm states twice. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Move flow construction into xfrm_dst_lookupHerbert Xu4-121/+91
This patch moves the flow construction from the callers of xfrm_dst_lookup into that function. It also changes xfrm_dst_lookup so that it takes an xfrm state as its argument instead of explicit addresses. This removes any address-specific logic from the callers of xfrm_dst_lookup which is needed to correctly support inter-family transforms. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Replace x->type->{local,remote}_addr with flagsHerbert Xu3-23/+12
The functions local_addr and remote_addr are more than what they're needed for. The same thing can be done easily with flags on the type object. This patch does that and simplifies the wrapper functions in xfrm6_policy accordingly. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Make sure idev is consistent with dev in xfrm_dstHerbert Xu2-9/+19
Previously we took the device from the bottom route and idev from the top route. This is bad because idev may well point to a different device. This patch changes it so that we get the idev from the device directly. It also makes it an error if either dev or idev is NULL. This is consistent with the rest of the routing code which also treats these cases as errors. I've removed the err initialisation in xfrm6_policy.c because it achieves no purpose and hid a bug when an initial version of this patch neglected to set err to -ENODEV (fortunately the IPv4 version warned about it). Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Set dst->input to dst_discardHerbert Xu2-2/+4
The input function should never be invoked on IPsec dst objects. This is because we don't apply IPsec on input until after we've made the routing decision. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Only set neighbour on top xfrm dstHerbert Xu2-4/+7
The neighbour field is only used by dst_confirm which only ever happens on the top-most xfrm dst. So it's a waste to duplicate for every other xfrm dst. This patch moves its setting out of the loop so that only the top one gets set. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[NET]: Remove unnecessary inclusion of dst.hHerbert Xu1-1/+1
The file net/netevent.h only refers to struct dst_entry * so it doesn't need to include dst.h. I've replaced it with a forward declaration. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[NET]: Eliminate duplicate copies of dst_discardHerbert Xu6-49/+13
We have a number of copies of dst_discard scattered around the place which all do the same thing, namely free a packet on the input or output paths. This patch deletes all of them except dst_discard and points all the users to it. The only non-trivial bit is decnet where it returns an error. However, conceptually this is identical to the blackhole functions used in IPv4 and IPv6 which do not return errors. So they should either all return errors or all return zero. For now I've stuck with the majority and picked zero as the return value. It doesn't really matter in practice since few if any driver would react differently depending on a zero return value or NET_RX_DROP. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPV6]: Move nfheader_len into rt6_infoHerbert Xu5-8/+13
The dst member nfheader_len is only used by IPv6. It's also currently creating a rather ugly alignment hole in struct dst. Therefore this patch moves it from there into struct rt6_info. It also reorders the fields in rt6_info to minimize holes. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPSEC]: Use dst->header_len when resizing on outputHerbert Xu1-1/+2
Currently we use x->props.header_len when resizing on output. However, if we're resizing at all we might as well go the whole hog and do it for the whole dst. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPV6]: Only set nfheader_len for top xfrm dstHerbert Xu2-23/+6
We only need to set nfheader_len in the top xfrm dst. This is because we only ever read the nfheader_len from the top xfrm dst. It is also easier to count nfheader_len as part of header_len which then lets us remove the ugly wrapper functions for incrementing and decrementing header lengths in xfrm6_policy.c. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[NET]: Convert init_timer into setup_timerPavel Emelyanov47-228/+98
Many-many code in the kernel initialized the timer->function and timer->data together with calling init_timer(timer). There is already a helper for this. Use it for networking code. The patch is HUGE, but makes the code 130 lines shorter (98 insertions(+), 228 deletions(-)). Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPV6]: Add raw6 drops counter.Wang Chen1-7/+8
Add raw drops counter for IPv6 in /proc/net/raw6 . Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[IPV4]: Add raw drops counter.Wang Chen3-10/+19
Add raw drops counter for IPv4 in /proc/net/raw . Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[TCP]: Make tcp_splice_data_recv() static.Adrian Bunk1-2/+2
Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[TCP] splice: add tcp_splice_read() to IPV6Jens Axboe1-0/+1
Thanks to YOSHIFUJI Hideaki for the hint! Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[TCP]: Splice receive support.Jens Axboe7-0/+401
Support for network splice receive. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[SPLICE]: Don't assume regular pages in splice_to_pipe()Jens Axboe2-1/+9
Allow caller to pass in a release function, there might be other resources that need releasing as well. Needed for network receive. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[MAC80211]: Revert unaligned warning removal.David S. Miller1-0/+13
For release Linux removed this warning, but we want it back for development. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-29libata: Change "write_data" to "rw" for some function documentationsLinus Nilsson1-2/+2
The documentation for ata_data_xfer and ata_data_xfer_noirq had the 'rw' parameter named 'write_data'. Signed-off-by: Linus Nilsson <lajnold@acc.umu.se> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-28HID: ADS/Tech Radio si470x needs blacklist entryTobias Lorenz1-0/+8
This patch adds blacklist entries in hid-quirks.c to let the usbhid driver ignore the si470x radio devices. They are now handled by the new radio-si470x driver. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Logitech Extreme 3D needs NOGET quirkJiri Kosina1-0/+2
Logitech Extreme 3D needs NOGET quirk, otherwise it times out at the time of connect. Reported-by: Mike Sharov <msharov@softhome.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Refactor MS Presenter 8K key mappingJan Kiszka1-4/+5
Following the suggestion of Jonas, this patch maps the special keys of the MS Presenter 8000 to targets that should allow for better re-mapping according to individual use cases (i.e. I avoided hard-wiring to standard keys). This time I also included the last missing key event (switching back from presentation mode). The optimal Xmodmap customization for using the Presenter with OpenOffice now looks like this for me: keycode 175 = Escape keycode 179 = F5 keysym XF86Forward = Right keysym XF86Back = Left Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: MS Presenter mapping for PID 0x0701Jiri Kosina1-3/+5
0x045e/0x0701 also needs the hid-input mapping quirk established by quirk_microsoft_presenter_8k(). Reported-by: Jonas Delrue <jonas_delrue@hotmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Support Samsung IR remoteRobert Schedel2-0/+37
Samsung USB remotes (0419:0001) are rejected by kernel 2.6.23, because the report descriptor from the remote contains a 48 bit HID report field. HID 1.11 states: Fields may span at most 4 bytes. This patch, based on 2.6.23, fixes this by modifying the internal report descriptor in hid-quirks.c. Additional user space support (e.g. LIRC) is required to fetch the information from the hiddev interface. The burden to reconstruct the data is moved into userspace (lirc through hiddev). There is no need to set HID_QUIRK_HIDDEV quirk, as the device has also output applications, which trigger the creation of hiddev device automatically. Signed-off-by: Robert Schedel <r.schedel@yahoo.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: fix compilation of hidbp drivers without usbhidJiri Kosina2-0/+4
We can use the blacklist only if usbhid code is compiled. Reported-by: jurriaan <thunder7@xs4all.nl> Cc: Pascal Terjan <pterjan@mandriva.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Blacklist the Gretag-Macbeth Huey display colorimeterNicolas Mailhot1-0/+4
The Gretag-Macbeth Huey display colorimeter claims to be an HID device but isn't. As a result the linux HID device will claim it, preventing FLOSS software like Argyll CMS from talking to it. Tested-by: Frederic Crozat <fcrozat@mandriva.com> Signed-off-by: Nicolas Mailhot <nicolas.mailhot@laposte.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: the `bit' in hidinput_mapping_quirks() is an out parameterFengguang Wu3-20/+20
Fix a panic, by changing hidinput_mapping_quirks(,, unsigned long *bit,) to hidinput_mapping_quirks(,, unsigned long **bit,) The `bit' in this function is an out parameter. Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: remove redundant WARN_ON()s in order not to scare usersJiri Kosina1-2/+10
The WARN_ON() in implement() and extract() spit out stacktraces and a lot of other information that might make users think that there is something seriously wrong with the system. WARN_ON() should not be deliberately triggerable by userspace application, which these can be. Usually this WARN_ON() triggers when hid2hci utility is sending the data that don't correspond to the device's report descriptor. Convert these messages to more friendly printk(). Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: force hiddev creation for SONY PS3 controllerBastien Nocera1-1/+1
The device is not discoverable, and needs to be poked to set its master, the Bluetooth device it will try to connect to when the "Home" button is pressed without a cable plugged in. Using libusb means disconnecting the device from its driver to get the report descriptor. Using hiddev, we can poke it without relinquishing control over it, so when you plug it in, it would still work as a pad. This could be then used by sixpair program, after it is rewritten to use hiddev instead of libusb. Signed-off-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Use hid blacklist in usbmouse/usbkbdPascal Terjan3-0/+14
This fixes wacom tablets not working if usbmouse is loaded. Signed-off-by: Pascal Terjan <pterjan@mandriva.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: proper handling of MS 4k and 6k devicesJiri Kosina3-4/+8
This removes ugly macros IS_* to distinguish devices that need special handling in hid-input, and establish proper quirks for them. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: remove unused variable in quirk event handlerJiri Kosina1-1/+0
Remove unused variable in quirk event handler. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: hid-input quirk for BTC 8193Jiri Kosina3-0/+40
BTC 8193 keyboard handles its scrollwheel in very non-standard way. It produces two non-standard usages for scrolling up and down, in both cases with postive value equaling to 1. We handle this by temporary mapping, which we then catch in quirk event handler, and remap to negative HWHEEL even in order to introduce correct behavior. Also the button requires special mapping, as it triggers standard-violating usage code. Reported in kernel.org bugzilla #9385 Reported-by: Kir Kolyshkin <kir@sacred.ru> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: separate hid-input event quirks from generic codeJiri Kosina3-59/+71
This patch separates also the hid-input quirks that have to be applied at the time the event occurs, so that the generic code handling HUT-compliant devices is not messed up by them too much. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: refactor mapping to input subsystem for quirky devicesJiri Kosina4-155/+337
Currently, the handling of mapping between hid and input for devices that don't conform to HUT 1.12 specification is very messy -- no per-device handling, no blacklists, conditions on idVendor and idProduct placed all over the code. This patch moves all the device-specific input mapping to a separate file, and introduces a blacklist-style handling for non-standard device-specific mappings. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Microsoft Wireless Optical Desktop 3.0 quirkDrew Fisher1-0/+2
Make the Microsoft Wireless Optical Desktop 3.0 work as a mouse. Microsoft Wireless Optical Desktop 3.0 doesn't properly describe its interface class. Specifically, since it doesn't mark the second interface as a mouse (bInterfaceSubclass = 0), it doesn't get HID_QUIRK_NOGET applied to the interface, and then acts broken when polled. Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Add support for Logitech Elite keyboardsCarlos Corbacho1-0/+2
Reuse the quirks from the Cordless Desktop LX500 - stops some of the extra keys being reported as mouse buttons. Signed-off-by: Carlos Corbacho <cathectic@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: add full support for Genius KB-29EJiri Kosina3-0/+23
Genius KB-29E has broken report descriptor, which causes some of the Consumer usages to appear incorrectly as Button usages. We fix it by fixing the report descriptor before it is being parsed. Also a few of the keys violate the HUT standard, so they need a special handling. They currently fall into "Reserved" range as per HUT 1.12. Reported-by: Szekeres Istvan <szekeres@iii.hu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: fix a potential bug in pointer castingLi Zefan1-3/+4
Don't directly cast list_head * to foo *, this works only when list is the first member of struct foo, and we should not make the assumption how members are ordered in the structure. i.e. struct *f = (struct *f)pos will work if: struct foo { struct list_head list; int i; }; but will fail if: struct foo { int i; struct list_head list; } Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Implement horizontal wheel handling for A4 Tech X5-005DPavel Troller3-3/+22
This mouse distinguishes horizontal wheel from vertical by a special "pseudo event" GenericDesktop.00b8, with values of 0 for vertical and 8 for horizontal wheel. Because this event is supplied by the parser too late, we need to delay a wheel event, wait for this one and send either REL_WHEEL or REL_HWHEEL to input depending on the event value. Signed-off-by: Pavel Troller <patrol@sinus.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Add support for Apple aluminum USB keyboards.Michel Daenzer3-3/+32
Reuse the existing quirks for Apple laptop USB keyboards. Signed-off-by: Michel Daenzer <michel@tungstengraphics.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Rename some code identifiers from PowerBook specific to Apple genericMichel Daenzer3-54/+55
Preserve identifiers exposed in build and run time configuration though in order not to break existing configurations. This is in preparation for adding support for Apple aluminum USB keyboards. Signed-off-by: Michel Daenzer <michel@tungstengraphics.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Map MS Presenter 8000 bottom-side buttonsJan Kiszka1-2/+14
The MS Presenter 8000 bluetooth mouse is a "dual-use" device: If you press a button on the top, you can turn it around and find special keys on the other side, useful for presentations. This patch maps those three bottom-keys that are not already detected to the intended functions. The magic bottom on the top is mapped to F5 when we switch from mouse to presenter mode in order to activate the presentation mode in the related software (e.g. OpenOffice). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28[ARM] 4795/1: S3C244X: Add armclk and setparent callBen Dooks1-0/+37
Add armclk to the supported clocks on the S3C2440 and S3C2442 to better represent the DVS state which controls whether FCLK or HCLK is fed to the ARM core. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-01-28[ARM] 4794/1: S3C24XX: Comonise S3C2440 and S3C2442 clock codeBen Dooks4-42/+103
Merge together the bits of the S3C2440 and S3C2442 clock code that can be. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-01-28[ARM] 4793/1: S3C24XX: Add IRQ->GPIO pin mapping functionBen Dooks2-0/+27
Add the reverse of s3c2410_gpio_getirq to convert a IRQ number into a GPIO pin number. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>