diff options
71 files changed, 594 insertions, 292 deletions
@@ -18,10 +18,9 @@ MAKEFLAGS += -rR --no-print-directory | |||
18 | 18 | ||
19 | # Avoid funny character set dependencies | 19 | # Avoid funny character set dependencies |
20 | unexport LC_ALL | 20 | unexport LC_ALL |
21 | LC_CTYPE=C | ||
22 | LC_COLLATE=C | 21 | LC_COLLATE=C |
23 | LC_NUMERIC=C | 22 | LC_NUMERIC=C |
24 | export LC_CTYPE LC_COLLATE LC_NUMERIC | 23 | export LC_COLLATE LC_NUMERIC |
25 | 24 | ||
26 | # We are using a recursive build, so we need to do a little thinking | 25 | # We are using a recursive build, so we need to do a little thinking |
27 | # to get the ordering right. | 26 | # to get the ordering right. |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 826a30a00f59..bb2465bcb327 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -20,7 +20,7 @@ | |||
20 | all: $(obj)/zImage | 20 | all: $(obj)/zImage |
21 | 21 | ||
22 | BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ | 22 | BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ |
23 | -fno-strict-aliasing -Os -msoft-float -pipe -D__KERNEL__\ | 23 | -fno-strict-aliasing -Os -msoft-float -pipe \ |
24 | -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ | 24 | -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ |
25 | -isystem $(shell $(CROSS32CC) -print-file-name=include) | 25 | -isystem $(shell $(CROSS32CC) -print-file-name=include) |
26 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc | 26 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc |
@@ -34,8 +34,6 @@ BOOTCFLAGS += -fno-stack-protector | |||
34 | endif | 34 | endif |
35 | 35 | ||
36 | BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) | 36 | BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) |
37 | BOOTCFLAGS += -include include/linux/autoconf.h -Iarch/powerpc/include | ||
38 | BOOTCFLAGS += -Iinclude | ||
39 | 37 | ||
40 | DTS_FLAGS ?= -p 1024 | 38 | DTS_FLAGS ?= -p 1024 |
41 | 39 | ||
diff --git a/arch/sh/tools/Makefile b/arch/sh/tools/Makefile index 558a56bcc7cf..2082af1f3fef 100644 --- a/arch/sh/tools/Makefile +++ b/arch/sh/tools/Makefile | |||
@@ -13,4 +13,4 @@ | |||
13 | include/generated/machtypes.h: $(src)/gen-mach-types $(src)/mach-types | 13 | include/generated/machtypes.h: $(src)/gen-mach-types $(src)/mach-types |
14 | @echo ' Generating $@' | 14 | @echo ' Generating $@' |
15 | $(Q)mkdir -p $(dir $@) | 15 | $(Q)mkdir -p $(dir $@) |
16 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } | 16 | $(Q)LC_ALL=C $(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 077313f0d47f..7d0f00a935fa 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -702,7 +702,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
702 | if (encoder->crtc != crtc) | 702 | if (encoder->crtc != crtc) |
703 | continue; | 703 | continue; |
704 | 704 | ||
705 | DRM_INFO("%s: set mode %s %x\n", drm_get_encoder_name(encoder), | 705 | DRM_DEBUG("%s: set mode %s %x\n", drm_get_encoder_name(encoder), |
706 | mode->name, mode->base.id); | 706 | mode->name, mode->base.id); |
707 | encoder_funcs = encoder->helper_private; | 707 | encoder_funcs = encoder->helper_private; |
708 | encoder_funcs->mode_set(encoder, mode, adjusted_mode); | 708 | encoder_funcs->mode_set(encoder, mode, adjusted_mode); |
@@ -1032,7 +1032,8 @@ bool drm_helper_initial_config(struct drm_device *dev) | |||
1032 | /* | 1032 | /* |
1033 | * we shouldn't end up with no modes here. | 1033 | * we shouldn't end up with no modes here. |
1034 | */ | 1034 | */ |
1035 | printk(KERN_INFO "No connectors reported conncted with modes\n"); | 1035 | if (count == 0) |
1036 | printk(KERN_INFO "No connectors reported connected with modes\n"); | ||
1036 | 1037 | ||
1037 | drm_setup_crtcs(dev); | 1038 | drm_setup_crtcs(dev); |
1038 | 1039 | ||
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index c0651991c3e4..f5ff3490929f 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -2729,7 +2729,7 @@ restart_ih: | |||
2729 | } | 2729 | } |
2730 | break; | 2730 | break; |
2731 | default: | 2731 | default: |
2732 | DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); | 2732 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
2733 | break; | 2733 | break; |
2734 | } | 2734 | } |
2735 | break; | 2735 | break; |
@@ -2749,7 +2749,7 @@ restart_ih: | |||
2749 | } | 2749 | } |
2750 | break; | 2750 | break; |
2751 | default: | 2751 | default: |
2752 | DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); | 2752 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
2753 | break; | 2753 | break; |
2754 | } | 2754 | } |
2755 | break; | 2755 | break; |
@@ -2798,7 +2798,7 @@ restart_ih: | |||
2798 | } | 2798 | } |
2799 | break; | 2799 | break; |
2800 | default: | 2800 | default: |
2801 | DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); | 2801 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
2802 | break; | 2802 | break; |
2803 | } | 2803 | } |
2804 | break; | 2804 | break; |
@@ -2812,7 +2812,7 @@ restart_ih: | |||
2812 | DRM_DEBUG("IH: CP EOP\n"); | 2812 | DRM_DEBUG("IH: CP EOP\n"); |
2813 | break; | 2813 | break; |
2814 | default: | 2814 | default: |
2815 | DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); | 2815 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
2816 | break; | 2816 | break; |
2817 | } | 2817 | } |
2818 | 2818 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 7914455c96ca..579c8920e081 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -687,6 +687,9 @@ radeon_combios_get_tv_info(struct radeon_device *rdev) | |||
687 | uint16_t tv_info; | 687 | uint16_t tv_info; |
688 | enum radeon_tv_std tv_std = TV_STD_NTSC; | 688 | enum radeon_tv_std tv_std = TV_STD_NTSC; |
689 | 689 | ||
690 | if (rdev->bios == NULL) | ||
691 | return tv_std; | ||
692 | |||
690 | tv_info = combios_get_table_offset(dev, COMBIOS_TV_INFO_TABLE); | 693 | tv_info = combios_get_table_offset(dev, COMBIOS_TV_INFO_TABLE); |
691 | if (tv_info) { | 694 | if (tv_info) { |
692 | if (RBIOS8(tv_info + 6) == 'T') { | 695 | if (RBIOS8(tv_info + 6) == 'T') { |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 9da10dd5df80..55266416fa47 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -900,10 +900,18 @@ static void radeon_dvi_force(struct drm_connector *connector) | |||
900 | static int radeon_dvi_mode_valid(struct drm_connector *connector, | 900 | static int radeon_dvi_mode_valid(struct drm_connector *connector, |
901 | struct drm_display_mode *mode) | 901 | struct drm_display_mode *mode) |
902 | { | 902 | { |
903 | struct drm_device *dev = connector->dev; | ||
904 | struct radeon_device *rdev = dev->dev_private; | ||
903 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 905 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
904 | 906 | ||
905 | /* XXX check mode bandwidth */ | 907 | /* XXX check mode bandwidth */ |
906 | 908 | ||
909 | /* clocks over 135 MHz have heat issues with DVI on RV100 */ | ||
910 | if (radeon_connector->use_digital && | ||
911 | (rdev->family == CHIP_RV100) && | ||
912 | (mode->clock > 135000)) | ||
913 | return MODE_CLOCK_HIGH; | ||
914 | |||
907 | if (radeon_connector->use_digital && (mode->clock > 165000)) { | 915 | if (radeon_connector->use_digital && (mode->clock > 165000)) { |
908 | if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || | 916 | if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || |
909 | (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || | 917 | (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || |
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index 981508ff7037..38e45e231ef5 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c | |||
@@ -46,6 +46,7 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
46 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 46 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
47 | uint32_t lvds_gen_cntl, lvds_pll_cntl, pixclks_cntl, disp_pwr_man; | 47 | uint32_t lvds_gen_cntl, lvds_pll_cntl, pixclks_cntl, disp_pwr_man; |
48 | int panel_pwr_delay = 2000; | 48 | int panel_pwr_delay = 2000; |
49 | bool is_mac = false; | ||
49 | DRM_DEBUG("\n"); | 50 | DRM_DEBUG("\n"); |
50 | 51 | ||
51 | if (radeon_encoder->enc_priv) { | 52 | if (radeon_encoder->enc_priv) { |
@@ -58,6 +59,15 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
58 | } | 59 | } |
59 | } | 60 | } |
60 | 61 | ||
62 | /* macs (and possibly some x86 oem systems?) wire up LVDS strangely | ||
63 | * Taken from radeonfb. | ||
64 | */ | ||
65 | if ((rdev->mode_info.connector_table == CT_IBOOK) || | ||
66 | (rdev->mode_info.connector_table == CT_POWERBOOK_EXTERNAL) || | ||
67 | (rdev->mode_info.connector_table == CT_POWERBOOK_INTERNAL) || | ||
68 | (rdev->mode_info.connector_table == CT_POWERBOOK_VGA)) | ||
69 | is_mac = true; | ||
70 | |||
61 | switch (mode) { | 71 | switch (mode) { |
62 | case DRM_MODE_DPMS_ON: | 72 | case DRM_MODE_DPMS_ON: |
63 | disp_pwr_man = RREG32(RADEON_DISP_PWR_MAN); | 73 | disp_pwr_man = RREG32(RADEON_DISP_PWR_MAN); |
@@ -74,6 +84,8 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
74 | 84 | ||
75 | lvds_gen_cntl = RREG32(RADEON_LVDS_GEN_CNTL); | 85 | lvds_gen_cntl = RREG32(RADEON_LVDS_GEN_CNTL); |
76 | lvds_gen_cntl |= (RADEON_LVDS_ON | RADEON_LVDS_EN | RADEON_LVDS_DIGON | RADEON_LVDS_BLON); | 86 | lvds_gen_cntl |= (RADEON_LVDS_ON | RADEON_LVDS_EN | RADEON_LVDS_DIGON | RADEON_LVDS_BLON); |
87 | if (is_mac) | ||
88 | lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; | ||
77 | lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS); | 89 | lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS); |
78 | udelay(panel_pwr_delay * 1000); | 90 | udelay(panel_pwr_delay * 1000); |
79 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | 91 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); |
@@ -85,7 +97,14 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
85 | WREG32_PLL_P(RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); | 97 | WREG32_PLL_P(RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); |
86 | lvds_gen_cntl = RREG32(RADEON_LVDS_GEN_CNTL); | 98 | lvds_gen_cntl = RREG32(RADEON_LVDS_GEN_CNTL); |
87 | lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; | 99 | lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; |
88 | lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN | RADEON_LVDS_DIGON); | 100 | if (is_mac) { |
101 | lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_EN; | ||
102 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | ||
103 | lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_EN); | ||
104 | } else { | ||
105 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | ||
106 | lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN | RADEON_LVDS_DIGON); | ||
107 | } | ||
89 | udelay(panel_pwr_delay * 1000); | 108 | udelay(panel_pwr_delay * 1000); |
90 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | 109 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); |
91 | WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl); | 110 | WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl); |
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 3b0c07b444a2..58b5adf974ca 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c | |||
@@ -215,7 +215,10 @@ static void radeon_evict_flags(struct ttm_buffer_object *bo, | |||
215 | rbo = container_of(bo, struct radeon_bo, tbo); | 215 | rbo = container_of(bo, struct radeon_bo, tbo); |
216 | switch (bo->mem.mem_type) { | 216 | switch (bo->mem.mem_type) { |
217 | case TTM_PL_VRAM: | 217 | case TTM_PL_VRAM: |
218 | radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_GTT); | 218 | if (rbo->rdev->cp.ready == false) |
219 | radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_CPU); | ||
220 | else | ||
221 | radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_GTT); | ||
219 | break; | 222 | break; |
220 | case TTM_PL_TT: | 223 | case TTM_PL_TT: |
221 | default: | 224 | default: |
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 4b96e7a898cf..5b4d66dc1a05 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -431,6 +431,13 @@ static const struct hid_device_id apple_devices[] = { | |||
431 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | 431 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, |
432 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), | 432 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), |
433 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | 433 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
434 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), | ||
435 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | ||
436 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), | ||
437 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | ||
438 | APPLE_ISO_KEYBOARD }, | ||
439 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS), | ||
440 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | ||
434 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), | 441 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), |
435 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | 442 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
436 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), | 443 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 80792d38d25c..eabe5f87c6c1 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1285,6 +1285,9 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1285 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) }, | 1285 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) }, |
1286 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) }, | 1286 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) }, |
1287 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) }, | 1287 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) }, |
1288 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, | ||
1289 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, | ||
1290 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, | ||
1288 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, | 1291 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, |
1289 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, | 1292 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, |
1290 | { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, | 1293 | { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, |
@@ -1553,6 +1556,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1553 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) }, | 1556 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) }, |
1554 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) }, | 1557 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) }, |
1555 | { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, | 1558 | { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, |
1559 | { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) }, | ||
1556 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) }, | 1560 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) }, |
1557 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) }, | 1561 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) }, |
1558 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) }, | 1562 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 3839340e293a..010368e649ed 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -88,6 +88,9 @@ | |||
88 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236 | 88 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236 |
89 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237 | 89 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237 |
90 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 | 90 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 |
91 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 | ||
92 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a | ||
93 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b | ||
91 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a | 94 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a |
92 | #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b | 95 | #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b |
93 | #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241 | 96 | #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241 |
@@ -166,6 +169,9 @@ | |||
166 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f | 169 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f |
167 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 | 170 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 |
168 | 171 | ||
172 | #define USB_VENDOR_ID_ETT 0x0664 | ||
173 | #define USB_DEVICE_ID_TC5UH 0x0309 | ||
174 | |||
169 | #define USB_VENDOR_ID_EZKEY 0x0518 | 175 | #define USB_VENDOR_ID_EZKEY 0x0518 |
170 | #define USB_DEVICE_ID_BTC_8193 0x0002 | 176 | #define USB_DEVICE_ID_BTC_8193 0x0002 |
171 | 177 | ||
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c index 5b222eed0692..510dd1340597 100644 --- a/drivers/hid/hid-samsung.c +++ b/drivers/hid/hid-samsung.c | |||
@@ -39,7 +39,17 @@ | |||
39 | * | 39 | * |
40 | * 3. 135 byte report descriptor | 40 | * 3. 135 byte report descriptor |
41 | * Report #4 has an array field with logical range 0..17 instead of 1..14. | 41 | * Report #4 has an array field with logical range 0..17 instead of 1..14. |
42 | * | ||
43 | * 4. 171 byte report descriptor | ||
44 | * Report #3 has an array field with logical range 0..1 instead of 1..3. | ||
42 | */ | 45 | */ |
46 | static inline void samsung_dev_trace(struct hid_device *hdev, | ||
47 | unsigned int rsize) | ||
48 | { | ||
49 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | ||
50 | "descriptor\n", rsize); | ||
51 | } | ||
52 | |||
43 | static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, | 53 | static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
44 | unsigned int rsize) | 54 | unsigned int rsize) |
45 | { | 55 | { |
@@ -47,8 +57,7 @@ static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
47 | rdesc[177] == 0x75 && rdesc[178] == 0x30 && | 57 | rdesc[177] == 0x75 && rdesc[178] == 0x30 && |
48 | rdesc[179] == 0x95 && rdesc[180] == 0x01 && | 58 | rdesc[179] == 0x95 && rdesc[180] == 0x01 && |
49 | rdesc[182] == 0x40) { | 59 | rdesc[182] == 0x40) { |
50 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | 60 | samsung_dev_trace(hdev, 184); |
51 | "descriptor\n", 184); | ||
52 | rdesc[176] = 0xff; | 61 | rdesc[176] = 0xff; |
53 | rdesc[178] = 0x08; | 62 | rdesc[178] = 0x08; |
54 | rdesc[180] = 0x06; | 63 | rdesc[180] = 0x06; |
@@ -56,17 +65,21 @@ static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
56 | } else | 65 | } else |
57 | if (rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 && | 66 | if (rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 && |
58 | rdesc[194] == 0x25 && rdesc[195] == 0x12) { | 67 | rdesc[194] == 0x25 && rdesc[195] == 0x12) { |
59 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | 68 | samsung_dev_trace(hdev, 203); |
60 | "descriptor\n", 203); | ||
61 | rdesc[193] = 0x1; | 69 | rdesc[193] = 0x1; |
62 | rdesc[195] = 0xf; | 70 | rdesc[195] = 0xf; |
63 | } else | 71 | } else |
64 | if (rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 && | 72 | if (rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 && |
65 | rdesc[126] == 0x25 && rdesc[127] == 0x11) { | 73 | rdesc[126] == 0x25 && rdesc[127] == 0x11) { |
66 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | 74 | samsung_dev_trace(hdev, 135); |
67 | "descriptor\n", 135); | ||
68 | rdesc[125] = 0x1; | 75 | rdesc[125] = 0x1; |
69 | rdesc[127] = 0xe; | 76 | rdesc[127] = 0xe; |
77 | } else | ||
78 | if (rsize == 171 && rdesc[160] == 0x15 && rdesc[161] == 0x0 && | ||
79 | rdesc[162] == 0x25 && rdesc[163] == 0x01) { | ||
80 | samsung_dev_trace(hdev, 171); | ||
81 | rdesc[161] = 0x1; | ||
82 | rdesc[163] = 0x3; | ||
70 | } | 83 | } |
71 | } | 84 | } |
72 | 85 | ||
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index 747542172242..12dcda529201 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c | |||
@@ -142,6 +142,7 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report, | |||
142 | wdata->butstate = rw; | 142 | wdata->butstate = rw; |
143 | input_report_key(input, BTN_0, rw & 0x02); | 143 | input_report_key(input, BTN_0, rw & 0x02); |
144 | input_report_key(input, BTN_1, rw & 0x01); | 144 | input_report_key(input, BTN_1, rw & 0x01); |
145 | input_report_key(input, BTN_TOOL_FINGER, 0xf0); | ||
145 | input_event(input, EV_MSC, MSC_SERIAL, 0xf0); | 146 | input_event(input, EV_MSC, MSC_SERIAL, 0xf0); |
146 | input_sync(input); | 147 | input_sync(input); |
147 | } | 148 | } |
@@ -196,6 +197,9 @@ static int wacom_probe(struct hid_device *hdev, | |||
196 | /* Pad */ | 197 | /* Pad */ |
197 | input->evbit[0] |= BIT(EV_MSC); | 198 | input->evbit[0] |= BIT(EV_MSC); |
198 | input->mscbit[0] |= BIT(MSC_SERIAL); | 199 | input->mscbit[0] |= BIT(MSC_SERIAL); |
200 | set_bit(BTN_0, input->keybit); | ||
201 | set_bit(BTN_1, input->keybit); | ||
202 | set_bit(BTN_TOOL_FINGER, input->keybit); | ||
199 | 203 | ||
200 | /* Distance, rubber and mouse */ | 204 | /* Distance, rubber and mouse */ |
201 | input->absbit[0] |= BIT(ABS_DISTANCE); | 205 | input->absbit[0] |= BIT(ABS_DISTANCE); |
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index cebbd9079d53..d6ee28f6ea08 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -582,7 +582,6 @@ extern s32 e1000_read_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, | |||
582 | extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); | 582 | extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); |
583 | extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, | 583 | extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, |
584 | u16 data); | 584 | u16 data); |
585 | extern s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow); | ||
586 | extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); | 585 | extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); |
587 | extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); | 586 | extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); |
588 | extern s32 e1000_check_polarity_82577(struct e1000_hw *hw); | 587 | extern s32 e1000_check_polarity_82577(struct e1000_hw *hw); |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index ad08cf3f40c0..8b6ecd127889 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -138,6 +138,10 @@ | |||
138 | #define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */ | 138 | #define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */ |
139 | #define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */ | 139 | #define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */ |
140 | 140 | ||
141 | /* KMRN Mode Control */ | ||
142 | #define HV_KMRN_MODE_CTRL PHY_REG(769, 16) | ||
143 | #define HV_KMRN_MDIO_SLOW 0x0400 | ||
144 | |||
141 | /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ | 145 | /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ |
142 | /* Offset 04h HSFSTS */ | 146 | /* Offset 04h HSFSTS */ |
143 | union ich8_hws_flash_status { | 147 | union ich8_hws_flash_status { |
@@ -219,6 +223,7 @@ static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active); | |||
219 | static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw); | 223 | static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw); |
220 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); | 224 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); |
221 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); | 225 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); |
226 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); | ||
222 | 227 | ||
223 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 228 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
224 | { | 229 | { |
@@ -270,7 +275,21 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
270 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; | 275 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; |
271 | 276 | ||
272 | phy->id = e1000_phy_unknown; | 277 | phy->id = e1000_phy_unknown; |
273 | e1000e_get_phy_id(hw); | 278 | ret_val = e1000e_get_phy_id(hw); |
279 | if (ret_val) | ||
280 | goto out; | ||
281 | if ((phy->id == 0) || (phy->id == PHY_REVISION_MASK)) { | ||
282 | /* | ||
283 | * In case the PHY needs to be in mdio slow mode (eg. 82577), | ||
284 | * set slow mode and try to get the PHY id again. | ||
285 | */ | ||
286 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
287 | if (ret_val) | ||
288 | goto out; | ||
289 | ret_val = e1000e_get_phy_id(hw); | ||
290 | if (ret_val) | ||
291 | goto out; | ||
292 | } | ||
274 | phy->type = e1000e_get_phy_type_from_id(phy->id); | 293 | phy->type = e1000e_get_phy_type_from_id(phy->id); |
275 | 294 | ||
276 | switch (phy->type) { | 295 | switch (phy->type) { |
@@ -292,6 +311,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
292 | break; | 311 | break; |
293 | } | 312 | } |
294 | 313 | ||
314 | out: | ||
295 | return ret_val; | 315 | return ret_val; |
296 | } | 316 | } |
297 | 317 | ||
@@ -1076,16 +1096,44 @@ out: | |||
1076 | 1096 | ||
1077 | 1097 | ||
1078 | /** | 1098 | /** |
1099 | * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode | ||
1100 | * @hw: pointer to the HW structure | ||
1101 | **/ | ||
1102 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw) | ||
1103 | { | ||
1104 | s32 ret_val; | ||
1105 | u16 data; | ||
1106 | |||
1107 | ret_val = e1e_rphy(hw, HV_KMRN_MODE_CTRL, &data); | ||
1108 | if (ret_val) | ||
1109 | return ret_val; | ||
1110 | |||
1111 | data |= HV_KMRN_MDIO_SLOW; | ||
1112 | |||
1113 | ret_val = e1e_wphy(hw, HV_KMRN_MODE_CTRL, data); | ||
1114 | |||
1115 | return ret_val; | ||
1116 | } | ||
1117 | |||
1118 | /** | ||
1079 | * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be | 1119 | * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be |
1080 | * done after every PHY reset. | 1120 | * done after every PHY reset. |
1081 | **/ | 1121 | **/ |
1082 | static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) | 1122 | static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) |
1083 | { | 1123 | { |
1084 | s32 ret_val = 0; | 1124 | s32 ret_val = 0; |
1125 | u16 phy_data; | ||
1085 | 1126 | ||
1086 | if (hw->mac.type != e1000_pchlan) | 1127 | if (hw->mac.type != e1000_pchlan) |
1087 | return ret_val; | 1128 | return ret_val; |
1088 | 1129 | ||
1130 | /* Set MDIO slow mode before any other MDIO access */ | ||
1131 | if (hw->phy.type == e1000_phy_82577) { | ||
1132 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
1133 | if (ret_val) | ||
1134 | goto out; | ||
1135 | } | ||
1136 | |||
1089 | if (((hw->phy.type == e1000_phy_82577) && | 1137 | if (((hw->phy.type == e1000_phy_82577) && |
1090 | ((hw->phy.revision == 1) || (hw->phy.revision == 2))) || | 1138 | ((hw->phy.revision == 1) || (hw->phy.revision == 2))) || |
1091 | ((hw->phy.type == e1000_phy_82578) && (hw->phy.revision == 1))) { | 1139 | ((hw->phy.type == e1000_phy_82578) && (hw->phy.revision == 1))) { |
@@ -1118,16 +1166,32 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) | |||
1118 | 1166 | ||
1119 | hw->phy.addr = 1; | 1167 | hw->phy.addr = 1; |
1120 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); | 1168 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); |
1169 | hw->phy.ops.release(hw); | ||
1121 | if (ret_val) | 1170 | if (ret_val) |
1122 | goto out; | 1171 | goto out; |
1123 | hw->phy.ops.release(hw); | ||
1124 | 1172 | ||
1125 | /* | 1173 | /* |
1126 | * Configure the K1 Si workaround during phy reset assuming there is | 1174 | * Configure the K1 Si workaround during phy reset assuming there is |
1127 | * link so that it disables K1 if link is in 1Gbps. | 1175 | * link so that it disables K1 if link is in 1Gbps. |
1128 | */ | 1176 | */ |
1129 | ret_val = e1000_k1_gig_workaround_hv(hw, true); | 1177 | ret_val = e1000_k1_gig_workaround_hv(hw, true); |
1178 | if (ret_val) | ||
1179 | goto out; | ||
1130 | 1180 | ||
1181 | /* Workaround for link disconnects on a busy hub in half duplex */ | ||
1182 | ret_val = hw->phy.ops.acquire(hw); | ||
1183 | if (ret_val) | ||
1184 | goto out; | ||
1185 | ret_val = hw->phy.ops.read_reg_locked(hw, | ||
1186 | PHY_REG(BM_PORT_CTRL_PAGE, 17), | ||
1187 | &phy_data); | ||
1188 | if (ret_val) | ||
1189 | goto release; | ||
1190 | ret_val = hw->phy.ops.write_reg_locked(hw, | ||
1191 | PHY_REG(BM_PORT_CTRL_PAGE, 17), | ||
1192 | phy_data & 0x00FF); | ||
1193 | release: | ||
1194 | hw->phy.ops.release(hw); | ||
1131 | out: | 1195 | out: |
1132 | return ret_val; | 1196 | return ret_val; |
1133 | } | 1197 | } |
@@ -1184,6 +1248,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
1184 | /* Allow time for h/w to get to a quiescent state after reset */ | 1248 | /* Allow time for h/w to get to a quiescent state after reset */ |
1185 | mdelay(10); | 1249 | mdelay(10); |
1186 | 1250 | ||
1251 | /* Perform any necessary post-reset workarounds */ | ||
1187 | if (hw->mac.type == e1000_pchlan) { | 1252 | if (hw->mac.type == e1000_pchlan) { |
1188 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | 1253 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); |
1189 | if (ret_val) | 1254 | if (ret_val) |
@@ -2484,6 +2549,10 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2484 | if (!ret_val) | 2549 | if (!ret_val) |
2485 | e1000_release_swflag_ich8lan(hw); | 2550 | e1000_release_swflag_ich8lan(hw); |
2486 | 2551 | ||
2552 | /* Perform any necessary post-reset workarounds */ | ||
2553 | if (hw->mac.type == e1000_pchlan) | ||
2554 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | ||
2555 | |||
2487 | if (ctrl & E1000_CTRL_PHY_RST) | 2556 | if (ctrl & E1000_CTRL_PHY_RST) |
2488 | ret_val = hw->phy.ops.get_cfg_done(hw); | 2557 | ret_val = hw->phy.ops.get_cfg_done(hw); |
2489 | 2558 | ||
@@ -2528,9 +2597,6 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2528 | kab |= E1000_KABGTXD_BGSQLBIAS; | 2597 | kab |= E1000_KABGTXD_BGSQLBIAS; |
2529 | ew32(KABGTXD, kab); | 2598 | ew32(KABGTXD, kab); |
2530 | 2599 | ||
2531 | if (hw->mac.type == e1000_pchlan) | ||
2532 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | ||
2533 | |||
2534 | out: | 2600 | out: |
2535 | return ret_val; | 2601 | return ret_val; |
2536 | } | 2602 | } |
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index 55a2c0acfee7..7f3ceb9dad6a 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -152,32 +152,9 @@ s32 e1000e_get_phy_id(struct e1000_hw *hw) | |||
152 | if (phy->id != 0 && phy->id != PHY_REVISION_MASK) | 152 | if (phy->id != 0 && phy->id != PHY_REVISION_MASK) |
153 | goto out; | 153 | goto out; |
154 | 154 | ||
155 | /* | ||
156 | * If the PHY ID is still unknown, we may have an 82577 | ||
157 | * without link. We will try again after setting Slow MDIC | ||
158 | * mode. No harm in trying again in this case since the PHY | ||
159 | * ID is unknown at this point anyway. | ||
160 | */ | ||
161 | ret_val = phy->ops.acquire(hw); | ||
162 | if (ret_val) | ||
163 | goto out; | ||
164 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
165 | if (ret_val) | ||
166 | goto out; | ||
167 | phy->ops.release(hw); | ||
168 | |||
169 | retry_count++; | 155 | retry_count++; |
170 | } | 156 | } |
171 | out: | 157 | out: |
172 | /* Revert to MDIO fast mode, if applicable */ | ||
173 | if (retry_count) { | ||
174 | ret_val = phy->ops.acquire(hw); | ||
175 | if (ret_val) | ||
176 | return ret_val; | ||
177 | ret_val = e1000_set_mdio_slow_mode_hv(hw, false); | ||
178 | phy->ops.release(hw); | ||
179 | } | ||
180 | |||
181 | return ret_val; | 158 | return ret_val; |
182 | } | 159 | } |
183 | 160 | ||
@@ -2791,38 +2768,6 @@ static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active) | |||
2791 | } | 2768 | } |
2792 | 2769 | ||
2793 | /** | 2770 | /** |
2794 | * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode | ||
2795 | * @hw: pointer to the HW structure | ||
2796 | * @slow: true for slow mode, false for normal mode | ||
2797 | * | ||
2798 | * Assumes semaphore already acquired. | ||
2799 | **/ | ||
2800 | s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow) | ||
2801 | { | ||
2802 | s32 ret_val = 0; | ||
2803 | u16 data = 0; | ||
2804 | |||
2805 | /* Set MDIO mode - page 769, register 16: 0x2580==slow, 0x2180==fast */ | ||
2806 | hw->phy.addr = 1; | ||
2807 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, | ||
2808 | (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT)); | ||
2809 | if (ret_val) | ||
2810 | goto out; | ||
2811 | |||
2812 | ret_val = e1000e_write_phy_reg_mdic(hw, BM_CS_CTRL1, | ||
2813 | (0x2180 | (slow << 10))); | ||
2814 | if (ret_val) | ||
2815 | goto out; | ||
2816 | |||
2817 | /* dummy read when reverting to fast mode - throw away result */ | ||
2818 | if (!slow) | ||
2819 | ret_val = e1000e_read_phy_reg_mdic(hw, BM_CS_CTRL1, &data); | ||
2820 | |||
2821 | out: | ||
2822 | return ret_val; | ||
2823 | } | ||
2824 | |||
2825 | /** | ||
2826 | * __e1000_read_phy_reg_hv - Read HV PHY register | 2771 | * __e1000_read_phy_reg_hv - Read HV PHY register |
2827 | * @hw: pointer to the HW structure | 2772 | * @hw: pointer to the HW structure |
2828 | * @offset: register offset to be read | 2773 | * @offset: register offset to be read |
@@ -2839,7 +2784,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2839 | s32 ret_val; | 2784 | s32 ret_val; |
2840 | u16 page = BM_PHY_REG_PAGE(offset); | 2785 | u16 page = BM_PHY_REG_PAGE(offset); |
2841 | u16 reg = BM_PHY_REG_NUM(offset); | 2786 | u16 reg = BM_PHY_REG_NUM(offset); |
2842 | bool in_slow_mode = false; | ||
2843 | 2787 | ||
2844 | if (!locked) { | 2788 | if (!locked) { |
2845 | ret_val = hw->phy.ops.acquire(hw); | 2789 | ret_val = hw->phy.ops.acquire(hw); |
@@ -2847,16 +2791,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2847 | return ret_val; | 2791 | return ret_val; |
2848 | } | 2792 | } |
2849 | 2793 | ||
2850 | /* Workaround failure in MDIO access while cable is disconnected */ | ||
2851 | if ((hw->phy.type == e1000_phy_82577) && | ||
2852 | !(er32(STATUS) & E1000_STATUS_LU)) { | ||
2853 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
2854 | if (ret_val) | ||
2855 | goto out; | ||
2856 | |||
2857 | in_slow_mode = true; | ||
2858 | } | ||
2859 | |||
2860 | /* Page 800 works differently than the rest so it has its own func */ | 2794 | /* Page 800 works differently than the rest so it has its own func */ |
2861 | if (page == BM_WUC_PAGE) { | 2795 | if (page == BM_WUC_PAGE) { |
2862 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, | 2796 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, |
@@ -2893,10 +2827,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2893 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, | 2827 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, |
2894 | data); | 2828 | data); |
2895 | out: | 2829 | out: |
2896 | /* Revert to MDIO fast mode, if applicable */ | ||
2897 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | ||
2898 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); | ||
2899 | |||
2900 | if (!locked) | 2830 | if (!locked) |
2901 | hw->phy.ops.release(hw); | 2831 | hw->phy.ops.release(hw); |
2902 | 2832 | ||
@@ -2948,7 +2878,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
2948 | s32 ret_val; | 2878 | s32 ret_val; |
2949 | u16 page = BM_PHY_REG_PAGE(offset); | 2879 | u16 page = BM_PHY_REG_PAGE(offset); |
2950 | u16 reg = BM_PHY_REG_NUM(offset); | 2880 | u16 reg = BM_PHY_REG_NUM(offset); |
2951 | bool in_slow_mode = false; | ||
2952 | 2881 | ||
2953 | if (!locked) { | 2882 | if (!locked) { |
2954 | ret_val = hw->phy.ops.acquire(hw); | 2883 | ret_val = hw->phy.ops.acquire(hw); |
@@ -2956,16 +2885,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
2956 | return ret_val; | 2885 | return ret_val; |
2957 | } | 2886 | } |
2958 | 2887 | ||
2959 | /* Workaround failure in MDIO access while cable is disconnected */ | ||
2960 | if ((hw->phy.type == e1000_phy_82577) && | ||
2961 | !(er32(STATUS) & E1000_STATUS_LU)) { | ||
2962 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
2963 | if (ret_val) | ||
2964 | goto out; | ||
2965 | |||
2966 | in_slow_mode = true; | ||
2967 | } | ||
2968 | |||
2969 | /* Page 800 works differently than the rest so it has its own func */ | 2888 | /* Page 800 works differently than the rest so it has its own func */ |
2970 | if (page == BM_WUC_PAGE) { | 2889 | if (page == BM_WUC_PAGE) { |
2971 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, | 2890 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, |
@@ -3019,10 +2938,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
3019 | data); | 2938 | data); |
3020 | 2939 | ||
3021 | out: | 2940 | out: |
3022 | /* Revert to MDIO fast mode, if applicable */ | ||
3023 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | ||
3024 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); | ||
3025 | |||
3026 | if (!locked) | 2941 | if (!locked) |
3027 | hw->phy.ops.release(hw); | 2942 | hw->phy.ops.release(hw); |
3028 | 2943 | ||
diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile index 21b41f42b61c..bfef0ebcba9a 100644 --- a/drivers/net/ixgbe/Makefile +++ b/drivers/net/ixgbe/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | ################################################################################ | 1 | ################################################################################ |
2 | # | 2 | # |
3 | # Intel 10 Gigabit PCI Express Linux driver | 3 | # Intel 10 Gigabit PCI Express Linux driver |
4 | # Copyright(c) 1999 - 2009 Intel Corporation. | 4 | # Copyright(c) 1999 - 2010 Intel Corporation. |
5 | # | 5 | # |
6 | # This program is free software; you can redistribute it and/or modify it | 6 | # This program is free software; you can redistribute it and/or modify it |
7 | # under the terms and conditions of the GNU General Public License, | 7 | # under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 8da8eb535084..303e7bd39b67 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index 204177d78cec..3103f4165311 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 538340527aa6..b49bd6b9feb7 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 688b8ca5da32..21f158f79dd0 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_common.h b/drivers/net/ixgbe/ixgbe_common.h index 27f3214bed2e..dfff0ffaa502 100644 --- a/drivers/net/ixgbe/ixgbe_common.h +++ b/drivers/net/ixgbe/ixgbe_common.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb.c b/drivers/net/ixgbe/ixgbe_dcb.c index a1562287342f..9aea4f04bbd2 100644 --- a/drivers/net/ixgbe/ixgbe_dcb.c +++ b/drivers/net/ixgbe/ixgbe_dcb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb.h b/drivers/net/ixgbe/ixgbe_dcb.h index 64a9fa15c059..5caafd4afbc3 100644 --- a/drivers/net/ixgbe/ixgbe_dcb.h +++ b/drivers/net/ixgbe/ixgbe_dcb.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ixgbe/ixgbe_dcb_82598.c index f30263898ebc..f0e9279d4669 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82598.c +++ b/drivers/net/ixgbe/ixgbe_dcb_82598.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.h b/drivers/net/ixgbe/ixgbe_dcb_82598.h index ebbe53c352a7..cc728fa092e2 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82598.h +++ b/drivers/net/ixgbe/ixgbe_dcb_82598.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ixgbe/ixgbe_dcb_82599.c index ec8a252636d3..4f7a26ab411e 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82599.c +++ b/drivers/net/ixgbe/ixgbe_dcb_82599.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.h b/drivers/net/ixgbe/ixgbe_dcb_82599.h index 9e5e2827e4af..0f3f791e1e1d 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82599.h +++ b/drivers/net/ixgbe/ixgbe_dcb_82599.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index 3c7a79a7d7c6..56f37f66b696 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 0bd49d3b9f65..d77961fc75f9 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c index da32a108a7b4..e9a20c88c155 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ixgbe/ixgbe_fcoe.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.h b/drivers/net/ixgbe/ixgbe_fcoe.h index de8ff53187da..abf4b2b3f252 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.h +++ b/drivers/net/ixgbe/ixgbe_fcoe.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 2ad754c864cf..9c9202f40b10 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -52,7 +52,7 @@ static const char ixgbe_driver_string[] = | |||
52 | 52 | ||
53 | #define DRV_VERSION "2.0.44-k2" | 53 | #define DRV_VERSION "2.0.44-k2" |
54 | const char ixgbe_driver_version[] = DRV_VERSION; | 54 | const char ixgbe_driver_version[] = DRV_VERSION; |
55 | static char ixgbe_copyright[] = "Copyright (c) 1999-2009 Intel Corporation."; | 55 | static char ixgbe_copyright[] = "Copyright (c) 1999-2010 Intel Corporation."; |
56 | 56 | ||
57 | static const struct ixgbe_info *ixgbe_info_tbl[] = { | 57 | static const struct ixgbe_info *ixgbe_info_tbl[] = { |
58 | [board_82598] = &ixgbe_82598_info, | 58 | [board_82598] = &ixgbe_82598_info, |
@@ -5576,6 +5576,10 @@ static void ixgbe_netpoll(struct net_device *netdev) | |||
5576 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 5576 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
5577 | int i; | 5577 | int i; |
5578 | 5578 | ||
5579 | /* if interface is down do nothing */ | ||
5580 | if (test_bit(__IXGBE_DOWN, &adapter->state)) | ||
5581 | return; | ||
5582 | |||
5579 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; | 5583 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; |
5580 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | 5584 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { |
5581 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | 5585 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; |
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 9ecad17522c3..1c1efd386956 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_phy.h b/drivers/net/ixgbe/ixgbe_phy.h index 9b700f5bf1ed..9cf5f3b4cc5d 100644 --- a/drivers/net/ixgbe/ixgbe_phy.h +++ b/drivers/net/ixgbe/ixgbe_phy.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 84650c6ebe03..9eafddfa1b97 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c index 683353b904c7..0d4eba7266ec 100644 --- a/drivers/net/sfc/mcdi.c +++ b/drivers/net/sfc/mcdi.c | |||
@@ -142,8 +142,9 @@ static int efx_mcdi_poll(struct efx_nic *efx) | |||
142 | if (spins != 0) { | 142 | if (spins != 0) { |
143 | --spins; | 143 | --spins; |
144 | udelay(1); | 144 | udelay(1); |
145 | } else | 145 | } else { |
146 | schedule(); | 146 | schedule_timeout_uninterruptible(1); |
147 | } | ||
147 | 148 | ||
148 | time = get_seconds(); | 149 | time = get_seconds(); |
149 | 150 | ||
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index af3933579790..250c8827b842 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -79,10 +79,14 @@ struct efx_loopback_state { | |||
79 | static int efx_test_mdio(struct efx_nic *efx, struct efx_self_tests *tests) | 79 | static int efx_test_mdio(struct efx_nic *efx, struct efx_self_tests *tests) |
80 | { | 80 | { |
81 | int rc = 0; | 81 | int rc = 0; |
82 | int devad = __ffs(efx->mdio.mmds); | 82 | int devad; |
83 | u16 physid1, physid2; | 83 | u16 physid1, physid2; |
84 | 84 | ||
85 | if (efx->phy_type == PHY_TYPE_NONE) | 85 | if (efx->mdio.mode_support & MDIO_SUPPORTS_C45) |
86 | devad = __ffs(efx->mdio.mmds); | ||
87 | else if (efx->mdio.mode_support & MDIO_SUPPORTS_C22) | ||
88 | devad = MDIO_DEVAD_NONE; | ||
89 | else | ||
86 | return 0; | 90 | return 0; |
87 | 91 | ||
88 | mutex_lock(&efx->mac_lock); | 92 | mutex_lock(&efx->mac_lock); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 3a74d2168598..7f82b0238e08 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) |
5 | * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) | 5 | * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) |
6 | * Copyright (C) 2004 Sun Microsystems Inc. | 6 | * Copyright (C) 2004 Sun Microsystems Inc. |
7 | * Copyright (C) 2005-2009 Broadcom Corporation. | 7 | * Copyright (C) 2005-2010 Broadcom Corporation. |
8 | * | 8 | * |
9 | * Firmware is: | 9 | * Firmware is: |
10 | * Derived from proprietary unpublished source code, | 10 | * Derived from proprietary unpublished source code, |
@@ -68,8 +68,8 @@ | |||
68 | 68 | ||
69 | #define DRV_MODULE_NAME "tg3" | 69 | #define DRV_MODULE_NAME "tg3" |
70 | #define PFX DRV_MODULE_NAME ": " | 70 | #define PFX DRV_MODULE_NAME ": " |
71 | #define DRV_MODULE_VERSION "3.105" | 71 | #define DRV_MODULE_VERSION "3.106" |
72 | #define DRV_MODULE_RELDATE "December 2, 2009" | 72 | #define DRV_MODULE_RELDATE "January 12, 2010" |
73 | 73 | ||
74 | #define TG3_DEF_MAC_MODE 0 | 74 | #define TG3_DEF_MAC_MODE 0 |
75 | #define TG3_DEF_RX_MODE 0 | 75 | #define TG3_DEF_RX_MODE 0 |
@@ -1037,7 +1037,11 @@ static void tg3_mdio_start(struct tg3 *tp) | |||
1037 | else | 1037 | else |
1038 | tp->phy_addr = 1; | 1038 | tp->phy_addr = 1; |
1039 | 1039 | ||
1040 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; | 1040 | if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) |
1041 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; | ||
1042 | else | ||
1043 | is_serdes = tr32(TG3_CPMU_PHY_STRAP) & | ||
1044 | TG3_CPMU_PHY_STRAP_IS_SERDES; | ||
1041 | if (is_serdes) | 1045 | if (is_serdes) |
1042 | tp->phy_addr += 7; | 1046 | tp->phy_addr += 7; |
1043 | } else | 1047 | } else |
@@ -4693,8 +4697,9 @@ next_pkt: | |||
4693 | (*post_ptr)++; | 4697 | (*post_ptr)++; |
4694 | 4698 | ||
4695 | if (unlikely(rx_std_posted >= tp->rx_std_max_post)) { | 4699 | if (unlikely(rx_std_posted >= tp->rx_std_max_post)) { |
4696 | u32 idx = *post_ptr % TG3_RX_RING_SIZE; | 4700 | tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE; |
4697 | tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, idx); | 4701 | tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, |
4702 | tpr->rx_std_prod_idx); | ||
4698 | work_mask &= ~RXD_OPAQUE_RING_STD; | 4703 | work_mask &= ~RXD_OPAQUE_RING_STD; |
4699 | rx_std_posted = 0; | 4704 | rx_std_posted = 0; |
4700 | } | 4705 | } |
@@ -7742,7 +7747,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7742 | ((u64) tpr->rx_std_mapping >> 32)); | 7747 | ((u64) tpr->rx_std_mapping >> 32)); |
7743 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, | 7748 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, |
7744 | ((u64) tpr->rx_std_mapping & 0xffffffff)); | 7749 | ((u64) tpr->rx_std_mapping & 0xffffffff)); |
7745 | if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) | 7750 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) |
7746 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, | 7751 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, |
7747 | NIC_SRAM_RX_BUFFER_DESC); | 7752 | NIC_SRAM_RX_BUFFER_DESC); |
7748 | 7753 | ||
@@ -12122,7 +12127,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) | |||
12122 | 12127 | ||
12123 | tp->phy_id = eeprom_phy_id; | 12128 | tp->phy_id = eeprom_phy_id; |
12124 | if (eeprom_phy_serdes) { | 12129 | if (eeprom_phy_serdes) { |
12125 | if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) | 12130 | if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) || |
12131 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
12126 | tp->tg3_flags2 |= TG3_FLG2_MII_SERDES; | 12132 | tp->tg3_flags2 |= TG3_FLG2_MII_SERDES; |
12127 | else | 12133 | else |
12128 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; | 12134 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; |
@@ -13384,6 +13390,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13384 | if (err) | 13390 | if (err) |
13385 | return err; | 13391 | return err; |
13386 | 13392 | ||
13393 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | ||
13394 | (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 || | ||
13395 | (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))) | ||
13396 | return -ENOTSUPP; | ||
13397 | |||
13387 | /* Initialize data/descriptor byte/word swapping. */ | 13398 | /* Initialize data/descriptor byte/word swapping. */ |
13388 | val = tr32(GRC_MODE); | 13399 | val = tr32(GRC_MODE); |
13389 | val &= GRC_MODE_HOST_STACKUP; | 13400 | val &= GRC_MODE_HOST_STACKUP; |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index cd30889650f8..8a167912902b 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) |
5 | * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com) | 5 | * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com) |
6 | * Copyright (C) 2004 Sun Microsystems Inc. | 6 | * Copyright (C) 2004 Sun Microsystems Inc. |
7 | * Copyright (C) 2007-2010 Broadcom Corporation. | ||
7 | */ | 8 | */ |
8 | 9 | ||
9 | #ifndef _T3_H | 10 | #ifndef _T3_H |
@@ -1054,6 +1055,8 @@ | |||
1054 | #define CPMU_MUTEX_REQ_DRIVER 0x00001000 | 1055 | #define CPMU_MUTEX_REQ_DRIVER 0x00001000 |
1055 | #define TG3_CPMU_MUTEX_GNT 0x00003660 | 1056 | #define TG3_CPMU_MUTEX_GNT 0x00003660 |
1056 | #define CPMU_MUTEX_GNT_DRIVER 0x00001000 | 1057 | #define CPMU_MUTEX_GNT_DRIVER 0x00001000 |
1058 | #define TG3_CPMU_PHY_STRAP 0x00003664 | ||
1059 | #define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 | ||
1057 | /* 0x3664 --> 0x3800 unused */ | 1060 | /* 0x3664 --> 0x3800 unused */ |
1058 | 1061 | ||
1059 | /* Mbuf cluster free registers */ | 1062 | /* Mbuf cluster free registers */ |
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 5d1c8677f180..6a3f4da7fb48 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c | |||
@@ -97,7 +97,7 @@ ath5k_eeprom_init_header(struct ath5k_hw *ah) | |||
97 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | 97 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; |
98 | int ret; | 98 | int ret; |
99 | u16 val; | 99 | u16 val; |
100 | u32 cksum, offset; | 100 | u32 cksum, offset, eep_max = AR5K_EEPROM_INFO_MAX; |
101 | 101 | ||
102 | /* | 102 | /* |
103 | * Read values from EEPROM and store them in the capability structure | 103 | * Read values from EEPROM and store them in the capability structure |
@@ -116,12 +116,38 @@ ath5k_eeprom_init_header(struct ath5k_hw *ah) | |||
116 | * Validate the checksum of the EEPROM date. There are some | 116 | * Validate the checksum of the EEPROM date. There are some |
117 | * devices with invalid EEPROMs. | 117 | * devices with invalid EEPROMs. |
118 | */ | 118 | */ |
119 | for (cksum = 0, offset = 0; offset < AR5K_EEPROM_INFO_MAX; offset++) { | 119 | AR5K_EEPROM_READ(AR5K_EEPROM_SIZE_UPPER, val); |
120 | if (val) { | ||
121 | eep_max = (val & AR5K_EEPROM_SIZE_UPPER_MASK) << | ||
122 | AR5K_EEPROM_SIZE_ENDLOC_SHIFT; | ||
123 | AR5K_EEPROM_READ(AR5K_EEPROM_SIZE_LOWER, val); | ||
124 | eep_max = (eep_max | val) - AR5K_EEPROM_INFO_BASE; | ||
125 | |||
126 | /* | ||
127 | * Fail safe check to prevent stupid loops due | ||
128 | * to busted EEPROMs. XXX: This value is likely too | ||
129 | * big still, waiting on a better value. | ||
130 | */ | ||
131 | if (eep_max > (3 * AR5K_EEPROM_INFO_MAX)) { | ||
132 | ATH5K_ERR(ah->ah_sc, "Invalid max custom EEPROM size: " | ||
133 | "%d (0x%04x) max expected: %d (0x%04x)\n", | ||
134 | eep_max, eep_max, | ||
135 | 3 * AR5K_EEPROM_INFO_MAX, | ||
136 | 3 * AR5K_EEPROM_INFO_MAX); | ||
137 | return -EIO; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | for (cksum = 0, offset = 0; offset < eep_max; offset++) { | ||
120 | AR5K_EEPROM_READ(AR5K_EEPROM_INFO(offset), val); | 142 | AR5K_EEPROM_READ(AR5K_EEPROM_INFO(offset), val); |
121 | cksum ^= val; | 143 | cksum ^= val; |
122 | } | 144 | } |
123 | if (cksum != AR5K_EEPROM_INFO_CKSUM) { | 145 | if (cksum != AR5K_EEPROM_INFO_CKSUM) { |
124 | ATH5K_ERR(ah->ah_sc, "Invalid EEPROM checksum 0x%04x\n", cksum); | 146 | ATH5K_ERR(ah->ah_sc, "Invalid EEPROM " |
147 | "checksum: 0x%04x eep_max: 0x%04x (%s)\n", | ||
148 | cksum, eep_max, | ||
149 | eep_max == AR5K_EEPROM_INFO_MAX ? | ||
150 | "default size" : "custom size"); | ||
125 | return -EIO; | 151 | return -EIO; |
126 | } | 152 | } |
127 | 153 | ||
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h index 0123f3521a0b..473a483bb9c3 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.h +++ b/drivers/net/wireless/ath/ath5k/eeprom.h | |||
@@ -37,6 +37,14 @@ | |||
37 | #define AR5K_EEPROM_RFKILL_POLARITY_S 1 | 37 | #define AR5K_EEPROM_RFKILL_POLARITY_S 1 |
38 | 38 | ||
39 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ | 39 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ |
40 | |||
41 | /* FLASH(EEPROM) Defines for AR531X chips */ | ||
42 | #define AR5K_EEPROM_SIZE_LOWER 0x1b /* size info -- lower */ | ||
43 | #define AR5K_EEPROM_SIZE_UPPER 0x1c /* size info -- upper */ | ||
44 | #define AR5K_EEPROM_SIZE_UPPER_MASK 0xfff0 | ||
45 | #define AR5K_EEPROM_SIZE_UPPER_SHIFT 4 | ||
46 | #define AR5K_EEPROM_SIZE_ENDLOC_SHIFT 12 | ||
47 | |||
40 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ | 48 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ |
41 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ | 49 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ |
42 | #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE) | 50 | #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE) |
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig index 03a1106ad725..5774cea23a3b 100644 --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig | |||
@@ -25,7 +25,7 @@ config ATH9K | |||
25 | 25 | ||
26 | config ATH9K_DEBUGFS | 26 | config ATH9K_DEBUGFS |
27 | bool "Atheros ath9k debugging" | 27 | bool "Atheros ath9k debugging" |
28 | depends on ATH9K | 28 | depends on ATH9K && DEBUG_FS |
29 | ---help--- | 29 | ---help--- |
30 | Say Y, if you need access to ath9k's statistics for | 30 | Say Y, if you need access to ath9k's statistics for |
31 | interrupts, rate control, etc. | 31 | interrupts, rate control, etc. |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index e2cef2ff5d8f..1597a42731ed 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -33,11 +33,11 @@ struct ath_node; | |||
33 | 33 | ||
34 | /* Macro to expand scalars to 64-bit objects */ | 34 | /* Macro to expand scalars to 64-bit objects */ |
35 | 35 | ||
36 | #define ito64(x) (sizeof(x) == 8) ? \ | 36 | #define ito64(x) (sizeof(x) == 1) ? \ |
37 | (((unsigned long long int)(x)) & (0xff)) : \ | 37 | (((unsigned long long int)(x)) & (0xff)) : \ |
38 | (sizeof(x) == 16) ? \ | 38 | (sizeof(x) == 2) ? \ |
39 | (((unsigned long long int)(x)) & 0xffff) : \ | 39 | (((unsigned long long int)(x)) & 0xffff) : \ |
40 | ((sizeof(x) == 32) ? \ | 40 | ((sizeof(x) == 4) ? \ |
41 | (((unsigned long long int)(x)) & 0xffffffff) : \ | 41 | (((unsigned long long int)(x)) & 0xffffffff) : \ |
42 | (unsigned long long int)(x)) | 42 | (unsigned long long int)(x)) |
43 | 43 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 484c5fdf7c2a..9b4b8b5c7574 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -1961,7 +1961,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
1961 | struct ieee80211_tx_info *info; | 1961 | struct ieee80211_tx_info *info; |
1962 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; | 1962 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; |
1963 | u32 status = le32_to_cpu(tx_resp->u.status); | 1963 | u32 status = le32_to_cpu(tx_resp->u.status); |
1964 | int tid = MAX_TID_COUNT; | 1964 | int uninitialized_var(tid); |
1965 | int sta_id; | 1965 | int sta_id; |
1966 | int freed; | 1966 | int freed; |
1967 | u8 *qc = NULL; | 1967 | u8 *qc = NULL; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 574d36658702..5461f105bd2d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2344,6 +2344,21 @@ static void iwl_ht_conf(struct iwl_priv *priv, | |||
2344 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2344 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
2345 | } | 2345 | } |
2346 | 2346 | ||
2347 | static inline void iwl_set_no_assoc(struct iwl_priv *priv) | ||
2348 | { | ||
2349 | priv->assoc_id = 0; | ||
2350 | iwl_led_disassociate(priv); | ||
2351 | /* | ||
2352 | * inform the ucode that there is no longer an | ||
2353 | * association and that no more packets should be | ||
2354 | * sent | ||
2355 | */ | ||
2356 | priv->staging_rxon.filter_flags &= | ||
2357 | ~RXON_FILTER_ASSOC_MSK; | ||
2358 | priv->staging_rxon.assoc_id = 0; | ||
2359 | iwlcore_commit_rxon(priv); | ||
2360 | } | ||
2361 | |||
2347 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) | 2362 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) |
2348 | void iwl_bss_info_changed(struct ieee80211_hw *hw, | 2363 | void iwl_bss_info_changed(struct ieee80211_hw *hw, |
2349 | struct ieee80211_vif *vif, | 2364 | struct ieee80211_vif *vif, |
@@ -2475,20 +2490,8 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw, | |||
2475 | IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; | 2490 | IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; |
2476 | if (!iwl_is_rfkill(priv)) | 2491 | if (!iwl_is_rfkill(priv)) |
2477 | priv->cfg->ops->lib->post_associate(priv); | 2492 | priv->cfg->ops->lib->post_associate(priv); |
2478 | } else { | 2493 | } else |
2479 | priv->assoc_id = 0; | 2494 | iwl_set_no_assoc(priv); |
2480 | iwl_led_disassociate(priv); | ||
2481 | |||
2482 | /* | ||
2483 | * inform the ucode that there is no longer an | ||
2484 | * association and that no more packets should be | ||
2485 | * send | ||
2486 | */ | ||
2487 | priv->staging_rxon.filter_flags &= | ||
2488 | ~RXON_FILTER_ASSOC_MSK; | ||
2489 | priv->staging_rxon.assoc_id = 0; | ||
2490 | iwlcore_commit_rxon(priv); | ||
2491 | } | ||
2492 | } | 2495 | } |
2493 | 2496 | ||
2494 | if (changes && iwl_is_associated(priv) && priv->assoc_id) { | 2497 | if (changes && iwl_is_associated(priv) && priv->assoc_id) { |
@@ -2503,12 +2506,14 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw, | |||
2503 | } | 2506 | } |
2504 | } | 2507 | } |
2505 | 2508 | ||
2506 | if ((changes & BSS_CHANGED_BEACON_ENABLED) && | 2509 | if (changes & BSS_CHANGED_BEACON_ENABLED) { |
2507 | vif->bss_conf.enable_beacon) { | 2510 | if (vif->bss_conf.enable_beacon) { |
2508 | memcpy(priv->staging_rxon.bssid_addr, | 2511 | memcpy(priv->staging_rxon.bssid_addr, |
2509 | bss_conf->bssid, ETH_ALEN); | 2512 | bss_conf->bssid, ETH_ALEN); |
2510 | memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN); | 2513 | memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN); |
2511 | iwlcore_config_ap(priv); | 2514 | iwlcore_config_ap(priv); |
2515 | } else | ||
2516 | iwl_set_no_assoc(priv); | ||
2512 | } | 2517 | } |
2513 | 2518 | ||
2514 | mutex_unlock(&priv->mutex); | 2519 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 165d1f6e2dd9..3822cf53e368 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -711,7 +711,7 @@ extern void iwl_txq_ctx_stop(struct iwl_priv *priv); | |||
711 | extern int iwl_queue_space(const struct iwl_queue *q); | 711 | extern int iwl_queue_space(const struct iwl_queue *q); |
712 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) | 712 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) |
713 | { | 713 | { |
714 | return q->write_ptr > q->read_ptr ? | 714 | return q->write_ptr >= q->read_ptr ? |
715 | (i >= q->read_ptr && i < q->write_ptr) : | 715 | (i >= q->read_ptr && i < q->write_ptr) : |
716 | !(i < q->read_ptr && i >= q->write_ptr); | 716 | !(i < q->read_ptr && i >= q->write_ptr); |
717 | } | 717 | } |
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 59d49159cf2a..59f92105b0c2 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -3157,8 +3157,10 @@ static void mwl8k_configure_filter(struct ieee80211_hw *hw, | |||
3157 | /* Clear unsupported feature flags */ | 3157 | /* Clear unsupported feature flags */ |
3158 | *total_flags &= FIF_ALLMULTI | FIF_BCN_PRBRESP_PROMISC; | 3158 | *total_flags &= FIF_ALLMULTI | FIF_BCN_PRBRESP_PROMISC; |
3159 | 3159 | ||
3160 | if (mwl8k_fw_lock(hw)) | 3160 | if (mwl8k_fw_lock(hw)) { |
3161 | kfree(cmd); | ||
3161 | return; | 3162 | return; |
3163 | } | ||
3162 | 3164 | ||
3163 | if (priv->sniffer_enabled) { | 3165 | if (priv->sniffer_enabled) { |
3164 | mwl8k_enable_sniffer(hw, 0); | 3166 | mwl8k_enable_sniffer(hw, 0); |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 27bf887f1453..9deae41cb784 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -340,7 +340,7 @@ static int rt2800_blink_set(struct led_classdev *led_cdev, | |||
340 | rt2x00_set_field32(®, LED_CFG_OFF_PERIOD, *delay_off); | 340 | rt2x00_set_field32(®, LED_CFG_OFF_PERIOD, *delay_off); |
341 | rt2x00_set_field32(®, LED_CFG_SLOW_BLINK_PERIOD, 3); | 341 | rt2x00_set_field32(®, LED_CFG_SLOW_BLINK_PERIOD, 3); |
342 | rt2x00_set_field32(®, LED_CFG_R_LED_MODE, 3); | 342 | rt2x00_set_field32(®, LED_CFG_R_LED_MODE, 3); |
343 | rt2x00_set_field32(®, LED_CFG_G_LED_MODE, 12); | 343 | rt2x00_set_field32(®, LED_CFG_G_LED_MODE, 3); |
344 | rt2x00_set_field32(®, LED_CFG_Y_LED_MODE, 3); | 344 | rt2x00_set_field32(®, LED_CFG_Y_LED_MODE, 3); |
345 | rt2x00_set_field32(®, LED_CFG_LED_POLAR, 1); | 345 | rt2x00_set_field32(®, LED_CFG_LED_POLAR, 1); |
346 | rt2800_register_write(led->rt2x00dev, LED_CFG, reg); | 346 | rt2800_register_write(led->rt2x00dev, LED_CFG, reg); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 4d841c07c970..dcfc8c25d1a7 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -113,6 +113,12 @@ | |||
113 | ( ((unsigned long)((__skb)->data + (__header))) & 3 ) | 113 | ( ((unsigned long)((__skb)->data + (__header))) & 3 ) |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Constants for extra TX headroom for alignment purposes. | ||
117 | */ | ||
118 | #define RT2X00_ALIGN_SIZE 4 /* Only whole frame needs alignment */ | ||
119 | #define RT2X00_L2PAD_SIZE 8 /* Both header & payload need alignment */ | ||
120 | |||
121 | /* | ||
116 | * Standard timing and size defines. | 122 | * Standard timing and size defines. |
117 | * These values should follow the ieee80211 specifications. | 123 | * These values should follow the ieee80211 specifications. |
118 | */ | 124 | */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 06c43ca39bf8..265e66dba552 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -686,7 +686,17 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
686 | /* | 686 | /* |
687 | * Initialize extra TX headroom required. | 687 | * Initialize extra TX headroom required. |
688 | */ | 688 | */ |
689 | rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom; | 689 | rt2x00dev->hw->extra_tx_headroom = |
690 | max_t(unsigned int, IEEE80211_TX_STATUS_HEADROOM, | ||
691 | rt2x00dev->ops->extra_tx_headroom); | ||
692 | |||
693 | /* | ||
694 | * Take TX headroom required for alignment into account. | ||
695 | */ | ||
696 | if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) | ||
697 | rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE; | ||
698 | else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags)) | ||
699 | rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE; | ||
690 | 700 | ||
691 | /* | 701 | /* |
692 | * Register HW. | 702 | * Register HW. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 239afc7a9c0b..9915a09141ef 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -104,7 +104,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
104 | * is also mapped to the DMA so it can be used for transfering | 104 | * is also mapped to the DMA so it can be used for transfering |
105 | * additional descriptor information to the hardware. | 105 | * additional descriptor information to the hardware. |
106 | */ | 106 | */ |
107 | skb_push(skb, rt2x00dev->hw->extra_tx_headroom); | 107 | skb_push(skb, rt2x00dev->ops->extra_tx_headroom); |
108 | 108 | ||
109 | skbdesc->skb_dma = | 109 | skbdesc->skb_dma = |
110 | dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); | 110 | dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); |
@@ -112,7 +112,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
112 | /* | 112 | /* |
113 | * Restore data pointer to original location again. | 113 | * Restore data pointer to original location again. |
114 | */ | 114 | */ |
115 | skb_pull(skb, rt2x00dev->hw->extra_tx_headroom); | 115 | skb_pull(skb, rt2x00dev->ops->extra_tx_headroom); |
116 | 116 | ||
117 | skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; | 117 | skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; |
118 | } | 118 | } |
@@ -134,7 +134,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
134 | * by the driver, but it was actually mapped to DMA. | 134 | * by the driver, but it was actually mapped to DMA. |
135 | */ | 135 | */ |
136 | dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, | 136 | dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, |
137 | skb->len + rt2x00dev->hw->extra_tx_headroom, | 137 | skb->len + rt2x00dev->ops->extra_tx_headroom, |
138 | DMA_TO_DEVICE); | 138 | DMA_TO_DEVICE); |
139 | skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; | 139 | skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; |
140 | } | 140 | } |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 8ebf5c33955d..f14deb0c8514 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -987,12 +987,13 @@ static void zd_op_configure_filter(struct ieee80211_hw *hw, | |||
987 | changed_flags &= SUPPORTED_FIF_FLAGS; | 987 | changed_flags &= SUPPORTED_FIF_FLAGS; |
988 | *new_flags &= SUPPORTED_FIF_FLAGS; | 988 | *new_flags &= SUPPORTED_FIF_FLAGS; |
989 | 989 | ||
990 | /* changed_flags is always populated but this driver | 990 | /* |
991 | * doesn't support all FIF flags so its possible we don't | 991 | * If multicast parameter (as returned by zd_op_prepare_multicast) |
992 | * need to do anything */ | 992 | * has changed, no bit in changed_flags is set. To handle this |
993 | if (!changed_flags) | 993 | * situation, we do not return if changed_flags is 0. If we do so, |
994 | return; | 994 | * we will have some issue with IPv6 which uses multicast for link |
995 | 995 | * layer address resolution. | |
996 | */ | ||
996 | if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)) | 997 | if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)) |
997 | zd_mc_add_all(&hash); | 998 | zd_mc_add_all(&hash); |
998 | 999 | ||
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index c4997930afc7..5d42d55e299b 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -102,15 +102,15 @@ static void do_suspend(void) | |||
102 | goto out_thaw; | 102 | goto out_thaw; |
103 | } | 103 | } |
104 | 104 | ||
105 | printk(KERN_DEBUG "suspending xenstore...\n"); | ||
106 | xs_suspend(); | ||
107 | |||
105 | err = dpm_suspend_noirq(PMSG_SUSPEND); | 108 | err = dpm_suspend_noirq(PMSG_SUSPEND); |
106 | if (err) { | 109 | if (err) { |
107 | printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); | 110 | printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); |
108 | goto out_resume; | 111 | goto out_resume; |
109 | } | 112 | } |
110 | 113 | ||
111 | printk(KERN_DEBUG "suspending xenstore...\n"); | ||
112 | xs_suspend(); | ||
113 | |||
114 | err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); | 114 | err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); |
115 | 115 | ||
116 | dpm_resume_noirq(PMSG_RESUME); | 116 | dpm_resume_noirq(PMSG_RESUME); |
@@ -120,13 +120,13 @@ static void do_suspend(void) | |||
120 | cancelled = 1; | 120 | cancelled = 1; |
121 | } | 121 | } |
122 | 122 | ||
123 | out_resume: | ||
123 | if (!cancelled) { | 124 | if (!cancelled) { |
124 | xen_arch_resume(); | 125 | xen_arch_resume(); |
125 | xs_resume(); | 126 | xs_resume(); |
126 | } else | 127 | } else |
127 | xs_suspend_cancel(); | 128 | xs_suspend_cancel(); |
128 | 129 | ||
129 | out_resume: | ||
130 | dpm_resume_end(PMSG_RESUME); | 130 | dpm_resume_end(PMSG_RESUME); |
131 | 131 | ||
132 | /* Make sure timer events get retriggered on all CPUs */ | 132 | /* Make sure timer events get retriggered on all CPUs */ |
diff --git a/fs/fcntl.c b/fs/fcntl.c index 2cf93ec40a67..97e01dc0d95f 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -618,60 +618,90 @@ static DEFINE_RWLOCK(fasync_lock); | |||
618 | static struct kmem_cache *fasync_cache __read_mostly; | 618 | static struct kmem_cache *fasync_cache __read_mostly; |
619 | 619 | ||
620 | /* | 620 | /* |
621 | * fasync_helper() is used by almost all character device drivers | 621 | * Remove a fasync entry. If successfully removed, return |
622 | * to set up the fasync queue. It returns negative on error, 0 if it did | 622 | * positive and clear the FASYNC flag. If no entry exists, |
623 | * no changes and positive if it added/deleted the entry. | 623 | * do nothing and return 0. |
624 | * | ||
625 | * NOTE! It is very important that the FASYNC flag always | ||
626 | * match the state "is the filp on a fasync list". | ||
627 | * | ||
628 | * We always take the 'filp->f_lock', in since fasync_lock | ||
629 | * needs to be irq-safe. | ||
624 | */ | 630 | */ |
625 | int fasync_helper(int fd, struct file * filp, int on, struct fasync_struct **fapp) | 631 | static int fasync_remove_entry(struct file *filp, struct fasync_struct **fapp) |
626 | { | 632 | { |
627 | struct fasync_struct *fa, **fp; | 633 | struct fasync_struct *fa, **fp; |
628 | struct fasync_struct *new = NULL; | ||
629 | int result = 0; | 634 | int result = 0; |
630 | 635 | ||
631 | if (on) { | 636 | spin_lock(&filp->f_lock); |
632 | new = kmem_cache_alloc(fasync_cache, GFP_KERNEL); | 637 | write_lock_irq(&fasync_lock); |
633 | if (!new) | 638 | for (fp = fapp; (fa = *fp) != NULL; fp = &fa->fa_next) { |
634 | return -ENOMEM; | 639 | if (fa->fa_file != filp) |
640 | continue; | ||
641 | *fp = fa->fa_next; | ||
642 | kmem_cache_free(fasync_cache, fa); | ||
643 | filp->f_flags &= ~FASYNC; | ||
644 | result = 1; | ||
645 | break; | ||
635 | } | 646 | } |
647 | write_unlock_irq(&fasync_lock); | ||
648 | spin_unlock(&filp->f_lock); | ||
649 | return result; | ||
650 | } | ||
651 | |||
652 | /* | ||
653 | * Add a fasync entry. Return negative on error, positive if | ||
654 | * added, and zero if did nothing but change an existing one. | ||
655 | * | ||
656 | * NOTE! It is very important that the FASYNC flag always | ||
657 | * match the state "is the filp on a fasync list". | ||
658 | */ | ||
659 | static int fasync_add_entry(int fd, struct file *filp, struct fasync_struct **fapp) | ||
660 | { | ||
661 | struct fasync_struct *new, *fa, **fp; | ||
662 | int result = 0; | ||
663 | |||
664 | new = kmem_cache_alloc(fasync_cache, GFP_KERNEL); | ||
665 | if (!new) | ||
666 | return -ENOMEM; | ||
636 | 667 | ||
637 | /* | ||
638 | * We need to take f_lock first since it's not an IRQ-safe | ||
639 | * lock. | ||
640 | */ | ||
641 | spin_lock(&filp->f_lock); | 668 | spin_lock(&filp->f_lock); |
642 | write_lock_irq(&fasync_lock); | 669 | write_lock_irq(&fasync_lock); |
643 | for (fp = fapp; (fa = *fp) != NULL; fp = &fa->fa_next) { | 670 | for (fp = fapp; (fa = *fp) != NULL; fp = &fa->fa_next) { |
644 | if (fa->fa_file == filp) { | 671 | if (fa->fa_file != filp) |
645 | if(on) { | 672 | continue; |
646 | fa->fa_fd = fd; | 673 | fa->fa_fd = fd; |
647 | kmem_cache_free(fasync_cache, new); | 674 | kmem_cache_free(fasync_cache, new); |
648 | } else { | 675 | goto out; |
649 | *fp = fa->fa_next; | ||
650 | kmem_cache_free(fasync_cache, fa); | ||
651 | result = 1; | ||
652 | } | ||
653 | goto out; | ||
654 | } | ||
655 | } | 676 | } |
656 | 677 | ||
657 | if (on) { | 678 | new->magic = FASYNC_MAGIC; |
658 | new->magic = FASYNC_MAGIC; | 679 | new->fa_file = filp; |
659 | new->fa_file = filp; | 680 | new->fa_fd = fd; |
660 | new->fa_fd = fd; | 681 | new->fa_next = *fapp; |
661 | new->fa_next = *fapp; | 682 | *fapp = new; |
662 | *fapp = new; | 683 | result = 1; |
663 | result = 1; | 684 | filp->f_flags |= FASYNC; |
664 | } | 685 | |
665 | out: | 686 | out: |
666 | if (on) | ||
667 | filp->f_flags |= FASYNC; | ||
668 | else | ||
669 | filp->f_flags &= ~FASYNC; | ||
670 | write_unlock_irq(&fasync_lock); | 687 | write_unlock_irq(&fasync_lock); |
671 | spin_unlock(&filp->f_lock); | 688 | spin_unlock(&filp->f_lock); |
672 | return result; | 689 | return result; |
673 | } | 690 | } |
674 | 691 | ||
692 | /* | ||
693 | * fasync_helper() is used by almost all character device drivers | ||
694 | * to set up the fasync queue, and for regular files by the file | ||
695 | * lease code. It returns negative on error, 0 if it did no changes | ||
696 | * and positive if it added/deleted the entry. | ||
697 | */ | ||
698 | int fasync_helper(int fd, struct file * filp, int on, struct fasync_struct **fapp) | ||
699 | { | ||
700 | if (!on) | ||
701 | return fasync_remove_entry(filp, fapp); | ||
702 | return fasync_add_entry(fd, filp, fapp); | ||
703 | } | ||
704 | |||
675 | EXPORT_SYMBOL(fasync_helper); | 705 | EXPORT_SYMBOL(fasync_helper); |
676 | 706 | ||
677 | void __kill_fasync(struct fasync_struct *fa, int sig, int band) | 707 | void __kill_fasync(struct fasync_struct *fa, int sig, int band) |
diff --git a/include/net/ip.h b/include/net/ip.h index d9a0e74d8923..fb63371c07a8 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -338,7 +338,7 @@ static inline int sk_mc_loop(struct sock *sk) | |||
338 | return inet6_sk(sk)->mc_loop; | 338 | return inet6_sk(sk)->mc_loop; |
339 | #endif | 339 | #endif |
340 | } | 340 | } |
341 | __WARN(); | 341 | WARN_ON(1); |
342 | return 1; | 342 | return 1; |
343 | } | 343 | } |
344 | 344 | ||
diff --git a/lib/zlib_inflate/inffast.c b/lib/zlib_inflate/inffast.c index 05e1559fa156..215447c55261 100644 --- a/lib/zlib_inflate/inffast.c +++ b/lib/zlib_inflate/inffast.c | |||
@@ -4,12 +4,25 @@ | |||
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <linux/zutil.h> | 6 | #include <linux/zutil.h> |
7 | #include <asm/unaligned.h> | ||
8 | #include <asm/byteorder.h> | ||
9 | #include "inftrees.h" | 7 | #include "inftrees.h" |
10 | #include "inflate.h" | 8 | #include "inflate.h" |
11 | #include "inffast.h" | 9 | #include "inffast.h" |
12 | 10 | ||
11 | /* Only do the unaligned "Faster" variant when | ||
12 | * CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set | ||
13 | * | ||
14 | * On powerpc, it won't be as we don't include autoconf.h | ||
15 | * automatically for the boot wrapper, which is intended as | ||
16 | * we run in an environment where we may not be able to deal | ||
17 | * with (even rare) alignment faults. In addition, we do not | ||
18 | * define __KERNEL__ for arch/powerpc/boot unlike x86 | ||
19 | */ | ||
20 | |||
21 | #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | ||
22 | #include <asm/unaligned.h> | ||
23 | #include <asm/byteorder.h> | ||
24 | #endif | ||
25 | |||
13 | #ifndef ASMINF | 26 | #ifndef ASMINF |
14 | 27 | ||
15 | /* Allow machine dependent optimization for post-increment or pre-increment. | 28 | /* Allow machine dependent optimization for post-increment or pre-increment. |
@@ -243,6 +256,7 @@ void inflate_fast(z_streamp strm, unsigned start) | |||
243 | } | 256 | } |
244 | } | 257 | } |
245 | else { | 258 | else { |
259 | #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | ||
246 | unsigned short *sout; | 260 | unsigned short *sout; |
247 | unsigned long loops; | 261 | unsigned long loops; |
248 | 262 | ||
@@ -284,6 +298,20 @@ void inflate_fast(z_streamp strm, unsigned start) | |||
284 | } | 298 | } |
285 | if (len & 1) | 299 | if (len & 1) |
286 | PUP(out) = PUP(from); | 300 | PUP(out) = PUP(from); |
301 | #else /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */ | ||
302 | from = out - dist; /* copy direct from output */ | ||
303 | do { /* minimum length is three */ | ||
304 | PUP(out) = PUP(from); | ||
305 | PUP(out) = PUP(from); | ||
306 | PUP(out) = PUP(from); | ||
307 | len -= 3; | ||
308 | } while (len > 2); | ||
309 | if (len) { | ||
310 | PUP(out) = PUP(from); | ||
311 | if (len > 1) | ||
312 | PUP(out) = PUP(from); | ||
313 | } | ||
314 | #endif /* !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */ | ||
287 | } | 315 | } |
288 | } | 316 | } |
289 | else if ((op & 64) == 0) { /* 2nd level distance code */ | 317 | else if ((op & 64) == 0) { /* 2nd level distance code */ |
diff --git a/mm/truncate.c b/mm/truncate.c index 342deee22684..e87e37244829 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
@@ -522,22 +522,20 @@ EXPORT_SYMBOL_GPL(invalidate_inode_pages2); | |||
522 | */ | 522 | */ |
523 | void truncate_pagecache(struct inode *inode, loff_t old, loff_t new) | 523 | void truncate_pagecache(struct inode *inode, loff_t old, loff_t new) |
524 | { | 524 | { |
525 | if (new < old) { | 525 | struct address_space *mapping = inode->i_mapping; |
526 | struct address_space *mapping = inode->i_mapping; | 526 | |
527 | 527 | /* | |
528 | /* | 528 | * unmap_mapping_range is called twice, first simply for |
529 | * unmap_mapping_range is called twice, first simply for | 529 | * efficiency so that truncate_inode_pages does fewer |
530 | * efficiency so that truncate_inode_pages does fewer | 530 | * single-page unmaps. However after this first call, and |
531 | * single-page unmaps. However after this first call, and | 531 | * before truncate_inode_pages finishes, it is possible for |
532 | * before truncate_inode_pages finishes, it is possible for | 532 | * private pages to be COWed, which remain after |
533 | * private pages to be COWed, which remain after | 533 | * truncate_inode_pages finishes, hence the second |
534 | * truncate_inode_pages finishes, hence the second | 534 | * unmap_mapping_range call must be made for correctness. |
535 | * unmap_mapping_range call must be made for correctness. | 535 | */ |
536 | */ | 536 | unmap_mapping_range(mapping, new + PAGE_SIZE - 1, 0, 1); |
537 | unmap_mapping_range(mapping, new + PAGE_SIZE - 1, 0, 1); | 537 | truncate_inode_pages(mapping, new); |
538 | truncate_inode_pages(mapping, new); | 538 | unmap_mapping_range(mapping, new + PAGE_SIZE - 1, 0, 1); |
539 | unmap_mapping_range(mapping, new + PAGE_SIZE - 1, 0, 1); | ||
540 | } | ||
541 | } | 539 | } |
542 | EXPORT_SYMBOL(truncate_pagecache); | 540 | EXPORT_SYMBOL(truncate_pagecache); |
543 | 541 | ||
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index df159fffe4bc..4bac362b1335 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -559,6 +559,11 @@ static inline struct inet6_dev *ipv6_skb_idev(struct sk_buff *skb) | |||
559 | return skb_dst(skb) ? ip6_dst_idev(skb_dst(skb)) : __in6_dev_get(skb->dev); | 559 | return skb_dst(skb) ? ip6_dst_idev(skb_dst(skb)) : __in6_dev_get(skb->dev); |
560 | } | 560 | } |
561 | 561 | ||
562 | static inline struct net *ipv6_skb_net(struct sk_buff *skb) | ||
563 | { | ||
564 | return skb_dst(skb) ? dev_net(skb_dst(skb)->dev) : dev_net(skb->dev); | ||
565 | } | ||
566 | |||
562 | /* Router Alert as of RFC 2711 */ | 567 | /* Router Alert as of RFC 2711 */ |
563 | 568 | ||
564 | static int ipv6_hop_ra(struct sk_buff *skb, int optoff) | 569 | static int ipv6_hop_ra(struct sk_buff *skb, int optoff) |
@@ -580,8 +585,8 @@ static int ipv6_hop_ra(struct sk_buff *skb, int optoff) | |||
580 | static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff) | 585 | static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff) |
581 | { | 586 | { |
582 | const unsigned char *nh = skb_network_header(skb); | 587 | const unsigned char *nh = skb_network_header(skb); |
588 | struct net *net = ipv6_skb_net(skb); | ||
583 | u32 pkt_len; | 589 | u32 pkt_len; |
584 | struct net *net = dev_net(skb_dst(skb)->dev); | ||
585 | 590 | ||
586 | if (nh[optoff + 1] != 4 || (optoff & 3) != 2) { | 591 | if (nh[optoff + 1] != 4 || (optoff & 3) != 2) { |
587 | LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", | 592 | LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 80c16f6e2af6..32abae3ce32a 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -15,12 +15,14 @@ | |||
15 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
16 | #include <linux/rtnetlink.h> | 16 | #include <linux/rtnetlink.h> |
17 | #include <net/mac80211.h> | 17 | #include <net/mac80211.h> |
18 | #include <net/ieee80211_radiotap.h> | ||
18 | #include "ieee80211_i.h" | 19 | #include "ieee80211_i.h" |
19 | #include "sta_info.h" | 20 | #include "sta_info.h" |
20 | #include "debugfs_netdev.h" | 21 | #include "debugfs_netdev.h" |
21 | #include "mesh.h" | 22 | #include "mesh.h" |
22 | #include "led.h" | 23 | #include "led.h" |
23 | #include "driver-ops.h" | 24 | #include "driver-ops.h" |
25 | #include "wme.h" | ||
24 | 26 | ||
25 | /** | 27 | /** |
26 | * DOC: Interface list locking | 28 | * DOC: Interface list locking |
@@ -314,7 +316,7 @@ static int ieee80211_open(struct net_device *dev) | |||
314 | if (sdata->vif.type == NL80211_IFTYPE_STATION) | 316 | if (sdata->vif.type == NL80211_IFTYPE_STATION) |
315 | ieee80211_queue_work(&local->hw, &sdata->u.mgd.work); | 317 | ieee80211_queue_work(&local->hw, &sdata->u.mgd.work); |
316 | 318 | ||
317 | netif_start_queue(dev); | 319 | netif_tx_start_all_queues(dev); |
318 | 320 | ||
319 | return 0; | 321 | return 0; |
320 | err_del_interface: | 322 | err_del_interface: |
@@ -343,7 +345,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
343 | /* | 345 | /* |
344 | * Stop TX on this interface first. | 346 | * Stop TX on this interface first. |
345 | */ | 347 | */ |
346 | netif_stop_queue(dev); | 348 | netif_tx_stop_all_queues(dev); |
347 | 349 | ||
348 | /* | 350 | /* |
349 | * Now delete all active aggregation sessions. | 351 | * Now delete all active aggregation sessions. |
@@ -644,6 +646,12 @@ static void ieee80211_teardown_sdata(struct net_device *dev) | |||
644 | WARN_ON(flushed); | 646 | WARN_ON(flushed); |
645 | } | 647 | } |
646 | 648 | ||
649 | static u16 ieee80211_netdev_select_queue(struct net_device *dev, | ||
650 | struct sk_buff *skb) | ||
651 | { | ||
652 | return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); | ||
653 | } | ||
654 | |||
647 | static const struct net_device_ops ieee80211_dataif_ops = { | 655 | static const struct net_device_ops ieee80211_dataif_ops = { |
648 | .ndo_open = ieee80211_open, | 656 | .ndo_open = ieee80211_open, |
649 | .ndo_stop = ieee80211_stop, | 657 | .ndo_stop = ieee80211_stop, |
@@ -652,8 +660,38 @@ static const struct net_device_ops ieee80211_dataif_ops = { | |||
652 | .ndo_set_multicast_list = ieee80211_set_multicast_list, | 660 | .ndo_set_multicast_list = ieee80211_set_multicast_list, |
653 | .ndo_change_mtu = ieee80211_change_mtu, | 661 | .ndo_change_mtu = ieee80211_change_mtu, |
654 | .ndo_set_mac_address = eth_mac_addr, | 662 | .ndo_set_mac_address = eth_mac_addr, |
663 | .ndo_select_queue = ieee80211_netdev_select_queue, | ||
655 | }; | 664 | }; |
656 | 665 | ||
666 | static u16 ieee80211_monitor_select_queue(struct net_device *dev, | ||
667 | struct sk_buff *skb) | ||
668 | { | ||
669 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
670 | struct ieee80211_local *local = sdata->local; | ||
671 | struct ieee80211_hdr *hdr; | ||
672 | struct ieee80211_radiotap_header *rtap = (void *)skb->data; | ||
673 | u8 *p; | ||
674 | |||
675 | if (local->hw.queues < 4) | ||
676 | return 0; | ||
677 | |||
678 | if (skb->len < 4 || | ||
679 | skb->len < le16_to_cpu(rtap->it_len) + 2 /* frame control */) | ||
680 | return 0; /* doesn't matter, frame will be dropped */ | ||
681 | |||
682 | hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len)); | ||
683 | |||
684 | if (!ieee80211_is_data_qos(hdr->frame_control)) { | ||
685 | skb->priority = 7; | ||
686 | return ieee802_1d_to_ac[skb->priority]; | ||
687 | } | ||
688 | |||
689 | p = ieee80211_get_qos_ctl(hdr); | ||
690 | skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; | ||
691 | |||
692 | return ieee80211_downgrade_queue(local, skb); | ||
693 | } | ||
694 | |||
657 | static const struct net_device_ops ieee80211_monitorif_ops = { | 695 | static const struct net_device_ops ieee80211_monitorif_ops = { |
658 | .ndo_open = ieee80211_open, | 696 | .ndo_open = ieee80211_open, |
659 | .ndo_stop = ieee80211_stop, | 697 | .ndo_stop = ieee80211_stop, |
@@ -662,6 +700,7 @@ static const struct net_device_ops ieee80211_monitorif_ops = { | |||
662 | .ndo_set_multicast_list = ieee80211_set_multicast_list, | 700 | .ndo_set_multicast_list = ieee80211_set_multicast_list, |
663 | .ndo_change_mtu = ieee80211_change_mtu, | 701 | .ndo_change_mtu = ieee80211_change_mtu, |
664 | .ndo_set_mac_address = eth_mac_addr, | 702 | .ndo_set_mac_address = eth_mac_addr, |
703 | .ndo_select_queue = ieee80211_monitor_select_queue, | ||
665 | }; | 704 | }; |
666 | 705 | ||
667 | static void ieee80211_if_setup(struct net_device *dev) | 706 | static void ieee80211_if_setup(struct net_device *dev) |
@@ -768,8 +807,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, | |||
768 | 807 | ||
769 | ASSERT_RTNL(); | 808 | ASSERT_RTNL(); |
770 | 809 | ||
771 | ndev = alloc_netdev(sizeof(*sdata) + local->hw.vif_data_size, | 810 | ndev = alloc_netdev_mq(sizeof(*sdata) + local->hw.vif_data_size, |
772 | name, ieee80211_if_setup); | 811 | name, ieee80211_if_setup, local->hw.queues); |
773 | if (!ndev) | 812 | if (!ndev) |
774 | return -ENOMEM; | 813 | return -ENOMEM; |
775 | dev_net_set(ndev, wiphy_net(local->hw.wiphy)); | 814 | dev_net_set(ndev, wiphy_net(local->hw.wiphy)); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index c79e59f82fd9..05a18f43e1bf 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -942,7 +942,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, | |||
942 | ieee80211_recalc_ps(local, -1); | 942 | ieee80211_recalc_ps(local, -1); |
943 | mutex_unlock(&local->iflist_mtx); | 943 | mutex_unlock(&local->iflist_mtx); |
944 | 944 | ||
945 | netif_start_queue(sdata->dev); | 945 | netif_tx_start_all_queues(sdata->dev); |
946 | netif_carrier_on(sdata->dev); | 946 | netif_carrier_on(sdata->dev); |
947 | } | 947 | } |
948 | 948 | ||
@@ -1074,7 +1074,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1074 | * time -- we don't want the scan code to enable queues. | 1074 | * time -- we don't want the scan code to enable queues. |
1075 | */ | 1075 | */ |
1076 | 1076 | ||
1077 | netif_stop_queue(sdata->dev); | 1077 | netif_tx_stop_all_queues(sdata->dev); |
1078 | netif_carrier_off(sdata->dev); | 1078 | netif_carrier_off(sdata->dev); |
1079 | 1079 | ||
1080 | rcu_read_lock(); | 1080 | rcu_read_lock(); |
@@ -1963,7 +1963,9 @@ static void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
1963 | rma = ieee80211_rx_mgmt_disassoc(sdata, mgmt, skb->len); | 1963 | rma = ieee80211_rx_mgmt_disassoc(sdata, mgmt, skb->len); |
1964 | break; | 1964 | break; |
1965 | case IEEE80211_STYPE_ACTION: | 1965 | case IEEE80211_STYPE_ACTION: |
1966 | /* XXX: differentiate, can only happen for CSA now! */ | 1966 | if (mgmt->u.action.category != WLAN_CATEGORY_SPECTRUM_MGMT) |
1967 | break; | ||
1968 | |||
1967 | ieee80211_sta_process_chanswitch(sdata, | 1969 | ieee80211_sta_process_chanswitch(sdata, |
1968 | &mgmt->u.action.u.chan_switch.sw_elem, | 1970 | &mgmt->u.action.u.chan_switch.sw_elem, |
1969 | ifmgd->associated); | 1971 | ifmgd->associated); |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 9f2807aeaf52..82a30c1bf3ab 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1746,7 +1746,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1746 | memset(info, 0, sizeof(*info)); | 1746 | memset(info, 0, sizeof(*info)); |
1747 | info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; | 1747 | info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; |
1748 | info->control.vif = &rx->sdata->vif; | 1748 | info->control.vif = &rx->sdata->vif; |
1749 | ieee80211_select_queue(local, fwd_skb); | 1749 | skb_set_queue_mapping(skb, |
1750 | ieee80211_select_queue(rx->sdata, fwd_skb)); | ||
1751 | ieee80211_set_qos_hdr(local, skb); | ||
1750 | if (is_multicast_ether_addr(fwd_hdr->addr1)) | 1752 | if (is_multicast_ether_addr(fwd_hdr->addr1)) |
1751 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, | 1753 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, |
1752 | fwded_mcast); | 1754 | fwded_mcast); |
@@ -2013,6 +2015,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) | |||
2013 | } | 2015 | } |
2014 | break; | 2016 | break; |
2015 | default: | 2017 | default: |
2018 | /* do not process rejected action frames */ | ||
2019 | if (mgmt->u.action.category & 0x80) | ||
2020 | return RX_DROP_MONITOR; | ||
2021 | |||
2016 | return RX_CONTINUE; | 2022 | return RX_CONTINUE; |
2017 | } | 2023 | } |
2018 | 2024 | ||
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index f1a4c7160300..f934c9620b73 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -353,10 +353,10 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) | |||
353 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | 353 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
354 | if (sdata->u.mgd.associated) { | 354 | if (sdata->u.mgd.associated) { |
355 | ieee80211_scan_ps_disable(sdata); | 355 | ieee80211_scan_ps_disable(sdata); |
356 | netif_wake_queue(sdata->dev); | 356 | netif_tx_wake_all_queues(sdata->dev); |
357 | } | 357 | } |
358 | } else | 358 | } else |
359 | netif_wake_queue(sdata->dev); | 359 | netif_tx_wake_all_queues(sdata->dev); |
360 | 360 | ||
361 | /* re-enable beaconing */ | 361 | /* re-enable beaconing */ |
362 | if (sdata->vif.type == NL80211_IFTYPE_AP || | 362 | if (sdata->vif.type == NL80211_IFTYPE_AP || |
@@ -411,7 +411,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local) | |||
411 | * are handled in the scan state machine | 411 | * are handled in the scan state machine |
412 | */ | 412 | */ |
413 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 413 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
414 | netif_stop_queue(sdata->dev); | 414 | netif_tx_stop_all_queues(sdata->dev); |
415 | } | 415 | } |
416 | mutex_unlock(&local->iflist_mtx); | 416 | mutex_unlock(&local->iflist_mtx); |
417 | 417 | ||
@@ -575,7 +575,7 @@ static void ieee80211_scan_state_leave_oper_channel(struct ieee80211_local *loca | |||
575 | continue; | 575 | continue; |
576 | 576 | ||
577 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | 577 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
578 | netif_stop_queue(sdata->dev); | 578 | netif_tx_stop_all_queues(sdata->dev); |
579 | if (sdata->u.mgd.associated) | 579 | if (sdata->u.mgd.associated) |
580 | ieee80211_scan_ps_enable(sdata); | 580 | ieee80211_scan_ps_enable(sdata); |
581 | } | 581 | } |
@@ -610,7 +610,7 @@ static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *loca | |||
610 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | 610 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
611 | if (sdata->u.mgd.associated) | 611 | if (sdata->u.mgd.associated) |
612 | ieee80211_scan_ps_disable(sdata); | 612 | ieee80211_scan_ps_disable(sdata); |
613 | netif_wake_queue(sdata->dev); | 613 | netif_tx_wake_all_queues(sdata->dev); |
614 | } | 614 | } |
615 | } | 615 | } |
616 | mutex_unlock(&local->iflist_mtx); | 616 | mutex_unlock(&local->iflist_mtx); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 27ceaefd7bc8..ac210b586702 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1512,7 +1512,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, | |||
1512 | return; | 1512 | return; |
1513 | } | 1513 | } |
1514 | 1514 | ||
1515 | ieee80211_select_queue(local, skb); | 1515 | ieee80211_set_qos_hdr(local, skb); |
1516 | ieee80211_tx(sdata, skb, false); | 1516 | ieee80211_tx(sdata, skb, false); |
1517 | rcu_read_unlock(); | 1517 | rcu_read_unlock(); |
1518 | } | 1518 | } |
@@ -2291,6 +2291,9 @@ void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) | |||
2291 | skb_set_network_header(skb, 0); | 2291 | skb_set_network_header(skb, 0); |
2292 | skb_set_transport_header(skb, 0); | 2292 | skb_set_transport_header(skb, 0); |
2293 | 2293 | ||
2294 | /* send all internal mgmt frames on VO */ | ||
2295 | skb_set_queue_mapping(skb, 0); | ||
2296 | |||
2294 | /* | 2297 | /* |
2295 | * The other path calling ieee80211_xmit is from the tasklet, | 2298 | * The other path calling ieee80211_xmit is from the tasklet, |
2296 | * and while we can handle concurrent transmissions locking | 2299 | * and while we can handle concurrent transmissions locking |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index dc76267e436e..3848140313f5 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -269,6 +269,7 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, | |||
269 | enum queue_stop_reason reason) | 269 | enum queue_stop_reason reason) |
270 | { | 270 | { |
271 | struct ieee80211_local *local = hw_to_local(hw); | 271 | struct ieee80211_local *local = hw_to_local(hw); |
272 | struct ieee80211_sub_if_data *sdata; | ||
272 | 273 | ||
273 | if (WARN_ON(queue >= hw->queues)) | 274 | if (WARN_ON(queue >= hw->queues)) |
274 | return; | 275 | return; |
@@ -281,6 +282,11 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, | |||
281 | 282 | ||
282 | if (!skb_queue_empty(&local->pending[queue])) | 283 | if (!skb_queue_empty(&local->pending[queue])) |
283 | tasklet_schedule(&local->tx_pending_tasklet); | 284 | tasklet_schedule(&local->tx_pending_tasklet); |
285 | |||
286 | rcu_read_lock(); | ||
287 | list_for_each_entry_rcu(sdata, &local->interfaces, list) | ||
288 | netif_tx_wake_queue(netdev_get_tx_queue(sdata->dev, queue)); | ||
289 | rcu_read_unlock(); | ||
284 | } | 290 | } |
285 | 291 | ||
286 | void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, | 292 | void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, |
@@ -305,11 +311,17 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue, | |||
305 | enum queue_stop_reason reason) | 311 | enum queue_stop_reason reason) |
306 | { | 312 | { |
307 | struct ieee80211_local *local = hw_to_local(hw); | 313 | struct ieee80211_local *local = hw_to_local(hw); |
314 | struct ieee80211_sub_if_data *sdata; | ||
308 | 315 | ||
309 | if (WARN_ON(queue >= hw->queues)) | 316 | if (WARN_ON(queue >= hw->queues)) |
310 | return; | 317 | return; |
311 | 318 | ||
312 | __set_bit(reason, &local->queue_stop_reasons[queue]); | 319 | __set_bit(reason, &local->queue_stop_reasons[queue]); |
320 | |||
321 | rcu_read_lock(); | ||
322 | list_for_each_entry_rcu(sdata, &local->interfaces, list) | ||
323 | netif_tx_stop_queue(netdev_get_tx_queue(sdata->dev, queue)); | ||
324 | rcu_read_unlock(); | ||
313 | } | 325 | } |
314 | 326 | ||
315 | void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, | 327 | void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, |
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index b19b7696f3a2..79d887dae738 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -44,22 +44,69 @@ static int wme_downgrade_ac(struct sk_buff *skb) | |||
44 | } | 44 | } |
45 | 45 | ||
46 | 46 | ||
47 | /* Indicate which queue to use. */ | 47 | /* Indicate which queue to use. */ |
48 | static u16 classify80211(struct ieee80211_local *local, struct sk_buff *skb) | 48 | u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, |
49 | struct sk_buff *skb) | ||
49 | { | 50 | { |
50 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 51 | struct ieee80211_local *local = sdata->local; |
52 | struct sta_info *sta = NULL; | ||
53 | u32 sta_flags = 0; | ||
54 | const u8 *ra = NULL; | ||
55 | bool qos = false; | ||
51 | 56 | ||
52 | if (!ieee80211_is_data(hdr->frame_control)) { | 57 | if (local->hw.queues < 4 || skb->len < 6) { |
53 | /* management frames go on AC_VO queue, but are sent | 58 | skb->priority = 0; /* required for correct WPA/11i MIC */ |
54 | * without QoS control fields */ | 59 | return min_t(u16, local->hw.queues - 1, |
55 | return 0; | 60 | ieee802_1d_to_ac[skb->priority]); |
61 | } | ||
62 | |||
63 | rcu_read_lock(); | ||
64 | switch (sdata->vif.type) { | ||
65 | case NL80211_IFTYPE_AP_VLAN: | ||
66 | rcu_read_lock(); | ||
67 | sta = rcu_dereference(sdata->u.vlan.sta); | ||
68 | if (sta) | ||
69 | sta_flags = get_sta_flags(sta); | ||
70 | rcu_read_unlock(); | ||
71 | if (sta) | ||
72 | break; | ||
73 | case NL80211_IFTYPE_AP: | ||
74 | ra = skb->data; | ||
75 | break; | ||
76 | case NL80211_IFTYPE_WDS: | ||
77 | ra = sdata->u.wds.remote_addr; | ||
78 | break; | ||
79 | #ifdef CONFIG_MAC80211_MESH | ||
80 | case NL80211_IFTYPE_MESH_POINT: | ||
81 | /* | ||
82 | * XXX: This is clearly broken ... but already was before, | ||
83 | * because ieee80211_fill_mesh_addresses() would clear A1 | ||
84 | * except for multicast addresses. | ||
85 | */ | ||
86 | break; | ||
87 | #endif | ||
88 | case NL80211_IFTYPE_STATION: | ||
89 | ra = sdata->u.mgd.bssid; | ||
90 | break; | ||
91 | case NL80211_IFTYPE_ADHOC: | ||
92 | ra = skb->data; | ||
93 | break; | ||
94 | default: | ||
95 | break; | ||
56 | } | 96 | } |
57 | 97 | ||
58 | if (0 /* injected */) { | 98 | if (!sta && ra && !is_multicast_ether_addr(ra)) { |
59 | /* use AC from radiotap */ | 99 | sta = sta_info_get(local, ra); |
100 | if (sta) | ||
101 | sta_flags = get_sta_flags(sta); | ||
60 | } | 102 | } |
61 | 103 | ||
62 | if (!ieee80211_is_data_qos(hdr->frame_control)) { | 104 | if (sta_flags & WLAN_STA_WME) |
105 | qos = true; | ||
106 | |||
107 | rcu_read_unlock(); | ||
108 | |||
109 | if (!qos) { | ||
63 | skb->priority = 0; /* required for correct WPA/11i MIC */ | 110 | skb->priority = 0; /* required for correct WPA/11i MIC */ |
64 | return ieee802_1d_to_ac[skb->priority]; | 111 | return ieee802_1d_to_ac[skb->priority]; |
65 | } | 112 | } |
@@ -68,6 +115,12 @@ static u16 classify80211(struct ieee80211_local *local, struct sk_buff *skb) | |||
68 | * data frame has */ | 115 | * data frame has */ |
69 | skb->priority = cfg80211_classify8021d(skb); | 116 | skb->priority = cfg80211_classify8021d(skb); |
70 | 117 | ||
118 | return ieee80211_downgrade_queue(local, skb); | ||
119 | } | ||
120 | |||
121 | u16 ieee80211_downgrade_queue(struct ieee80211_local *local, | ||
122 | struct sk_buff *skb) | ||
123 | { | ||
71 | /* in case we are a client verify acm is not set for this ac */ | 124 | /* in case we are a client verify acm is not set for this ac */ |
72 | while (unlikely(local->wmm_acm & BIT(skb->priority))) { | 125 | while (unlikely(local->wmm_acm & BIT(skb->priority))) { |
73 | if (wme_downgrade_ac(skb)) { | 126 | if (wme_downgrade_ac(skb)) { |
@@ -85,24 +138,17 @@ static u16 classify80211(struct ieee80211_local *local, struct sk_buff *skb) | |||
85 | return ieee802_1d_to_ac[skb->priority]; | 138 | return ieee802_1d_to_ac[skb->priority]; |
86 | } | 139 | } |
87 | 140 | ||
88 | void ieee80211_select_queue(struct ieee80211_local *local, struct sk_buff *skb) | 141 | void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb) |
89 | { | 142 | { |
90 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 143 | struct ieee80211_hdr *hdr = (void *)skb->data; |
91 | u16 queue; | 144 | |
92 | u8 tid; | 145 | /* Fill in the QoS header if there is one. */ |
93 | |||
94 | queue = classify80211(local, skb); | ||
95 | if (unlikely(queue >= local->hw.queues)) | ||
96 | queue = local->hw.queues - 1; | ||
97 | |||
98 | /* | ||
99 | * Now we know the 1d priority, fill in the QoS header if | ||
100 | * there is one (and we haven't done this before). | ||
101 | */ | ||
102 | if (ieee80211_is_data_qos(hdr->frame_control)) { | 146 | if (ieee80211_is_data_qos(hdr->frame_control)) { |
103 | u8 *p = ieee80211_get_qos_ctl(hdr); | 147 | u8 *p = ieee80211_get_qos_ctl(hdr); |
104 | u8 ack_policy = 0; | 148 | u8 ack_policy = 0, tid; |
149 | |||
105 | tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; | 150 | tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; |
151 | |||
106 | if (unlikely(local->wifi_wme_noack_test)) | 152 | if (unlikely(local->wifi_wme_noack_test)) |
107 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << | 153 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << |
108 | QOS_CONTROL_ACK_POLICY_SHIFT; | 154 | QOS_CONTROL_ACK_POLICY_SHIFT; |
@@ -110,6 +156,4 @@ void ieee80211_select_queue(struct ieee80211_local *local, struct sk_buff *skb) | |||
110 | *p++ = ack_policy | tid; | 156 | *p++ = ack_policy | tid; |
111 | *p = 0; | 157 | *p = 0; |
112 | } | 158 | } |
113 | |||
114 | skb_set_queue_mapping(skb, queue); | ||
115 | } | 159 | } |
diff --git a/net/mac80211/wme.h b/net/mac80211/wme.h index d4fd87ca5118..6053b1c9feee 100644 --- a/net/mac80211/wme.h +++ b/net/mac80211/wme.h | |||
@@ -20,7 +20,11 @@ | |||
20 | 20 | ||
21 | extern const int ieee802_1d_to_ac[8]; | 21 | extern const int ieee802_1d_to_ac[8]; |
22 | 22 | ||
23 | void ieee80211_select_queue(struct ieee80211_local *local, | 23 | u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, |
24 | struct sk_buff *skb); | 24 | struct sk_buff *skb); |
25 | void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb); | ||
26 | u16 ieee80211_downgrade_queue(struct ieee80211_local *local, | ||
27 | struct sk_buff *skb); | ||
28 | |||
25 | 29 | ||
26 | #endif /* _WME_H */ | 30 | #endif /* _WME_H */ |
diff --git a/net/wireless/core.c b/net/wireless/core.c index c2a2c563d21a..92b812442488 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -745,9 +745,9 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
745 | mutex_unlock(&rdev->devlist_mtx); | 745 | mutex_unlock(&rdev->devlist_mtx); |
746 | dev_put(dev); | 746 | dev_put(dev); |
747 | } | 747 | } |
748 | #ifdef CONFIG_CFG80211_WEXT | ||
749 | cfg80211_lock_rdev(rdev); | 748 | cfg80211_lock_rdev(rdev); |
750 | mutex_lock(&rdev->devlist_mtx); | 749 | mutex_lock(&rdev->devlist_mtx); |
750 | #ifdef CONFIG_CFG80211_WEXT | ||
751 | wdev_lock(wdev); | 751 | wdev_lock(wdev); |
752 | switch (wdev->iftype) { | 752 | switch (wdev->iftype) { |
753 | case NL80211_IFTYPE_ADHOC: | 753 | case NL80211_IFTYPE_ADHOC: |
@@ -760,10 +760,10 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
760 | break; | 760 | break; |
761 | } | 761 | } |
762 | wdev_unlock(wdev); | 762 | wdev_unlock(wdev); |
763 | #endif | ||
763 | rdev->opencount++; | 764 | rdev->opencount++; |
764 | mutex_unlock(&rdev->devlist_mtx); | 765 | mutex_unlock(&rdev->devlist_mtx); |
765 | cfg80211_unlock_rdev(rdev); | 766 | cfg80211_unlock_rdev(rdev); |
766 | #endif | ||
767 | break; | 767 | break; |
768 | case NETDEV_UNREGISTER: | 768 | case NETDEV_UNREGISTER: |
769 | /* | 769 | /* |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index baa898add287..7a0754c92df4 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1690,7 +1690,7 @@ int regulatory_hint_user(const char *alpha2) | |||
1690 | request->wiphy_idx = WIPHY_IDX_STALE; | 1690 | request->wiphy_idx = WIPHY_IDX_STALE; |
1691 | request->alpha2[0] = alpha2[0]; | 1691 | request->alpha2[0] = alpha2[0]; |
1692 | request->alpha2[1] = alpha2[1]; | 1692 | request->alpha2[1] = alpha2[1]; |
1693 | request->initiator = NL80211_REGDOM_SET_BY_USER, | 1693 | request->initiator = NL80211_REGDOM_SET_BY_USER; |
1694 | 1694 | ||
1695 | queue_regulatory_request(request); | 1695 | queue_regulatory_request(request); |
1696 | 1696 | ||
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0fe48cd91ffa..f9bdf264473d 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -219,8 +219,13 @@ for F in $1; do \ | |||
219 | fsize=$$(stat -c "%s" $$F); \ | 219 | fsize=$$(stat -c "%s" $$F); \ |
220 | dec_size=$$(expr $$dec_size + $$fsize); \ | 220 | dec_size=$$(expr $$dec_size + $$fsize); \ |
221 | done; \ | 221 | done; \ |
222 | printf "%08x" $$dec_size | \ | 222 | printf "%08x\n" $$dec_size | \ |
223 | sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g' \ | 223 | sed 's/\(..\)/\1 /g' | { \ |
224 | read ch0 ch1 ch2 ch3; \ | ||
225 | for ch in $$ch3 $$ch2 $$ch1 $$ch0; do \ | ||
226 | printf '%s%03o' '\\' $$((0x$$ch)); \ | ||
227 | done; \ | ||
228 | } \ | ||
224 | ) | 229 | ) |
225 | 230 | ||
226 | quiet_cmd_bzip2 = BZIP2 $@ | 231 | quiet_cmd_bzip2 = BZIP2 $@ |