diff options
48 files changed, 358 insertions, 195 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index a0f6842368c3..d3aae1f9b4c1 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -147,6 +147,11 @@ tcp_available_congestion_control - STRING | |||
147 | More congestion control algorithms may be available as modules, | 147 | More congestion control algorithms may be available as modules, |
148 | but not loaded. | 148 | but not loaded. |
149 | 149 | ||
150 | tcp_base_mss - INTEGER | ||
151 | The initial value of search_low to be used by Packetization Layer | ||
152 | Path MTU Discovery (MTU probing). If MTU probing is enabled, | ||
153 | this is the inital MSS used by the connection. | ||
154 | |||
150 | tcp_congestion_control - STRING | 155 | tcp_congestion_control - STRING |
151 | Set the congestion control algorithm to be used for new | 156 | Set the congestion control algorithm to be used for new |
152 | connections. The algorithm "reno" is always available, but | 157 | connections. The algorithm "reno" is always available, but |
@@ -243,6 +248,27 @@ tcp_mem - vector of 3 INTEGERs: min, pressure, max | |||
243 | Defaults are calculated at boot time from amount of available | 248 | Defaults are calculated at boot time from amount of available |
244 | memory. | 249 | memory. |
245 | 250 | ||
251 | tcp_moderate_rcvbuf - BOOLEAN | ||
252 | If set, TCP performs receive buffer autotuning, attempting to | ||
253 | automatically size the buffer (no greater than tcp_rmem[2]) to | ||
254 | match the size required by the path for full throughput. Enabled by | ||
255 | default. | ||
256 | |||
257 | tcp_mtu_probing - INTEGER | ||
258 | Controls TCP Packetization-Layer Path MTU Discovery. Takes three | ||
259 | values: | ||
260 | 0 - Disabled | ||
261 | 1 - Disabled by default, enabled when an ICMP black hole detected | ||
262 | 2 - Always enabled, use initial MSS of tcp_base_mss. | ||
263 | |||
264 | tcp_no_metrics_save - BOOLEAN | ||
265 | By default, TCP saves various connection metrics in the route cache | ||
266 | when the connection closes, so that connections established in the | ||
267 | near future can use these to set initial conditions. Usually, this | ||
268 | increases overall performance, but may sometimes cause performance | ||
269 | degredation. If set, TCP will not cache metrics on closing | ||
270 | connections. | ||
271 | |||
246 | tcp_orphan_retries - INTEGER | 272 | tcp_orphan_retries - INTEGER |
247 | How may times to retry before killing TCP connection, closed | 273 | How may times to retry before killing TCP connection, closed |
248 | by our side. Default value 7 corresponds to ~50sec-16min | 274 | by our side. Default value 7 corresponds to ~50sec-16min |
diff --git a/MAINTAINERS b/MAINTAINERS index 480ccb9d6cc9..1dfba85ca7b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1492,6 +1492,7 @@ HID CORE LAYER | |||
1492 | P: Jiri Kosina | 1492 | P: Jiri Kosina |
1493 | M: jkosina@suse.cz | 1493 | M: jkosina@suse.cz |
1494 | L: linux-input@atrey.karlin.mff.cuni.cz | 1494 | L: linux-input@atrey.karlin.mff.cuni.cz |
1495 | T: git kernel.org:/pub/scm/linux/kernel/git/jikos/hid.git | ||
1495 | S: Maintained | 1496 | S: Maintained |
1496 | 1497 | ||
1497 | HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS | 1498 | HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS |
@@ -3423,6 +3424,7 @@ USB HID/HIDBP DRIVERS | |||
3423 | P: Jiri Kosina | 3424 | P: Jiri Kosina |
3424 | M: jkosina@suse.cz | 3425 | M: jkosina@suse.cz |
3425 | L: linux-usb-devel@lists.sourceforge.net | 3426 | L: linux-usb-devel@lists.sourceforge.net |
3427 | T: git kernel.org:/pub/scm/linux/kernel/git/jikos/hid.git | ||
3426 | S: Maintained | 3428 | S: Maintained |
3427 | 3429 | ||
3428 | USB HUB DRIVER | 3430 | USB HUB DRIVER |
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index 59eef403c60a..860b8b60526c 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.21-rc1 | 3 | # Linux kernel version: 2.6.21-rc2 |
4 | # Mon Feb 26 10:45:21 2007 | 4 | # Wed Feb 28 09:50:51 2007 |
5 | # | 5 | # |
6 | CONFIG_SPARC=y | 6 | CONFIG_SPARC=y |
7 | CONFIG_SPARC64=y | 7 | CONFIG_SPARC64=y |
@@ -1219,6 +1219,7 @@ CONFIG_USB_HIDDEV=y | |||
1219 | # CONFIG_USB_SISUSBVGA is not set | 1219 | # CONFIG_USB_SISUSBVGA is not set |
1220 | # CONFIG_USB_LD is not set | 1220 | # CONFIG_USB_LD is not set |
1221 | # CONFIG_USB_TRANCEVIBRATOR is not set | 1221 | # CONFIG_USB_TRANCEVIBRATOR is not set |
1222 | # CONFIG_USB_IOWARRIOR is not set | ||
1222 | # CONFIG_USB_TEST is not set | 1223 | # CONFIG_USB_TEST is not set |
1223 | 1224 | ||
1224 | # | 1225 | # |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 7452399501b4..f4ee1afe488f 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -667,7 +667,6 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
667 | 667 | ||
668 | if (item.format != HID_ITEM_FORMAT_SHORT) { | 668 | if (item.format != HID_ITEM_FORMAT_SHORT) { |
669 | dbg("unexpected long global item"); | 669 | dbg("unexpected long global item"); |
670 | kfree(device->collection); | ||
671 | hid_free_device(device); | 670 | hid_free_device(device); |
672 | kfree(parser); | 671 | kfree(parser); |
673 | return NULL; | 672 | return NULL; |
@@ -676,7 +675,6 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
676 | if (dispatch_type[item.type](parser, &item)) { | 675 | if (dispatch_type[item.type](parser, &item)) { |
677 | dbg("item %u %u %u %u parsing failed\n", | 676 | dbg("item %u %u %u %u parsing failed\n", |
678 | item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag); | 677 | item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag); |
679 | kfree(device->collection); | ||
680 | hid_free_device(device); | 678 | hid_free_device(device); |
681 | kfree(parser); | 679 | kfree(parser); |
682 | return NULL; | 680 | return NULL; |
@@ -685,14 +683,12 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
685 | if (start == end) { | 683 | if (start == end) { |
686 | if (parser->collection_stack_ptr) { | 684 | if (parser->collection_stack_ptr) { |
687 | dbg("unbalanced collection at end of report description"); | 685 | dbg("unbalanced collection at end of report description"); |
688 | kfree(device->collection); | ||
689 | hid_free_device(device); | 686 | hid_free_device(device); |
690 | kfree(parser); | 687 | kfree(parser); |
691 | return NULL; | 688 | return NULL; |
692 | } | 689 | } |
693 | if (parser->local.delimiter_depth) { | 690 | if (parser->local.delimiter_depth) { |
694 | dbg("unbalanced delimiter at end of report description"); | 691 | dbg("unbalanced delimiter at end of report description"); |
695 | kfree(device->collection); | ||
696 | hid_free_device(device); | 692 | hid_free_device(device); |
697 | kfree(parser); | 693 | kfree(parser); |
698 | return NULL; | 694 | return NULL; |
@@ -703,7 +699,6 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
703 | } | 699 | } |
704 | 700 | ||
705 | dbg("item fetching failed at offset %d\n", (int)(end - start)); | 701 | dbg("item fetching failed at offset %d\n", (int)(end - start)); |
706 | kfree(device->collection); | ||
707 | hid_free_device(device); | 702 | hid_free_device(device); |
708 | kfree(parser); | 703 | kfree(parser); |
709 | return NULL; | 704 | return NULL; |
@@ -880,7 +875,7 @@ static void hid_output_field(struct hid_field *field, __u8 *data) | |||
880 | 875 | ||
881 | /* make sure the unused bits in the last byte are zeros */ | 876 | /* make sure the unused bits in the last byte are zeros */ |
882 | if (count > 0 && size > 0) | 877 | if (count > 0 && size > 0) |
883 | data[(count*size-1)/8] = 0; | 878 | data[(offset+count*size-1)/8] = 0; |
884 | 879 | ||
885 | for (n = 0; n < count; n++) { | 880 | for (n = 0; n < count; n++) { |
886 | if (field->logical_minimum < 0) /* signed values */ | 881 | if (field->logical_minimum < 0) /* signed values */ |
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 89241be4ec9b..83c4126b37c3 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
@@ -29,6 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <linux/hid.h> | 31 | #include <linux/hid.h> |
32 | #include <linux/hid-debug.h> | ||
32 | 33 | ||
33 | struct hid_usage_entry { | 34 | struct hid_usage_entry { |
34 | unsigned page; | 35 | unsigned page; |
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 25d180a24fc4..c8434023ba65 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * $Id: hid-input.c,v 1.2 2002/04/23 00:59:25 rdamazio Exp $ | 2 | * $Id: hid-input.c,v 1.2 2002/04/23 00:59:25 rdamazio Exp $ |
3 | * | 3 | * |
4 | * Copyright (c) 2000-2001 Vojtech Pavlik | 4 | * Copyright (c) 2000-2001 Vojtech Pavlik |
5 | * Copyright (c) 2006 Jiri Kosina | 5 | * Copyright (c) 2006-2007 Jiri Kosina |
6 | * | 6 | * |
7 | * HID to Linux Input mapping | 7 | * HID to Linux Input mapping |
8 | */ | 8 | */ |
@@ -71,7 +71,6 @@ static const struct { | |||
71 | #define map_led(c) do { usage->code = c; usage->type = EV_LED; bit = input->ledbit; max = LED_MAX; } while (0) | 71 | #define map_led(c) do { usage->code = c; usage->type = EV_LED; bit = input->ledbit; max = LED_MAX; } while (0) |
72 | 72 | ||
73 | #define map_abs_clear(c) do { map_abs(c); clear_bit(c, bit); } while (0) | 73 | #define map_abs_clear(c) do { map_abs(c); clear_bit(c, bit); } while (0) |
74 | #define map_rel_clear(c) do { map_rel(c); clear_bit(c, bit); } while (0) | ||
75 | #define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0) | 74 | #define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0) |
76 | 75 | ||
77 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | 76 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK |
@@ -296,7 +295,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
296 | } | 295 | } |
297 | } | 296 | } |
298 | 297 | ||
299 | map_key_clear(code); | 298 | map_key(code); |
300 | break; | 299 | break; |
301 | 300 | ||
302 | 301 | ||
@@ -347,9 +346,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
347 | case HID_GD_RX: case HID_GD_RY: case HID_GD_RZ: | 346 | case HID_GD_RX: case HID_GD_RY: case HID_GD_RZ: |
348 | case HID_GD_SLIDER: case HID_GD_DIAL: case HID_GD_WHEEL: | 347 | case HID_GD_SLIDER: case HID_GD_DIAL: case HID_GD_WHEEL: |
349 | if (field->flags & HID_MAIN_ITEM_RELATIVE) | 348 | if (field->flags & HID_MAIN_ITEM_RELATIVE) |
350 | map_rel_clear(usage->hid & 0xf); | 349 | map_rel(usage->hid & 0xf); |
351 | else | 350 | else |
352 | map_abs_clear(usage->hid & 0xf); | 351 | map_abs(usage->hid & 0xf); |
353 | break; | 352 | break; |
354 | 353 | ||
355 | case HID_GD_HATSWITCH: | 354 | case HID_GD_HATSWITCH: |
@@ -519,7 +518,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
519 | case 0x22f: map_key_clear(KEY_ZOOMRESET); break; | 518 | case 0x22f: map_key_clear(KEY_ZOOMRESET); break; |
520 | case 0x233: map_key_clear(KEY_SCROLLUP); break; | 519 | case 0x233: map_key_clear(KEY_SCROLLUP); break; |
521 | case 0x234: map_key_clear(KEY_SCROLLDOWN); break; | 520 | case 0x234: map_key_clear(KEY_SCROLLDOWN); break; |
522 | case 0x238: map_rel_clear(REL_HWHEEL); break; | 521 | case 0x238: map_rel(REL_HWHEEL); break; |
523 | case 0x25f: map_key_clear(KEY_CANCEL); break; | 522 | case 0x25f: map_key_clear(KEY_CANCEL); break; |
524 | case 0x279: map_key_clear(KEY_REDO); break; | 523 | case 0x279: map_key_clear(KEY_REDO); break; |
525 | 524 | ||
@@ -532,6 +531,26 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
532 | case 0x302: map_key_clear(KEY_PROG2); break; | 531 | case 0x302: map_key_clear(KEY_PROG2); break; |
533 | case 0x303: map_key_clear(KEY_PROG3); break; | 532 | case 0x303: map_key_clear(KEY_PROG3); break; |
534 | 533 | ||
534 | /* Reported on Logitech S510 wireless keyboard */ | ||
535 | case 0x101f: map_key_clear(KEY_ZOOMIN); break; | ||
536 | case 0x1020: map_key_clear(KEY_ZOOMOUT); break; | ||
537 | case 0x1021: map_key_clear(KEY_ZOOMRESET); break; | ||
538 | /* this one is marked as 'Rotate' */ | ||
539 | case 0x1028: map_key_clear(KEY_ANGLE); break; | ||
540 | case 0x1029: map_key_clear(KEY_SHUFFLE); break; | ||
541 | case 0x1041: map_key_clear(KEY_BATTERY); break; | ||
542 | case 0x1042: map_key_clear(KEY_WORDPROCESSOR); break; | ||
543 | case 0x1043: map_key_clear(KEY_SPREADSHEET); break; | ||
544 | case 0x1044: map_key_clear(KEY_PRESENTATION); break; | ||
545 | case 0x1045: map_key_clear(KEY_UNDO); break; | ||
546 | case 0x1046: map_key_clear(KEY_REDO); break; | ||
547 | case 0x1047: map_key_clear(KEY_PRINT); break; | ||
548 | case 0x1048: map_key_clear(KEY_SAVE); break; | ||
549 | case 0x1049: map_key_clear(KEY_PROG1); break; | ||
550 | case 0x104a: map_key_clear(KEY_PROG2); break; | ||
551 | case 0x104b: map_key_clear(KEY_PROG3); break; | ||
552 | case 0x104c: map_key_clear(KEY_PROG4); break; | ||
553 | |||
535 | default: goto ignore; | 554 | default: goto ignore; |
536 | } | 555 | } |
537 | break; | 556 | break; |
@@ -647,6 +666,12 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
647 | 666 | ||
648 | set_bit(usage->type, input->evbit); | 667 | set_bit(usage->type, input->evbit); |
649 | 668 | ||
669 | if (device->quirks & HID_QUIRK_DUPLICATE_USAGES && | ||
670 | (usage->type == EV_KEY || | ||
671 | usage->type == EV_REL || | ||
672 | usage->type == EV_ABS)) | ||
673 | clear_bit(usage->code, bit); | ||
674 | |||
650 | while (usage->code <= max && test_and_set_bit(usage->code, bit)) | 675 | while (usage->code <= max && test_and_set_bit(usage->code, bit)) |
651 | usage->code = find_next_zero_bit(bit, max + 1, usage->code); | 676 | usage->code = find_next_zero_bit(bit, max + 1, usage->code); |
652 | 677 | ||
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 15d12fce34df..127a94b9a1b5 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -469,9 +469,9 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, | |||
469 | fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) { | 469 | fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) { |
470 | 470 | ||
471 | fw->data[BLUEBIRD_01_ID_OFFSET + 2] = | 471 | fw->data[BLUEBIRD_01_ID_OFFSET + 2] = |
472 | udev->descriptor.idProduct + 1; | 472 | le16_to_cpu(udev->descriptor.idProduct) + 1; |
473 | fw->data[BLUEBIRD_01_ID_OFFSET + 3] = | 473 | fw->data[BLUEBIRD_01_ID_OFFSET + 3] = |
474 | udev->descriptor.idProduct >> 8; | 474 | le16_to_cpu(udev->descriptor.idProduct) >> 8; |
475 | 475 | ||
476 | return usb_cypress_load_firmware(udev, fw, CYPRESS_FX2); | 476 | return usb_cypress_load_firmware(udev, fw, CYPRESS_FX2); |
477 | } | 477 | } |
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index 4a198d4755b0..b5acb11c0bc9 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -119,6 +119,8 @@ static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_f | |||
119 | struct dvb_usb_adapter *adap = fe->dvb->priv; | 119 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
120 | u8 b[5]; | 120 | u8 b[5]; |
121 | dvb_usb_tuner_calc_regs(fe,fep,b, 5); | 121 | dvb_usb_tuner_calc_regs(fe,fep,b, 5); |
122 | if (fe->ops.i2c_gate_ctrl) | ||
123 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
122 | return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0); | 124 | return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0); |
123 | } | 125 | } |
124 | 126 | ||
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index 682dc7ce48d9..710c11a68296 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c | |||
@@ -1022,7 +1022,7 @@ static ssize_t cafe_v4l_read(struct file *filp, | |||
1022 | char __user *buffer, size_t len, loff_t *pos) | 1022 | char __user *buffer, size_t len, loff_t *pos) |
1023 | { | 1023 | { |
1024 | struct cafe_camera *cam = filp->private_data; | 1024 | struct cafe_camera *cam = filp->private_data; |
1025 | int ret; | 1025 | int ret = 0; |
1026 | 1026 | ||
1027 | /* | 1027 | /* |
1028 | * Perhaps we're in speculative read mode and already | 1028 | * Perhaps we're in speculative read mode and already |
@@ -1251,8 +1251,6 @@ static int cafe_vidioc_reqbufs(struct file *filp, void *priv, | |||
1251 | 1251 | ||
1252 | if (cam->n_sbufs == 0) /* no luck at all - ret already set */ | 1252 | if (cam->n_sbufs == 0) /* no luck at all - ret already set */ |
1253 | kfree(cam->sb_bufs); | 1253 | kfree(cam->sb_bufs); |
1254 | else | ||
1255 | ret = 0; | ||
1256 | req->count = cam->n_sbufs; /* In case of partial success */ | 1254 | req->count = cam->n_sbufs; /* In case of partial success */ |
1257 | 1255 | ||
1258 | out: | 1256 | out: |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index cc535ca713d2..774d2536555b 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -633,7 +633,7 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd, | |||
633 | { | 633 | { |
634 | struct v4l2_register *reg = arg; | 634 | struct v4l2_register *reg = arg; |
635 | 635 | ||
636 | if (reg->i2c_id != I2C_DRIVERID_CX25840) | 636 | if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip)) |
637 | return -EINVAL; | 637 | return -EINVAL; |
638 | if (!capable(CAP_SYS_ADMIN)) | 638 | if (!capable(CAP_SYS_ADMIN)) |
639 | return -EPERM; | 639 | return -EPERM; |
@@ -903,13 +903,13 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, | |||
903 | state->vbi_line_offset = 8; | 903 | state->vbi_line_offset = 8; |
904 | state->id = id; | 904 | state->id = id; |
905 | 905 | ||
906 | i2c_attach_client(client); | ||
907 | |||
906 | if (state->is_cx25836) | 908 | if (state->is_cx25836) |
907 | cx25836_initialize(client); | 909 | cx25836_initialize(client); |
908 | else | 910 | else |
909 | cx25840_initialize(client, 1); | 911 | cx25840_initialize(client, 1); |
910 | 912 | ||
911 | i2c_attach_client(client); | ||
912 | |||
913 | return 0; | 913 | return 0; |
914 | } | 914 | } |
915 | 915 | ||
diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c index 1958d4016ea1..0e86b9d033ac 100644 --- a/drivers/media/video/cx25840/cx25840-firmware.c +++ b/drivers/media/video/cx25840/cx25840-firmware.c | |||
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | #define FWSEND 48 | 38 | #define FWSEND 48 |
39 | 39 | ||
40 | #define FWDEV(x) &((x)->adapter->dev) | 40 | #define FWDEV(x) &((x)->dev) |
41 | 41 | ||
42 | static char *firmware = FWFILE; | 42 | static char *firmware = FWFILE; |
43 | 43 | ||
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index a97be1bdc31d..bdfe2af70124 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -1389,7 +1389,7 @@ static int vidioc_g_register (struct file *file, void *fh, | |||
1389 | { | 1389 | { |
1390 | struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; | 1390 | struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; |
1391 | 1391 | ||
1392 | if (reg->i2c_id != 0) | 1392 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) |
1393 | return -EINVAL; | 1393 | return -EINVAL; |
1394 | /* cx2388x has a 24-bit register space */ | 1394 | /* cx2388x has a 24-bit register space */ |
1395 | reg->val = cx_read(reg->reg&0xffffff); | 1395 | reg->val = cx_read(reg->reg&0xffffff); |
@@ -1401,7 +1401,7 @@ static int vidioc_s_register (struct file *file, void *fh, | |||
1401 | { | 1401 | { |
1402 | struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; | 1402 | struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; |
1403 | 1403 | ||
1404 | if (reg->i2c_id != 0) | 1404 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) |
1405 | return -EINVAL; | 1405 | return -EINVAL; |
1406 | cx_write(reg->reg&0xffffff, reg->val); | 1406 | cx_write(reg->reg&0xffffff, reg->val); |
1407 | return 0; | 1407 | return 0; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index a1ca0f5007e0..1cd4bb3ae260 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -3256,8 +3256,8 @@ static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) | |||
3256 | 3256 | ||
3257 | 3257 | ||
3258 | int pvr2_hdw_register_access(struct pvr2_hdw *hdw, | 3258 | int pvr2_hdw_register_access(struct pvr2_hdw *hdw, |
3259 | u32 chip_id, u64 reg_id, | 3259 | u32 match_type, u32 match_chip, u64 reg_id, |
3260 | int setFl,u32 *val_ptr) | 3260 | int setFl,u64 *val_ptr) |
3261 | { | 3261 | { |
3262 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 3262 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
3263 | struct list_head *item; | 3263 | struct list_head *item; |
@@ -3268,13 +3268,16 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw, | |||
3268 | 3268 | ||
3269 | if (!capable(CAP_SYS_ADMIN)) return -EPERM; | 3269 | if (!capable(CAP_SYS_ADMIN)) return -EPERM; |
3270 | 3270 | ||
3271 | req.i2c_id = chip_id; | 3271 | req.match_type = match_type; |
3272 | req.match_chip = match_chip; | ||
3272 | req.reg = reg_id; | 3273 | req.reg = reg_id; |
3273 | if (setFl) req.val = *val_ptr; | 3274 | if (setFl) req.val = *val_ptr; |
3274 | mutex_lock(&hdw->i2c_list_lock); do { | 3275 | mutex_lock(&hdw->i2c_list_lock); do { |
3275 | list_for_each(item,&hdw->i2c_clients) { | 3276 | list_for_each(item,&hdw->i2c_clients) { |
3276 | cp = list_entry(item,struct pvr2_i2c_client,list); | 3277 | cp = list_entry(item,struct pvr2_i2c_client,list); |
3277 | if (cp->client->driver->id != chip_id) continue; | 3278 | if (!v4l2_chip_match_i2c_client(cp->client, req.match_type, req.match_chip)) { |
3279 | continue; | ||
3280 | } | ||
3278 | stat = pvr2_i2c_client_cmd( | 3281 | stat = pvr2_i2c_client_cmd( |
3279 | cp,(setFl ? VIDIOC_DBG_S_REGISTER : | 3282 | cp,(setFl ? VIDIOC_DBG_S_REGISTER : |
3280 | VIDIOC_DBG_G_REGISTER),&req); | 3283 | VIDIOC_DBG_G_REGISTER),&req); |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 566a8ef7e121..0c9cca43ff85 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h | |||
@@ -217,13 +217,14 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *, | |||
217 | enum pvr2_v4l_type index,int); | 217 | enum pvr2_v4l_type index,int); |
218 | 218 | ||
219 | /* Direct read/write access to chip's registers: | 219 | /* Direct read/write access to chip's registers: |
220 | chip_id - unique id of chip (e.g. I2C_DRIVERD_xxxx) | 220 | match_type - how to interpret match_chip (e.g. driver ID, i2c address) |
221 | match_chip - chip match value (e.g. I2C_DRIVERD_xxxx) | ||
221 | reg_id - register number to access | 222 | reg_id - register number to access |
222 | setFl - true to set the register, false to read it | 223 | setFl - true to set the register, false to read it |
223 | val_ptr - storage location for source / result. */ | 224 | val_ptr - storage location for source / result. */ |
224 | int pvr2_hdw_register_access(struct pvr2_hdw *, | 225 | int pvr2_hdw_register_access(struct pvr2_hdw *, |
225 | u32 chip_id,u64 reg_id, | 226 | u32 match_type, u32 match_chip,u64 reg_id, |
226 | int setFl,u32 *val_ptr); | 227 | int setFl,u64 *val_ptr); |
227 | 228 | ||
228 | /* The following entry points are all lower level things you normally don't | 229 | /* The following entry points are all lower level things you normally don't |
229 | want to worry about. */ | 230 | want to worry about. */ |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 4fe4136204c7..5313d342666e 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | |||
@@ -740,11 +740,11 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, | |||
740 | case VIDIOC_DBG_S_REGISTER: | 740 | case VIDIOC_DBG_S_REGISTER: |
741 | case VIDIOC_DBG_G_REGISTER: | 741 | case VIDIOC_DBG_G_REGISTER: |
742 | { | 742 | { |
743 | u32 val; | 743 | u64 val; |
744 | struct v4l2_register *req = (struct v4l2_register *)arg; | 744 | struct v4l2_register *req = (struct v4l2_register *)arg; |
745 | if (cmd == VIDIOC_DBG_S_REGISTER) val = req->val; | 745 | if (cmd == VIDIOC_DBG_S_REGISTER) val = req->val; |
746 | ret = pvr2_hdw_register_access( | 746 | ret = pvr2_hdw_register_access( |
747 | hdw,req->i2c_id,req->reg, | 747 | hdw,req->match_type,req->match_chip,req->reg, |
748 | cmd == VIDIOC_DBG_S_REGISTER,&val); | 748 | cmd == VIDIOC_DBG_S_REGISTER,&val); |
749 | if (cmd == VIDIOC_DBG_G_REGISTER) req->val = val; | 749 | if (cmd == VIDIOC_DBG_G_REGISTER) req->val = val; |
750 | break; | 750 | break; |
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index c4f066d6668e..7735b6758921 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1425,7 +1425,7 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1425 | { | 1425 | { |
1426 | struct v4l2_register *reg = arg; | 1426 | struct v4l2_register *reg = arg; |
1427 | 1427 | ||
1428 | if (reg->i2c_id != I2C_DRIVERID_SAA711X) | 1428 | if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip)) |
1429 | return -EINVAL; | 1429 | return -EINVAL; |
1430 | if (!capable(CAP_SYS_ADMIN)) | 1430 | if (!capable(CAP_SYS_ADMIN)) |
1431 | return -EPERM; | 1431 | return -EPERM; |
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index bd9c4f3ad02e..654863db1591 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -619,7 +619,7 @@ static int saa7127_command(struct i2c_client *client, | |||
619 | { | 619 | { |
620 | struct v4l2_register *reg = arg; | 620 | struct v4l2_register *reg = arg; |
621 | 621 | ||
622 | if (reg->i2c_id != I2C_DRIVERID_SAA7127) | 622 | if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip)) |
623 | return -EINVAL; | 623 | return -EINVAL; |
624 | if (!capable(CAP_SYS_ADMIN)) | 624 | if (!capable(CAP_SYS_ADMIN)) |
625 | return -EPERM; | 625 | return -EPERM; |
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 886b5df7c9d1..d5ec05f56adf 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c | |||
@@ -955,7 +955,7 @@ static int tvp5150_command(struct i2c_client *c, | |||
955 | { | 955 | { |
956 | struct v4l2_register *reg = arg; | 956 | struct v4l2_register *reg = arg; |
957 | 957 | ||
958 | if (reg->i2c_id != I2C_DRIVERID_TVP5150) | 958 | if (!v4l2_chip_match_i2c_client(c, reg->match_type, reg->match_chip)) |
959 | return -EINVAL; | 959 | return -EINVAL; |
960 | if (!capable(CAP_SYS_ADMIN)) | 960 | if (!capable(CAP_SYS_ADMIN)) |
961 | return -EPERM; | 961 | return -EPERM; |
diff --git a/drivers/media/video/upd64031a.c b/drivers/media/video/upd64031a.c index b3b5fd536dc3..28d1133a3b7a 100644 --- a/drivers/media/video/upd64031a.c +++ b/drivers/media/video/upd64031a.c | |||
@@ -167,7 +167,7 @@ static int upd64031a_command(struct i2c_client *client, unsigned int cmd, void * | |||
167 | { | 167 | { |
168 | struct v4l2_register *reg = arg; | 168 | struct v4l2_register *reg = arg; |
169 | 169 | ||
170 | if (reg->i2c_id != I2C_DRIVERID_UPD64031A) | 170 | if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip)) |
171 | return -EINVAL; | 171 | return -EINVAL; |
172 | if (!capable(CAP_SYS_ADMIN)) | 172 | if (!capable(CAP_SYS_ADMIN)) |
173 | return -EPERM; | 173 | return -EPERM; |
diff --git a/drivers/media/video/upd64083.c b/drivers/media/video/upd64083.c index 8852903e7a92..fe38224150d8 100644 --- a/drivers/media/video/upd64083.c +++ b/drivers/media/video/upd64083.c | |||
@@ -144,7 +144,7 @@ static int upd64083_command(struct i2c_client *client, unsigned int cmd, void *a | |||
144 | { | 144 | { |
145 | struct v4l2_register *reg = arg; | 145 | struct v4l2_register *reg = arg; |
146 | 146 | ||
147 | if (reg->i2c_id != I2C_DRIVERID_UPD64083) | 147 | if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip)) |
148 | return -EINVAL; | 148 | return -EINVAL; |
149 | if (!capable(CAP_SYS_ADMIN)) | 149 | if (!capable(CAP_SYS_ADMIN)) |
150 | return -EPERM; | 150 | return -EPERM; |
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index ae5f42562c0c..6fc14557d623 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -521,7 +521,7 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file, | |||
521 | struct v4l2_register *reg = arg; | 521 | struct v4l2_register *reg = arg; |
522 | int errCode; | 522 | int errCode; |
523 | 523 | ||
524 | if (reg->i2c_id != 0) | 524 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) |
525 | return -EINVAL; | 525 | return -EINVAL; |
526 | if (!capable(CAP_SYS_ADMIN)) | 526 | if (!capable(CAP_SYS_ADMIN)) |
527 | return -EPERM; | 527 | return -EPERM; |
@@ -540,7 +540,7 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file, | |||
540 | 540 | ||
541 | PDEBUG(DBG_IOCTL, "VIDIOC_DBG_%c_REGISTER reg=0x%02X, value=0x%02X", | 541 | PDEBUG(DBG_IOCTL, "VIDIOC_DBG_%c_REGISTER reg=0x%02X, value=0x%02X", |
542 | cmd == VIDIOC_DBG_G_REGISTER ? 'G' : 'S', | 542 | cmd == VIDIOC_DBG_G_REGISTER ? 'G' : 'S', |
543 | (unsigned int)reg->reg, reg->val); | 543 | (unsigned int)reg->reg, (unsigned int)reg->val); |
544 | return 0; | 544 | return 0; |
545 | } | 545 | } |
546 | #endif | 546 | #endif |
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index ddfd80c5618b..54747606eae1 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <linux/mm.h> | 51 | #include <linux/mm.h> |
52 | #include <linux/string.h> | 52 | #include <linux/string.h> |
53 | #include <linux/errno.h> | 53 | #include <linux/errno.h> |
54 | #include <linux/i2c.h> | ||
54 | #include <asm/uaccess.h> | 55 | #include <asm/uaccess.h> |
55 | #include <asm/system.h> | 56 | #include <asm/system.h> |
56 | #include <asm/pgtable.h> | 57 | #include <asm/pgtable.h> |
@@ -365,13 +366,21 @@ static const char *v4l2_ioctls[] = { | |||
365 | [_IOC_NR(VIDIOC_ENUMAUDOUT)] = "VIDIOC_ENUMAUDOUT", | 366 | [_IOC_NR(VIDIOC_ENUMAUDOUT)] = "VIDIOC_ENUMAUDOUT", |
366 | [_IOC_NR(VIDIOC_G_PRIORITY)] = "VIDIOC_G_PRIORITY", | 367 | [_IOC_NR(VIDIOC_G_PRIORITY)] = "VIDIOC_G_PRIORITY", |
367 | [_IOC_NR(VIDIOC_S_PRIORITY)] = "VIDIOC_S_PRIORITY", | 368 | [_IOC_NR(VIDIOC_S_PRIORITY)] = "VIDIOC_S_PRIORITY", |
368 | #if 1 | ||
369 | [_IOC_NR(VIDIOC_G_SLICED_VBI_CAP)] = "VIDIOC_G_SLICED_VBI_CAP", | 369 | [_IOC_NR(VIDIOC_G_SLICED_VBI_CAP)] = "VIDIOC_G_SLICED_VBI_CAP", |
370 | #endif | ||
371 | [_IOC_NR(VIDIOC_LOG_STATUS)] = "VIDIOC_LOG_STATUS", | 370 | [_IOC_NR(VIDIOC_LOG_STATUS)] = "VIDIOC_LOG_STATUS", |
372 | [_IOC_NR(VIDIOC_G_EXT_CTRLS)] = "VIDIOC_G_EXT_CTRLS", | 371 | [_IOC_NR(VIDIOC_G_EXT_CTRLS)] = "VIDIOC_G_EXT_CTRLS", |
373 | [_IOC_NR(VIDIOC_S_EXT_CTRLS)] = "VIDIOC_S_EXT_CTRLS", | 372 | [_IOC_NR(VIDIOC_S_EXT_CTRLS)] = "VIDIOC_S_EXT_CTRLS", |
374 | [_IOC_NR(VIDIOC_TRY_EXT_CTRLS)] = "VIDIOC_TRY_EXT_CTRLS" | 373 | [_IOC_NR(VIDIOC_TRY_EXT_CTRLS)] = "VIDIOC_TRY_EXT_CTRLS", |
374 | #if 1 | ||
375 | [_IOC_NR(VIDIOC_ENUM_FRAMESIZES)] = "VIDIOC_ENUM_FRAMESIZES", | ||
376 | [_IOC_NR(VIDIOC_ENUM_FRAMEINTERVALS)] = "VIDIOC_ENUM_FRAMEINTERVALS", | ||
377 | [_IOC_NR(VIDIOC_G_ENC_INDEX)] = "VIDIOC_G_ENC_INDEX", | ||
378 | [_IOC_NR(VIDIOC_ENCODER_CMD)] = "VIDIOC_ENCODER_CMD", | ||
379 | [_IOC_NR(VIDIOC_TRY_ENCODER_CMD)] = "VIDIOC_TRY_ENCODER_CMD", | ||
380 | |||
381 | [_IOC_NR(VIDIOC_DBG_S_REGISTER)] = "VIDIOC_DBG_S_REGISTER", | ||
382 | [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER", | ||
383 | #endif | ||
375 | }; | 384 | }; |
376 | #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) | 385 | #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) |
377 | 386 | ||
@@ -395,9 +404,6 @@ static const char *v4l2_int_ioctls[] = { | |||
395 | [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY", | 404 | [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY", |
396 | [_IOC_NR(TDA9887_SET_CONFIG)] = "TDA9887_SET_CONFIG", | 405 | [_IOC_NR(TDA9887_SET_CONFIG)] = "TDA9887_SET_CONFIG", |
397 | 406 | ||
398 | [_IOC_NR(VIDIOC_DBG_S_REGISTER)] = "VIDIOC_DBG_S_REGISTER", | ||
399 | [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER", | ||
400 | |||
401 | [_IOC_NR(VIDIOC_INT_S_TUNER_MODE)] = "VIDIOC_INT_S_TUNER_MODE", | 407 | [_IOC_NR(VIDIOC_INT_S_TUNER_MODE)] = "VIDIOC_INT_S_TUNER_MODE", |
402 | [_IOC_NR(VIDIOC_INT_RESET)] = "VIDIOC_INT_RESET", | 408 | [_IOC_NR(VIDIOC_INT_RESET)] = "VIDIOC_INT_RESET", |
403 | [_IOC_NR(VIDIOC_INT_AUDIO_CLOCK_FREQ)] = "VIDIOC_INT_AUDIO_CLOCK_FREQ", | 409 | [_IOC_NR(VIDIOC_INT_AUDIO_CLOCK_FREQ)] = "VIDIOC_INT_AUDIO_CLOCK_FREQ", |
@@ -947,6 +953,28 @@ u32 v4l2_ctrl_next(const u32 * const * ctrl_classes, u32 id) | |||
947 | return **ctrl_classes; | 953 | return **ctrl_classes; |
948 | } | 954 | } |
949 | 955 | ||
956 | int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 match_type, u32 match_chip) | ||
957 | { | ||
958 | switch (match_type) { | ||
959 | case V4L2_CHIP_MATCH_I2C_DRIVER: | ||
960 | return (c != NULL && c->driver != NULL && c->driver->id == match_chip); | ||
961 | case V4L2_CHIP_MATCH_I2C_ADDR: | ||
962 | return (c != NULL && c->addr == match_chip); | ||
963 | default: | ||
964 | return 0; | ||
965 | } | ||
966 | } | ||
967 | |||
968 | int v4l2_chip_match_host(u32 match_type, u32 match_chip) | ||
969 | { | ||
970 | switch (match_type) { | ||
971 | case V4L2_CHIP_MATCH_HOST: | ||
972 | return match_chip == 0; | ||
973 | default: | ||
974 | return 0; | ||
975 | } | ||
976 | } | ||
977 | |||
950 | /* ----------------------------------------------------------------- */ | 978 | /* ----------------------------------------------------------------- */ |
951 | 979 | ||
952 | EXPORT_SYMBOL(v4l2_norm_to_name); | 980 | EXPORT_SYMBOL(v4l2_norm_to_name); |
@@ -970,6 +998,9 @@ EXPORT_SYMBOL(v4l2_ctrl_query_menu); | |||
970 | EXPORT_SYMBOL(v4l2_ctrl_query_fill); | 998 | EXPORT_SYMBOL(v4l2_ctrl_query_fill); |
971 | EXPORT_SYMBOL(v4l2_ctrl_query_fill_std); | 999 | EXPORT_SYMBOL(v4l2_ctrl_query_fill_std); |
972 | 1000 | ||
1001 | EXPORT_SYMBOL(v4l2_chip_match_i2c_client); | ||
1002 | EXPORT_SYMBOL(v4l2_chip_match_host); | ||
1003 | |||
973 | /* | 1004 | /* |
974 | * Local variables: | 1005 | * Local variables: |
975 | * c-basic-offset: 8 | 1006 | * c-basic-offset: 8 |
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index dc9b1ef678aa..011938fb7e0e 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -1342,6 +1342,42 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1342 | ret=vfd->vidioc_s_jpegcomp(file, fh, p); | 1342 | ret=vfd->vidioc_s_jpegcomp(file, fh, p); |
1343 | break; | 1343 | break; |
1344 | } | 1344 | } |
1345 | case VIDIOC_G_ENC_INDEX: | ||
1346 | { | ||
1347 | struct v4l2_enc_idx *p=arg; | ||
1348 | |||
1349 | if (!vfd->vidioc_g_enc_index) | ||
1350 | break; | ||
1351 | ret=vfd->vidioc_g_enc_index(file, fh, p); | ||
1352 | if (!ret) | ||
1353 | dbgarg (cmd, "entries=%d, entries_cap=%d\n", | ||
1354 | p->entries,p->entries_cap); | ||
1355 | break; | ||
1356 | } | ||
1357 | case VIDIOC_ENCODER_CMD: | ||
1358 | { | ||
1359 | struct v4l2_encoder_cmd *p=arg; | ||
1360 | |||
1361 | if (!vfd->vidioc_encoder_cmd) | ||
1362 | break; | ||
1363 | ret=vfd->vidioc_encoder_cmd(file, fh, p); | ||
1364 | if (!ret) | ||
1365 | dbgarg (cmd, "cmd=%d, flags=%d\n", | ||
1366 | p->cmd,p->flags); | ||
1367 | break; | ||
1368 | } | ||
1369 | case VIDIOC_TRY_ENCODER_CMD: | ||
1370 | { | ||
1371 | struct v4l2_encoder_cmd *p=arg; | ||
1372 | |||
1373 | if (!vfd->vidioc_try_encoder_cmd) | ||
1374 | break; | ||
1375 | ret=vfd->vidioc_try_encoder_cmd(file, fh, p); | ||
1376 | if (!ret) | ||
1377 | dbgarg (cmd, "cmd=%d, flags=%d\n", | ||
1378 | p->cmd,p->flags); | ||
1379 | break; | ||
1380 | } | ||
1345 | case VIDIOC_G_PARM: | 1381 | case VIDIOC_G_PARM: |
1346 | { | 1382 | { |
1347 | struct v4l2_streamparm *p=arg; | 1383 | struct v4l2_streamparm *p=arg; |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index ef09952f2039..12ec8b432953 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (c) 1999 Andreas Gal | 4 | * Copyright (c) 1999 Andreas Gal |
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | */ | 8 | */ |
9 | 9 | ||
10 | /* | 10 | /* |
@@ -27,9 +27,6 @@ | |||
27 | #include <linux/input.h> | 27 | #include <linux/input.h> |
28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
29 | 29 | ||
30 | #undef DEBUG | ||
31 | #undef DEBUG_DATA | ||
32 | |||
33 | #include <linux/usb.h> | 30 | #include <linux/usb.h> |
34 | 31 | ||
35 | #include <linux/hid.h> | 32 | #include <linux/hid.h> |
@@ -758,6 +755,8 @@ void usbhid_init_reports(struct hid_device *hid) | |||
758 | 755 | ||
759 | #define USB_VENDOR_ID_LOGITECH 0x046d | 756 | #define USB_VENDOR_ID_LOGITECH 0x046d |
760 | #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 | 757 | #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 |
758 | #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER_2 0xc517 | ||
759 | #define USB_DEVICE_ID_DINOVO_EDGE 0xc714 | ||
761 | 760 | ||
762 | #define USB_VENDOR_ID_IMATION 0x0718 | 761 | #define USB_VENDOR_ID_IMATION 0x0718 |
763 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 | 762 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 |
@@ -778,6 +777,8 @@ static const struct hid_blacklist { | |||
778 | unsigned quirks; | 777 | unsigned quirks; |
779 | } hid_blacklist[] = { | 778 | } hid_blacklist[] = { |
780 | 779 | ||
780 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_EDGE, HID_QUIRK_DUPLICATE_USAGES }, | ||
781 | |||
781 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_01, HID_QUIRK_IGNORE }, | 782 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_01, HID_QUIRK_IGNORE }, |
782 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_10, HID_QUIRK_IGNORE }, | 783 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_10, HID_QUIRK_IGNORE }, |
783 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_20, HID_QUIRK_IGNORE }, | 784 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_20, HID_QUIRK_IGNORE }, |
@@ -944,6 +945,7 @@ static const struct hid_blacklist { | |||
944 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, | 945 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, |
945 | 946 | ||
946 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER, HID_QUIRK_BAD_RELATIVE_KEYS }, | 947 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER, HID_QUIRK_BAD_RELATIVE_KEYS }, |
948 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER_2, HID_QUIRK_LOGITECH_S510_DESCRIPTOR }, | ||
947 | 949 | ||
948 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | 950 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, |
949 | 951 | ||
@@ -1041,6 +1043,22 @@ static void hid_fixup_sony_ps3_controller(struct usb_device *dev, int ifnum) | |||
1041 | kfree(buf); | 1043 | kfree(buf); |
1042 | } | 1044 | } |
1043 | 1045 | ||
1046 | /* | ||
1047 | * Logitech S510 keyboard sends in report #3 keys which are far | ||
1048 | * above the logical maximum described in descriptor. This extends | ||
1049 | * the original value of 0x28c of logical maximum to 0x104d | ||
1050 | */ | ||
1051 | static void hid_fixup_s510_descriptor(unsigned char *rdesc, int rsize) | ||
1052 | { | ||
1053 | if (rsize >= 90 && rdesc[83] == 0x26 | ||
1054 | && rdesc[84] == 0x8c | ||
1055 | && rdesc[85] == 0x02) { | ||
1056 | info("Fixing up Logitech S510 report descriptor"); | ||
1057 | rdesc[84] = rdesc[89] = 0x4d; | ||
1058 | rdesc[85] = rdesc[90] = 0x10; | ||
1059 | } | ||
1060 | } | ||
1061 | |||
1044 | static struct hid_device *usb_hid_configure(struct usb_interface *intf) | 1062 | static struct hid_device *usb_hid_configure(struct usb_interface *intf) |
1045 | { | 1063 | { |
1046 | struct usb_host_interface *interface = intf->cur_altsetting; | 1064 | struct usb_host_interface *interface = intf->cur_altsetting; |
@@ -1109,7 +1127,10 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1109 | if ((quirks & HID_QUIRK_CYMOTION)) | 1127 | if ((quirks & HID_QUIRK_CYMOTION)) |
1110 | hid_fixup_cymotion_descriptor(rdesc, rsize); | 1128 | hid_fixup_cymotion_descriptor(rdesc, rsize); |
1111 | 1129 | ||
1112 | #ifdef DEBUG_DATA | 1130 | if (quirks & HID_QUIRK_LOGITECH_S510_DESCRIPTOR) |
1131 | hid_fixup_s510_descriptor(rdesc, rsize); | ||
1132 | |||
1133 | #ifdef CONFIG_HID_DEBUG | ||
1113 | printk(KERN_DEBUG __FILE__ ": report descriptor (size %u, read %d) = ", rsize, n); | 1134 | printk(KERN_DEBUG __FILE__ ": report descriptor (size %u, read %d) = ", rsize, n); |
1114 | for (n = 0; n < rsize; n++) | 1135 | for (n = 0; n < rsize; n++) |
1115 | printk(" %02x", (unsigned char) rdesc[n]); | 1136 | printk(" %02x", (unsigned char) rdesc[n]); |
@@ -1225,8 +1246,8 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1225 | le16_to_cpu(dev->descriptor.idProduct)); | 1246 | le16_to_cpu(dev->descriptor.idProduct)); |
1226 | 1247 | ||
1227 | hid->bus = BUS_USB; | 1248 | hid->bus = BUS_USB; |
1228 | hid->vendor = dev->descriptor.idVendor; | 1249 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); |
1229 | hid->product = dev->descriptor.idProduct; | 1250 | hid->product = le16_to_cpu(dev->descriptor.idProduct); |
1230 | 1251 | ||
1231 | usb_make_path(dev, hid->phys, sizeof(hid->phys)); | 1252 | usb_make_path(dev, hid->phys, sizeof(hid->phys)); |
1232 | strlcat(hid->phys, "/input", sizeof(hid->phys)); | 1253 | strlcat(hid->phys, "/input", sizeof(hid->phys)); |
diff --git a/include/asm-sparc64/dma.h b/include/asm-sparc64/dma.h index 93e5a062df88..1bf4f7a8fbe1 100644 --- a/include/asm-sparc64/dma.h +++ b/include/asm-sparc64/dma.h | |||
@@ -205,10 +205,6 @@ do { u32 tmp = sbus_readl((__regs) + DMA_CSR); \ | |||
205 | #define for_each_dvma(dma) \ | 205 | #define for_each_dvma(dma) \ |
206 | for((dma) = dma_chain; (dma); (dma) = (dma)->next) | 206 | for((dma) = dma_chain; (dma); (dma) = (dma)->next) |
207 | 207 | ||
208 | extern int get_dma_list(char *); | ||
209 | extern int request_dma(unsigned int, __const__ char *); | ||
210 | extern void free_dma(unsigned int); | ||
211 | |||
212 | /* From PCI */ | 208 | /* From PCI */ |
213 | 209 | ||
214 | #ifdef CONFIG_PCI | 210 | #ifdef CONFIG_PCI |
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h index d3895873e4c7..be9509c8f8c1 100644 --- a/include/asm-sparc64/parport.h +++ b/include/asm-sparc64/parport.h | |||
@@ -23,8 +23,30 @@ static struct sparc_ebus_info { | |||
23 | struct ebus_dma_info info; | 23 | struct ebus_dma_info info; |
24 | unsigned int addr; | 24 | unsigned int addr; |
25 | unsigned int count; | 25 | unsigned int count; |
26 | int lock; | ||
26 | } sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; | 27 | } sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; |
27 | 28 | ||
29 | static __inline__ int request_dma(unsigned int dmanr, const char *device_id) | ||
30 | { | ||
31 | if (dmanr >= PARPORT_PC_MAX_PORTS) | ||
32 | return -EINVAL; | ||
33 | if (xchg(&sparc_ebus_dmas[dmanr].lock, 1) != 0) | ||
34 | return -EBUSY; | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | static __inline__ void free_dma(unsigned int dmanr) | ||
39 | { | ||
40 | if (dmanr >= PARPORT_PC_MAX_PORTS) { | ||
41 | printk(KERN_WARNING "Trying to free DMA%d\n", dmanr); | ||
42 | return; | ||
43 | } | ||
44 | if (xchg(&sparc_ebus_dmas[dmanr].lock, 0) == 0) { | ||
45 | printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr); | ||
46 | return; | ||
47 | } | ||
48 | } | ||
49 | |||
28 | static __inline__ void enable_dma(unsigned int dmanr) | 50 | static __inline__ void enable_dma(unsigned int dmanr) |
29 | { | 51 | { |
30 | ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); | 52 | ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); |
diff --git a/include/linux/hid.h b/include/linux/hid.h index d26b08f461f2..8c97d4d3fdb0 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * Copyright (c) 1999 Andreas Gal | 7 | * Copyright (c) 1999 Andreas Gal |
8 | * Copyright (c) 2000-2001 Vojtech Pavlik | 8 | * Copyright (c) 2000-2001 Vojtech Pavlik |
9 | * Copyright (c) 2006 Jiri Kosina | 9 | * Copyright (c) 2006-2007 Jiri Kosina |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* | 12 | /* |
@@ -267,6 +267,8 @@ struct hid_item { | |||
267 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 | 267 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 |
268 | #define HID_QUIRK_IGNORE_MOUSE 0x00040000 | 268 | #define HID_QUIRK_IGNORE_MOUSE 0x00040000 |
269 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 | 269 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 |
270 | #define HID_QUIRK_LOGITECH_S510_DESCRIPTOR 0x00100000 | ||
271 | #define HID_QUIRK_DUPLICATE_USAGES 0x00200000 | ||
270 | 272 | ||
271 | /* | 273 | /* |
272 | * This is the global environment of the parser. This information is | 274 | * This is the global environment of the parser. This information is |
@@ -292,7 +294,7 @@ struct hid_global { | |||
292 | */ | 294 | */ |
293 | 295 | ||
294 | #define HID_MAX_DESCRIPTOR_SIZE 4096 | 296 | #define HID_MAX_DESCRIPTOR_SIZE 4096 |
295 | #define HID_MAX_USAGES 1024 | 297 | #define HID_MAX_USAGES 8192 |
296 | #define HID_DEFAULT_NUM_COLLECTIONS 16 | 298 | #define HID_DEFAULT_NUM_COLLECTIONS 16 |
297 | 299 | ||
298 | struct hid_local { | 300 | struct hid_local { |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index a60995afe334..3f3e7a648da3 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #ifdef CONFIG_HUGETLB_PAGE | 4 | #ifdef CONFIG_HUGETLB_PAGE |
5 | 5 | ||
6 | #include <linux/mempolicy.h> | 6 | #include <linux/mempolicy.h> |
7 | #include <linux/shm.h> | ||
7 | #include <asm/tlbflush.h> | 8 | #include <asm/tlbflush.h> |
8 | 9 | ||
9 | struct ctl_table; | 10 | struct ctl_table; |
@@ -168,7 +169,12 @@ void hugetlb_put_quota(struct address_space *mapping); | |||
168 | 169 | ||
169 | static inline int is_file_hugepages(struct file *file) | 170 | static inline int is_file_hugepages(struct file *file) |
170 | { | 171 | { |
171 | return file->f_op == &hugetlbfs_file_operations; | 172 | if (file->f_op == &hugetlbfs_file_operations) |
173 | return 1; | ||
174 | if (is_file_shm_hugepages(file)) | ||
175 | return 1; | ||
176 | |||
177 | return 0; | ||
172 | } | 178 | } |
173 | 179 | ||
174 | static inline void set_file_hugepages(struct file *file) | 180 | static inline void set_file_hugepages(struct file *file) |
diff --git a/include/linux/shm.h b/include/linux/shm.h index a2c896ad0bef..ad2e3af65997 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -96,12 +96,17 @@ struct shmid_kernel /* private to the kernel */ | |||
96 | 96 | ||
97 | #ifdef CONFIG_SYSVIPC | 97 | #ifdef CONFIG_SYSVIPC |
98 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); | 98 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); |
99 | extern int is_file_shm_hugepages(struct file *file); | ||
99 | #else | 100 | #else |
100 | static inline long do_shmat(int shmid, char __user *shmaddr, | 101 | static inline long do_shmat(int shmid, char __user *shmaddr, |
101 | int shmflg, unsigned long *addr) | 102 | int shmflg, unsigned long *addr) |
102 | { | 103 | { |
103 | return -ENOSYS; | 104 | return -ENOSYS; |
104 | } | 105 | } |
106 | static inline int is_file_shm_hugepages(struct file *file) | ||
107 | { | ||
108 | return 0; | ||
109 | } | ||
105 | #endif | 110 | #endif |
106 | 111 | ||
107 | #endif /* __KERNEL__ */ | 112 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 28157a36e6cc..fcd35a210e7f 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage { | |||
16 | /* _SS_MAXSIZE value minus size of ss_family */ | 16 | /* _SS_MAXSIZE value minus size of ss_family */ |
17 | } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ | 17 | } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ |
18 | 18 | ||
19 | #ifdef __KERNEL__ | 19 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) |
20 | 20 | ||
21 | #include <asm/socket.h> /* arch-dependent defines */ | 21 | #include <asm/socket.h> /* arch-dependent defines */ |
22 | #include <linux/sockios.h> /* the SIOCxxx I/O controls */ | 22 | #include <linux/sockios.h> /* the SIOCxxx I/O controls */ |
diff --git a/include/linux/stat.h b/include/linux/stat.h index 4f8539ccff6c..679ef0d70b6b 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | #ifdef __KERNEL__ | 10 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) |
11 | 11 | ||
12 | #define S_IFMT 00170000 | 12 | #define S_IFMT 00170000 |
13 | #define S_IFSOCK 0140000 | 13 | #define S_IFSOCK 0140000 |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 21805b500aa2..523405e1e1f6 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -211,9 +211,8 @@ static inline int sysfs_add_file_to_group(struct kobject *kobj, | |||
211 | } | 211 | } |
212 | 212 | ||
213 | static inline void sysfs_remove_file_from_group(struct kobject *kobj, | 213 | static inline void sysfs_remove_file_from_group(struct kobject *kobj, |
214 | const struct attribute *attr, const char *group); | 214 | const struct attribute *attr, const char *group) |
215 | { | 215 | { |
216 | ; | ||
217 | } | 216 | } |
218 | 217 | ||
219 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) | 218 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 65a165f918c9..441b877bf150 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1193,6 +1193,55 @@ struct v4l2_audioout | |||
1193 | }; | 1193 | }; |
1194 | 1194 | ||
1195 | /* | 1195 | /* |
1196 | * M P E G S E R V I C E S | ||
1197 | * | ||
1198 | * NOTE: EXPERIMENTAL API | ||
1199 | */ | ||
1200 | #if 1 | ||
1201 | #define V4L2_ENC_IDX_FRAME_I (0) | ||
1202 | #define V4L2_ENC_IDX_FRAME_P (1) | ||
1203 | #define V4L2_ENC_IDX_FRAME_B (2) | ||
1204 | #define V4L2_ENC_IDX_FRAME_MASK (0xf) | ||
1205 | |||
1206 | struct v4l2_enc_idx_entry { | ||
1207 | __u64 offset; | ||
1208 | __u64 pts; | ||
1209 | __u32 length; | ||
1210 | __u32 flags; | ||
1211 | __u32 reserved[2]; | ||
1212 | }; | ||
1213 | |||
1214 | #define V4L2_ENC_IDX_ENTRIES (64) | ||
1215 | struct v4l2_enc_idx { | ||
1216 | __u32 entries; | ||
1217 | __u32 entries_cap; | ||
1218 | __u32 reserved[4]; | ||
1219 | struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES]; | ||
1220 | }; | ||
1221 | |||
1222 | |||
1223 | #define V4L2_ENC_CMD_START (0) | ||
1224 | #define V4L2_ENC_CMD_STOP (1) | ||
1225 | #define V4L2_ENC_CMD_PAUSE (2) | ||
1226 | #define V4L2_ENC_CMD_RESUME (3) | ||
1227 | |||
1228 | /* Flags for V4L2_ENC_CMD_STOP */ | ||
1229 | #define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0) | ||
1230 | |||
1231 | struct v4l2_encoder_cmd { | ||
1232 | __u32 cmd; | ||
1233 | __u32 flags; | ||
1234 | union { | ||
1235 | struct { | ||
1236 | __u32 data[8]; | ||
1237 | } raw; | ||
1238 | }; | ||
1239 | }; | ||
1240 | |||
1241 | #endif | ||
1242 | |||
1243 | |||
1244 | /* | ||
1196 | * D A T A S E R V I C E S ( V B I ) | 1245 | * D A T A S E R V I C E S ( V B I ) |
1197 | * | 1246 | * |
1198 | * Data services API by Michael Schimek | 1247 | * Data services API by Michael Schimek |
@@ -1303,13 +1352,21 @@ struct v4l2_streamparm | |||
1303 | 1352 | ||
1304 | /* | 1353 | /* |
1305 | * A D V A N C E D D E B U G G I N G | 1354 | * A D V A N C E D D E B U G G I N G |
1355 | * | ||
1356 | * NOTE: EXPERIMENTAL API | ||
1306 | */ | 1357 | */ |
1307 | 1358 | ||
1308 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ | 1359 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ |
1360 | |||
1361 | #define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ | ||
1362 | #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */ | ||
1363 | #define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ | ||
1364 | |||
1309 | struct v4l2_register { | 1365 | struct v4l2_register { |
1366 | __u32 match_type; /* Match type */ | ||
1367 | __u32 match_chip; /* Match this chip, meaning determined by match_type */ | ||
1310 | __u64 reg; | 1368 | __u64 reg; |
1311 | __u32 i2c_id; /* I2C driver ID of the I2C chip, or 0 for the host */ | 1369 | __u64 val; |
1312 | __u32 val; | ||
1313 | }; | 1370 | }; |
1314 | 1371 | ||
1315 | /* | 1372 | /* |
@@ -1378,10 +1435,14 @@ struct v4l2_register { | |||
1378 | #if 1 | 1435 | #if 1 |
1379 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) | 1436 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) |
1380 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) | 1437 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) |
1438 | #define VIDIOC_G_ENC_INDEX _IOR ('V', 76, struct v4l2_enc_idx) | ||
1439 | #define VIDIOC_ENCODER_CMD _IOWR ('V', 77, struct v4l2_encoder_cmd) | ||
1440 | #define VIDIOC_TRY_ENCODER_CMD _IOWR ('V', 78, struct v4l2_encoder_cmd) | ||
1441 | |||
1442 | /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | ||
1443 | #define VIDIOC_DBG_S_REGISTER _IOW ('V', 79, struct v4l2_register) | ||
1444 | #define VIDIOC_DBG_G_REGISTER _IOWR ('V', 80, struct v4l2_register) | ||
1381 | #endif | 1445 | #endif |
1382 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | ||
1383 | #define VIDIOC_DBG_S_REGISTER _IOW ('d', 100, struct v4l2_register) | ||
1384 | #define VIDIOC_DBG_G_REGISTER _IOWR('d', 101, struct v4l2_register) | ||
1385 | 1446 | ||
1386 | #ifdef __OLD_VIDIOC_ | 1447 | #ifdef __OLD_VIDIOC_ |
1387 | /* for compatibility, will go away some day */ | 1448 | /* for compatibility, will go away some day */ |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 244e440edb53..6eaeec98ed89 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -94,6 +94,14 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); | |||
94 | 94 | ||
95 | /* ------------------------------------------------------------------------- */ | 95 | /* ------------------------------------------------------------------------- */ |
96 | 96 | ||
97 | /* Register/chip ident helper function */ | ||
98 | |||
99 | struct i2c_client; /* forward reference */ | ||
100 | int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 id_type, u32 chip_id); | ||
101 | int v4l2_chip_match_host(u32 id_type, u32 chip_id); | ||
102 | |||
103 | /* ------------------------------------------------------------------------- */ | ||
104 | |||
97 | /* Internal ioctls */ | 105 | /* Internal ioctls */ |
98 | 106 | ||
99 | /* VIDIOC_INT_DECODE_VBI_LINE */ | 107 | /* VIDIOC_INT_DECODE_VBI_LINE */ |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index aeec56992ef5..1dd3d3239ecf 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -271,6 +271,12 @@ struct video_device | |||
271 | struct v4l2_jpegcompression *a); | 271 | struct v4l2_jpegcompression *a); |
272 | int (*vidioc_s_jpegcomp) (struct file *file, void *fh, | 272 | int (*vidioc_s_jpegcomp) (struct file *file, void *fh, |
273 | struct v4l2_jpegcompression *a); | 273 | struct v4l2_jpegcompression *a); |
274 | int (*vidioc_g_enc_index) (struct file *file, void *fh, | ||
275 | struct v4l2_enc_idx *a); | ||
276 | int (*vidioc_encoder_cmd) (struct file *file, void *fh, | ||
277 | struct v4l2_encoder_cmd *a); | ||
278 | int (*vidioc_try_encoder_cmd) (struct file *file, void *fh, | ||
279 | struct v4l2_encoder_cmd *a); | ||
274 | 280 | ||
275 | /* Stream type-dependent parameter ioctls */ | 281 | /* Stream type-dependent parameter ioctls */ |
276 | int (*vidioc_g_parm) (struct file *file, void *fh, | 282 | int (*vidioc_g_parm) (struct file *file, void *fh, |
diff --git a/include/net/sock.h b/include/net/sock.h index 03684e702d13..2c7d60ca3548 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1278,7 +1278,7 @@ static inline int sock_writeable(const struct sock *sk) | |||
1278 | 1278 | ||
1279 | static inline gfp_t gfp_any(void) | 1279 | static inline gfp_t gfp_any(void) |
1280 | { | 1280 | { |
1281 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; | 1281 | return in_atomic() ? GFP_ATOMIC : GFP_KERNEL; |
1282 | } | 1282 | } |
1283 | 1283 | ||
1284 | static inline long sock_rcvtimeo(const struct sock *sk, int noblock) | 1284 | static inline long sock_rcvtimeo(const struct sock *sk, int noblock) |
@@ -285,21 +285,41 @@ static int shm_release(struct inode *ino, struct file *file) | |||
285 | return 0; | 285 | return 0; |
286 | } | 286 | } |
287 | 287 | ||
288 | #ifndef CONFIG_MMU | 288 | static int shm_fsync(struct file *file, struct dentry *dentry, int datasync) |
289 | { | ||
290 | int (*fsync) (struct file *, struct dentry *, int datasync); | ||
291 | struct shm_file_data *sfd = shm_file_data(file); | ||
292 | int ret = -EINVAL; | ||
293 | |||
294 | fsync = sfd->file->f_op->fsync; | ||
295 | if (fsync) | ||
296 | ret = fsync(sfd->file, sfd->file->f_path.dentry, datasync); | ||
297 | return ret; | ||
298 | } | ||
299 | |||
289 | static unsigned long shm_get_unmapped_area(struct file *file, | 300 | static unsigned long shm_get_unmapped_area(struct file *file, |
290 | unsigned long addr, unsigned long len, unsigned long pgoff, | 301 | unsigned long addr, unsigned long len, unsigned long pgoff, |
291 | unsigned long flags) | 302 | unsigned long flags) |
292 | { | 303 | { |
293 | struct shm_file_data *sfd = shm_file_data(file); | 304 | struct shm_file_data *sfd = shm_file_data(file); |
294 | return sfd->file->f_op->get_unmapped_area(sfd->file, addr, len, pgoff, | 305 | return get_unmapped_area(sfd->file, addr, len, pgoff, flags); |
295 | flags); | 306 | } |
307 | |||
308 | int is_file_shm_hugepages(struct file *file) | ||
309 | { | ||
310 | int ret = 0; | ||
311 | |||
312 | if (file->f_op == &shm_file_operations) { | ||
313 | struct shm_file_data *sfd; | ||
314 | sfd = shm_file_data(file); | ||
315 | ret = is_file_hugepages(sfd->file); | ||
316 | } | ||
317 | return ret; | ||
296 | } | 318 | } |
297 | #else | ||
298 | #define shm_get_unmapped_area NULL | ||
299 | #endif | ||
300 | 319 | ||
301 | static const struct file_operations shm_file_operations = { | 320 | static const struct file_operations shm_file_operations = { |
302 | .mmap = shm_mmap, | 321 | .mmap = shm_mmap, |
322 | .fsync = shm_fsync, | ||
303 | .release = shm_release, | 323 | .release = shm_release, |
304 | .get_unmapped_area = shm_get_unmapped_area, | 324 | .get_unmapped_area = shm_get_unmapped_area, |
305 | }; | 325 | }; |
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index 3ab153d3c508..147015fe5c75 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c | |||
@@ -291,12 +291,11 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
291 | if (!capable(CAP_NET_ADMIN)) | 291 | if (!capable(CAP_NET_ADMIN)) |
292 | return -EPERM; | 292 | return -EPERM; |
293 | 293 | ||
294 | spin_lock_bh(&br->lock); | ||
295 | if ((p = br_get_port(br, args[1])) == NULL) | 294 | if ((p = br_get_port(br, args[1])) == NULL) |
296 | ret = -EINVAL; | 295 | ret = -EINVAL; |
297 | else | 296 | else |
298 | br_stp_set_path_cost(p, args[2]); | 297 | br_stp_set_path_cost(p, args[2]); |
299 | spin_unlock_bh(&br->lock); | 298 | |
300 | return ret; | 299 | return ret; |
301 | } | 300 | } |
302 | 301 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index f89ff151cfab..820761f9eeef 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2037,7 +2037,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) | |||
2037 | err: | 2037 | err: |
2038 | while ((skb = segs)) { | 2038 | while ((skb = segs)) { |
2039 | segs = skb->next; | 2039 | segs = skb->next; |
2040 | kfree(skb); | 2040 | kfree_skb(skb); |
2041 | } | 2041 | } |
2042 | return ERR_PTR(err); | 2042 | return ERR_PTR(err); |
2043 | } | 2043 | } |
diff --git a/net/dccp/output.c b/net/dccp/output.c index f5c6aca1dfa4..3282f2f2291b 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -269,7 +269,7 @@ void dccp_write_xmit(struct sock *sk, int block) | |||
269 | err); | 269 | err); |
270 | } else { | 270 | } else { |
271 | dccp_pr_debug("packet discarded\n"); | 271 | dccp_pr_debug("packet discarded\n"); |
272 | kfree(skb); | 272 | kfree_skb(skb); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | } | 275 | } |
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 30b1e520ad94..6b5c64f3c925 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -381,7 +381,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, | |||
381 | if (newsk != NULL) { | 381 | if (newsk != NULL) { |
382 | const struct inet_request_sock *ireq = inet_rsk(req); | 382 | const struct inet_request_sock *ireq = inet_rsk(req); |
383 | struct tcp_request_sock *treq = tcp_rsk(req); | 383 | struct tcp_request_sock *treq = tcp_rsk(req); |
384 | struct inet_connection_sock *newicsk = inet_csk(sk); | 384 | struct inet_connection_sock *newicsk = inet_csk(newsk); |
385 | struct tcp_sock *newtp; | 385 | struct tcp_sock *newtp; |
386 | 386 | ||
387 | /* Now setup tcp_sock */ | 387 | /* Now setup tcp_sock */ |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index f6ac65d36559..e16f1bba5dff 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -400,6 +400,8 @@ static void dev_forward_change(struct inet6_dev *idev) | |||
400 | ipv6_dev_mc_dec(dev, &addr); | 400 | ipv6_dev_mc_dec(dev, &addr); |
401 | } | 401 | } |
402 | for (ifa=idev->addr_list; ifa; ifa=ifa->if_next) { | 402 | for (ifa=idev->addr_list; ifa; ifa=ifa->if_next) { |
403 | if (ifa->flags&IFA_F_TENTATIVE) | ||
404 | continue; | ||
403 | if (idev->cnf.forwarding) | 405 | if (idev->cnf.forwarding) |
404 | addrconf_join_anycast(ifa); | 406 | addrconf_join_anycast(ifa); |
405 | else | 407 | else |
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index e5ef5979ade4..09117d63256f 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
@@ -461,6 +461,7 @@ static inline struct ifacaddr6 *ac6_get_first(struct seq_file *seq) | |||
461 | break; | 461 | break; |
462 | } | 462 | } |
463 | read_unlock_bh(&idev->lock); | 463 | read_unlock_bh(&idev->lock); |
464 | in6_dev_put(idev); | ||
464 | } | 465 | } |
465 | return im; | 466 | return im; |
466 | } | 467 | } |
diff --git a/net/ipx/ChangeLog b/net/ipx/ChangeLog deleted file mode 100644 index 3b29763751a3..000000000000 --- a/net/ipx/ChangeLog +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | Revision 0.21: Uses the new generic socket option code. | ||
2 | |||
3 | Revision 0.22: Gcc clean ups and drop out device registration. Use the | ||
4 | new multi-protocol edition of hard_header | ||
5 | |||
6 | Revision 0.23: IPX /proc by Mark Evans. Adding a route will | ||
7 | will overwrite any existing route to the same network. | ||
8 | |||
9 | Revision 0.24: Supports new /proc with no 4K limit | ||
10 | |||
11 | Revision 0.25: Add ephemeral sockets, passive local network | ||
12 | identification, support for local net 0 and | ||
13 | multiple datalinks <Greg Page> | ||
14 | |||
15 | Revision 0.26: Device drop kills IPX routes via it. (needed for module) | ||
16 | |||
17 | Revision 0.27: Autobind <Mark Evans> | ||
18 | |||
19 | Revision 0.28: Small fix for multiple local networks <Thomas Winder> | ||
20 | |||
21 | Revision 0.29: Assorted major errors removed <Mark Evans> | ||
22 | Small correction to promisc mode error fix <Alan Cox> | ||
23 | Asynchronous I/O support. Changed to use notifiers | ||
24 | and the newer packet_type stuff. Assorted major | ||
25 | fixes <Alejandro Liu> | ||
26 | |||
27 | Revision 0.30: Moved to net/ipx/... <Alan Cox> | ||
28 | Don't set address length on recvfrom that errors. | ||
29 | Incorrect verify_area. | ||
30 | |||
31 | Revision 0.31: New sk_buffs. This still needs a lot of | ||
32 | testing. <Alan Cox> | ||
33 | |||
34 | Revision 0.32: Using sock_alloc_send_skb, firewall hooks. <Alan Cox> | ||
35 | Supports sendmsg/recvmsg | ||
36 | |||
37 | Revision 0.33: Internal network support, routing changes, uses a | ||
38 | protocol private area for ipx data. | ||
39 | |||
40 | Revision 0.34: Module support. <Jim Freeman> | ||
41 | |||
42 | Revision 0.35: Checksum support. <Neil Turton>, hooked in by <Alan Cox> | ||
43 | Handles WIN95 discovery packets <Volker Lendecke> | ||
44 | |||
45 | Revision 0.36: Internal bump up for 2.1 | ||
46 | |||
47 | Revision 0.37: Began adding POSIXisms. | ||
48 | |||
49 | Revision 0.38: Asynchronous socket stuff made current. | ||
50 | |||
51 | Revision 0.39: SPX interfaces | ||
52 | |||
53 | Revision 0.40: Tiny SIOCGSTAMP fix (chris@cybernet.co.nz) | ||
54 | |||
55 | Revision 0.41: 802.2TR removed (p.norton@computer.org) | ||
56 | Fixed connecting to primary net, | ||
57 | Automatic binding on send & receive, | ||
58 | Martijn van Oosterhout <kleptogimp@geocities.com> | ||
59 | |||
60 | Revision 042: Multithreading - use spinlocks and refcounting to | ||
61 | protect some structures: ipx_interface sock list, list | ||
62 | of ipx interfaces, etc. | ||
63 | Bugfixes - do refcounting on net_devices, check function | ||
64 | results, etc. Thanks to davem and freitag for | ||
65 | suggestions and guidance. | ||
66 | Arnaldo Carvalho de Melo <acme@conectiva.com.br>, | ||
67 | November, 2000 | ||
68 | |||
69 | Revision 043: Shared SKBs, don't mangle packets, some cleanups | ||
70 | Arnaldo Carvalho de Melo <acme@conectiva.com.br>, | ||
71 | December, 2000 | ||
72 | |||
73 | Revision 044: Call ipxitf_hold on NETDEV_UP - acme | ||
74 | |||
75 | Revision 045: fix PPROP routing bug - acme | ||
76 | |||
77 | Revision 046: Further fixes to PPROP, ipxitf_create_internal was | ||
78 | doing an unneeded MOD_INC_USE_COUNT, implement | ||
79 | sysctl for ipx_pprop_broacasting, fix the ipx sysctl | ||
80 | handling, making it dynamic, some cleanups, thanks to | ||
81 | Petr Vandrovec for review and good suggestions. (acme) | ||
82 | |||
83 | Revision 047: Cleanups, CodingStyle changes, move the ncp connection | ||
84 | hack out of line - acme | ||
85 | |||
86 | Revision 048: Use sk->protinfo to store the pointer to IPX private | ||
87 | area, remove af_ipx from sk->protinfo and move ipx_opt | ||
88 | to include/net/ipx.h, use IPX_SK like DecNET, etc - acme | ||
89 | |||
90 | Revision 049: SPX support dropped, see comment in ipx_create - acme | ||
91 | |||
92 | Revision 050: Use seq_file for proc stuff, moving it to ipx_proc.c - acme | ||
93 | |||
94 | Other fixes: | ||
95 | |||
96 | Protect the module by a MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT pair. Also, now | ||
97 | usage count is managed this way: | ||
98 | -Count one if the auto_interface mode is on | ||
99 | -Count one per configured interface | ||
100 | |||
101 | Jacques Gelinas (jacques@solucorp.qc.ca) | ||
diff --git a/net/ipx/Kconfig b/net/ipx/Kconfig index 980a826f5d02..e9ad0062fbb6 100644 --- a/net/ipx/Kconfig +++ b/net/ipx/Kconfig | |||
@@ -16,8 +16,7 @@ config IPX | |||
16 | support", below. | 16 | support", below. |
17 | 17 | ||
18 | IPX is similar in scope to IP, while SPX, which runs on top of IPX, | 18 | IPX is similar in scope to IP, while SPX, which runs on top of IPX, |
19 | is similar to TCP. There is also experimental support for SPX in | 19 | is similar to TCP. |
20 | Linux (see "SPX networking", below). | ||
21 | 20 | ||
22 | To turn your Linux box into a fully featured NetWare file server and | 21 | To turn your Linux box into a fully featured NetWare file server and |
23 | IPX router, say Y here and fetch either lwared from | 22 | IPX router, say Y here and fetch either lwared from |
@@ -26,9 +25,6 @@ config IPX | |||
26 | information, read the IPX-HOWTO available from | 25 | information, read the IPX-HOWTO available from |
27 | <http://www.tldp.org/docs.html#howto>. | 26 | <http://www.tldp.org/docs.html#howto>. |
28 | 27 | ||
29 | General information about how to connect Linux, Windows machines and | ||
30 | Macs is on the WWW at <http://www.eats.com/linux_mac_win.html>. | ||
31 | |||
32 | The IPX driver would enlarge your kernel by about 16 KB. To compile | 28 | The IPX driver would enlarge your kernel by about 16 KB. To compile |
33 | this driver as a module, choose M here: the module will be called ipx. | 29 | this driver as a module, choose M here: the module will be called ipx. |
34 | Unless you want to integrate your Linux box with a local Novell | 30 | Unless you want to integrate your Linux box with a local Novell |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 11d504d0ac72..bf23e489e4cd 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -197,13 +197,12 @@ EXPORT_SYMBOL_GPL(nfnetlink_has_listeners); | |||
197 | 197 | ||
198 | int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) | 198 | int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) |
199 | { | 199 | { |
200 | gfp_t allocation = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; | ||
201 | int err = 0; | 200 | int err = 0; |
202 | 201 | ||
203 | NETLINK_CB(skb).dst_group = group; | 202 | NETLINK_CB(skb).dst_group = group; |
204 | if (echo) | 203 | if (echo) |
205 | atomic_inc(&skb->users); | 204 | atomic_inc(&skb->users); |
206 | netlink_broadcast(nfnl, skb, pid, group, allocation); | 205 | netlink_broadcast(nfnl, skb, pid, group, gfp_any()); |
207 | if (echo) | 206 | if (echo) |
208 | err = netlink_unicast(nfnl, skb, pid, MSG_DONTWAIT); | 207 | err = netlink_unicast(nfnl, skb, pid, MSG_DONTWAIT); |
209 | 208 | ||
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 5bc37181662e..b931edee4b8b 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -173,7 +173,7 @@ static int netlbl_unlabel_list(struct sk_buff *skb, struct genl_info *info) | |||
173 | return 0; | 173 | return 0; |
174 | 174 | ||
175 | list_failure: | 175 | list_failure: |
176 | kfree(ans_skb); | 176 | kfree_skb(ans_skb); |
177 | return ret_val; | 177 | return ret_val; |
178 | } | 178 | } |
179 | 179 | ||
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 256745321611..956cfe0ff7f8 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1401,7 +1401,7 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1401 | 1401 | ||
1402 | x = xfrm_state_lookup(&id->daddr, id->spi, id->proto, id->family); | 1402 | x = xfrm_state_lookup(&id->daddr, id->spi, id->proto, id->family); |
1403 | if (x == NULL) { | 1403 | if (x == NULL) { |
1404 | kfree(r_skb); | 1404 | kfree_skb(r_skb); |
1405 | return -ESRCH; | 1405 | return -ESRCH; |
1406 | } | 1406 | } |
1407 | 1407 | ||
@@ -1557,14 +1557,13 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1557 | struct xfrm_usersa_info *p = &ue->state; | 1557 | struct xfrm_usersa_info *p = &ue->state; |
1558 | 1558 | ||
1559 | x = xfrm_state_lookup(&p->id.daddr, p->id.spi, p->id.proto, p->family); | 1559 | x = xfrm_state_lookup(&p->id.daddr, p->id.spi, p->id.proto, p->family); |
1560 | err = -ENOENT; | ||
1561 | 1560 | ||
1561 | err = -ENOENT; | ||
1562 | if (x == NULL) | 1562 | if (x == NULL) |
1563 | return err; | 1563 | return err; |
1564 | 1564 | ||
1565 | err = -EINVAL; | ||
1566 | |||
1567 | spin_lock_bh(&x->lock); | 1565 | spin_lock_bh(&x->lock); |
1566 | err = -EINVAL; | ||
1568 | if (x->km.state != XFRM_STATE_VALID) | 1567 | if (x->km.state != XFRM_STATE_VALID) |
1569 | goto out; | 1568 | goto out; |
1570 | km_state_expired(x, ue->hard, current->pid); | 1569 | km_state_expired(x, ue->hard, current->pid); |
@@ -1574,6 +1573,7 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1574 | xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, | 1573 | xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, |
1575 | AUDIT_MAC_IPSEC_DELSA, 1, NULL, x); | 1574 | AUDIT_MAC_IPSEC_DELSA, 1, NULL, x); |
1576 | } | 1575 | } |
1576 | err = 0; | ||
1577 | out: | 1577 | out: |
1578 | spin_unlock_bh(&x->lock); | 1578 | spin_unlock_bh(&x->lock); |
1579 | xfrm_state_put(x); | 1579 | xfrm_state_put(x); |