Merge branch 'for_3.0/gpio-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into gpio/merge

This commit is contained in:
Grant Likely 2011-06-08 09:12:16 -06:00
commit c226feb013
200 changed files with 2409 additions and 1241 deletions

View File

@ -999,7 +999,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
With this option on every unmap_single operation will With this option on every unmap_single operation will
result in a hardware IOTLB flush operation as opposed result in a hardware IOTLB flush operation as opposed
to batching them for performance. to batching them for performance.
sp_off [Default Off]
By default, super page will be supported if Intel IOMMU
has the capability. With this option, super page will
not be supported.
intremap= [X86-64, Intel-IOMMU] intremap= [X86-64, Intel-IOMMU]
Format: { on (default) | off | nosid } Format: { on (default) | off | nosid }
on enable Interrupt Remapping (default) on enable Interrupt Remapping (default)

View File

@ -1,5 +1,5 @@
# This creates the demonstration utility "lguest" which runs a Linux guest. # This creates the demonstration utility "lguest" which runs a Linux guest.
# Missing headers? Add "-I../../include -I../../arch/x86/include" # Missing headers? Add "-I../../../include -I../../../arch/x86/include"
CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE
all: lguest all: lguest

View File

@ -49,7 +49,7 @@
#include <linux/virtio_rng.h> #include <linux/virtio_rng.h>
#include <linux/virtio_ring.h> #include <linux/virtio_ring.h>
#include <asm/bootparam.h> #include <asm/bootparam.h>
#include "../../include/linux/lguest_launcher.h" #include "../../../include/linux/lguest_launcher.h"
/*L:110 /*L:110
* We can ignore the 42 include files we need for this program, but I do want * We can ignore the 42 include files we need for this program, but I do want
* to draw attention to the use of kernel-style types. * to draw attention to the use of kernel-style types.
@ -135,9 +135,6 @@ struct device {
/* Is it operational */ /* Is it operational */
bool running; bool running;
/* Does Guest want an intrrupt on empty? */
bool irq_on_empty;
/* Device-specific data. */ /* Device-specific data. */
void *priv; void *priv;
}; };
@ -637,10 +634,7 @@ static void trigger_irq(struct virtqueue *vq)
/* If they don't want an interrupt, don't send one... */ /* If they don't want an interrupt, don't send one... */
if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) { if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) {
/* ... unless they've asked us to force one on empty. */ return;
if (!vq->dev->irq_on_empty
|| lg_last_avail(vq) != vq->vring.avail->idx)
return;
} }
/* Send the Guest an interrupt tell them we used something up. */ /* Send the Guest an interrupt tell them we used something up. */
@ -1057,15 +1051,6 @@ static void create_thread(struct virtqueue *vq)
close(vq->eventfd); close(vq->eventfd);
} }
static bool accepted_feature(struct device *dev, unsigned int bit)
{
const u8 *features = get_feature_bits(dev) + dev->feature_len;
if (dev->feature_len < bit / CHAR_BIT)
return false;
return features[bit / CHAR_BIT] & (1 << (bit % CHAR_BIT));
}
static void start_device(struct device *dev) static void start_device(struct device *dev)
{ {
unsigned int i; unsigned int i;
@ -1079,8 +1064,6 @@ static void start_device(struct device *dev)
verbose(" %02x", get_feature_bits(dev) verbose(" %02x", get_feature_bits(dev)
[dev->feature_len+i]); [dev->feature_len+i]);
dev->irq_on_empty = accepted_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
for (vq = dev->vq; vq; vq = vq->next) { for (vq = dev->vq; vq; vq = vq->next) {
if (vq->service) if (vq->service)
create_thread(vq); create_thread(vq);
@ -1564,7 +1547,6 @@ static void setup_tun_net(char *arg)
/* Set up the tun device. */ /* Set up the tun device. */
configure_device(ipfd, tapif, ip); configure_device(ipfd, tapif, ip);
add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
/* Expect Guest to handle everything except UFO */ /* Expect Guest to handle everything except UFO */
add_feature(dev, VIRTIO_NET_F_CSUM); add_feature(dev, VIRTIO_NET_F_CSUM);
add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); add_feature(dev, VIRTIO_NET_F_GUEST_CSUM);

View File

@ -1,7 +1,7 @@
VERSION = 3 VERSION = 3
PATCHLEVEL = 0 PATCHLEVEL = 0
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc1 EXTRAVERSION = -rc2
NAME = Sneaky Weasel NAME = Sneaky Weasel
# *DOCUMENTATION* # *DOCUMENTATION*

View File

@ -249,6 +249,29 @@ static int slot_cn7_get_cd(struct platform_device *pdev)
{ {
return !gpio_get_value(GPIO_PORT41); return !gpio_get_value(GPIO_PORT41);
} }
/* MERAM */
static struct sh_mobile_meram_info meram_info = {
.addr_mode = SH_MOBILE_MERAM_MODE1,
};
static struct resource meram_resources[] = {
[0] = {
.name = "MERAM",
.start = 0xe8000000,
.end = 0xe81fffff,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device meram_device = {
.name = "sh_mobile_meram",
.id = 0,
.num_resources = ARRAY_SIZE(meram_resources),
.resource = meram_resources,
.dev = {
.platform_data = &meram_info,
},
};
/* SH_MMCIF */ /* SH_MMCIF */
static struct resource sh_mmcif_resources[] = { static struct resource sh_mmcif_resources[] = {
@ -447,13 +470,29 @@ const static struct fb_videomode ap4evb_lcdc_modes[] = {
#endif #endif
}, },
}; };
static struct sh_mobile_meram_cfg lcd_meram_cfg = {
.icb[0] = {
.marker_icb = 28,
.cache_icb = 24,
.meram_offset = 0x0,
.meram_size = 0x40,
},
.icb[1] = {
.marker_icb = 29,
.cache_icb = 25,
.meram_offset = 0x40,
.meram_size = 0x40,
},
};
static struct sh_mobile_lcdc_info lcdc_info = { static struct sh_mobile_lcdc_info lcdc_info = {
.meram_dev = &meram_info,
.ch[0] = { .ch[0] = {
.chan = LCDC_CHAN_MAINLCD, .chan = LCDC_CHAN_MAINLCD,
.bpp = 16, .bpp = 16,
.lcd_cfg = ap4evb_lcdc_modes, .lcd_cfg = ap4evb_lcdc_modes,
.num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes), .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
.meram_cfg = &lcd_meram_cfg,
} }
}; };
@ -724,15 +763,31 @@ static struct platform_device fsi_device = {
static struct platform_device fsi_ak4643_device = { static struct platform_device fsi_ak4643_device = {
.name = "sh_fsi2_a_ak4643", .name = "sh_fsi2_a_ak4643",
}; };
static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
.icb[0] = {
.marker_icb = 30,
.cache_icb = 26,
.meram_offset = 0x80,
.meram_size = 0x100,
},
.icb[1] = {
.marker_icb = 31,
.cache_icb = 27,
.meram_offset = 0x180,
.meram_size = 0x100,
},
};
static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = { static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
.clock_source = LCDC_CLK_EXTERNAL, .clock_source = LCDC_CLK_EXTERNAL,
.meram_dev = &meram_info,
.ch[0] = { .ch[0] = {
.chan = LCDC_CHAN_MAINLCD, .chan = LCDC_CHAN_MAINLCD,
.bpp = 16, .bpp = 16,
.interface_type = RGB24, .interface_type = RGB24,
.clock_divider = 1, .clock_divider = 1,
.flags = LCDC_FLAGS_DWPOL, .flags = LCDC_FLAGS_DWPOL,
.meram_cfg = &hdmi_meram_cfg,
} }
}; };
@ -961,6 +1016,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
&csi2_device, &csi2_device,
&ceu_device, &ceu_device,
&ap4evb_camera, &ap4evb_camera,
&meram_device,
}; };
static void __init hdmi_init_pm_clock(void) static void __init hdmi_init_pm_clock(void)

View File

@ -39,6 +39,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/pm_runtime.h>
#include <linux/smsc911x.h> #include <linux/smsc911x.h>
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include <linux/tca6416_keypad.h> #include <linux/tca6416_keypad.h>
@ -314,6 +315,30 @@ static struct platform_device smc911x_device = {
}, },
}; };
/* MERAM */
static struct sh_mobile_meram_info mackerel_meram_info = {
.addr_mode = SH_MOBILE_MERAM_MODE1,
};
static struct resource meram_resources[] = {
[0] = {
.name = "MERAM",
.start = 0xe8000000,
.end = 0xe81fffff,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device meram_device = {
.name = "sh_mobile_meram",
.id = 0,
.num_resources = ARRAY_SIZE(meram_resources),
.resource = meram_resources,
.dev = {
.platform_data = &mackerel_meram_info,
},
};
/* LCDC */ /* LCDC */
static struct fb_videomode mackerel_lcdc_modes[] = { static struct fb_videomode mackerel_lcdc_modes[] = {
{ {
@ -342,7 +367,23 @@ static int mackerel_get_brightness(void *board_data)
return gpio_get_value(GPIO_PORT31); return gpio_get_value(GPIO_PORT31);
} }
static struct sh_mobile_meram_cfg lcd_meram_cfg = {
.icb[0] = {
.marker_icb = 28,
.cache_icb = 24,
.meram_offset = 0x0,
.meram_size = 0x40,
},
.icb[1] = {
.marker_icb = 29,
.cache_icb = 25,
.meram_offset = 0x40,
.meram_size = 0x40,
},
};
static struct sh_mobile_lcdc_info lcdc_info = { static struct sh_mobile_lcdc_info lcdc_info = {
.meram_dev = &mackerel_meram_info,
.clock_source = LCDC_CLK_BUS, .clock_source = LCDC_CLK_BUS,
.ch[0] = { .ch[0] = {
.chan = LCDC_CHAN_MAINLCD, .chan = LCDC_CHAN_MAINLCD,
@ -362,6 +403,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
.name = "sh_mobile_lcdc_bl", .name = "sh_mobile_lcdc_bl",
.max_brightness = 1, .max_brightness = 1,
}, },
.meram_cfg = &lcd_meram_cfg,
} }
}; };
@ -388,8 +430,23 @@ static struct platform_device lcdc_device = {
}, },
}; };
static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
.icb[0] = {
.marker_icb = 30,
.cache_icb = 26,
.meram_offset = 0x80,
.meram_size = 0x100,
},
.icb[1] = {
.marker_icb = 31,
.cache_icb = 27,
.meram_offset = 0x180,
.meram_size = 0x100,
},
};
/* HDMI */ /* HDMI */
static struct sh_mobile_lcdc_info hdmi_lcdc_info = { static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
.meram_dev = &mackerel_meram_info,
.clock_source = LCDC_CLK_EXTERNAL, .clock_source = LCDC_CLK_EXTERNAL,
.ch[0] = { .ch[0] = {
.chan = LCDC_CHAN_MAINLCD, .chan = LCDC_CHAN_MAINLCD,
@ -397,6 +454,7 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
.interface_type = RGB24, .interface_type = RGB24,
.clock_divider = 1, .clock_divider = 1,
.flags = LCDC_FLAGS_DWPOL, .flags = LCDC_FLAGS_DWPOL,
.meram_cfg = &hdmi_meram_cfg,
} }
}; };
@ -856,6 +914,17 @@ static int slot_cn7_get_cd(struct platform_device *pdev)
} }
/* SDHI0 */ /* SDHI0 */
static irqreturn_t mackerel_sdhi0_gpio_cd(int irq, void *arg)
{
struct device *dev = arg;
struct sh_mobile_sdhi_info *info = dev->platform_data;
struct tmio_mmc_data *pdata = info->pdata;
tmio_mmc_cd_wakeup(pdata);
return IRQ_HANDLED;
}
static struct sh_mobile_sdhi_info sdhi0_info = { static struct sh_mobile_sdhi_info sdhi0_info = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
@ -1150,6 +1219,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
&mackerel_camera, &mackerel_camera,
&hdmi_lcdc_device, &hdmi_lcdc_device,
&hdmi_device, &hdmi_device,
&meram_device,
}; };
/* Keypad Initialization */ /* Keypad Initialization */
@ -1238,6 +1308,7 @@ static void __init mackerel_init(void)
{ {
u32 srcr4; u32 srcr4;
struct clk *clk; struct clk *clk;
int ret;
sh7372_pinmux_init(); sh7372_pinmux_init();
@ -1343,6 +1414,13 @@ static void __init mackerel_init(void)
gpio_request(GPIO_FN_SDHID0_1, NULL); gpio_request(GPIO_FN_SDHID0_1, NULL);
gpio_request(GPIO_FN_SDHID0_0, NULL); gpio_request(GPIO_FN_SDHID0_0, NULL);
ret = request_irq(evt2irq(0x3340), mackerel_sdhi0_gpio_cd,
IRQF_TRIGGER_FALLING, "sdhi0 cd", &sdhi0_device.dev);
if (!ret)
sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD;
else
pr_err("Cannot get IRQ #%d: %d\n", evt2irq(0x3340), ret);
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
/* enable SDHI1 */ /* enable SDHI1 */
gpio_request(GPIO_FN_SDHICMD1, NULL); gpio_request(GPIO_FN_SDHICMD1, NULL);

View File

@ -509,6 +509,7 @@ enum { MSTP001,
MSTP118, MSTP117, MSTP116, MSTP113, MSTP118, MSTP117, MSTP116, MSTP113,
MSTP106, MSTP101, MSTP100, MSTP106, MSTP101, MSTP100,
MSTP223, MSTP223,
MSTP218, MSTP217, MSTP216,
MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
MSTP329, MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, MSTP329, MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312,
MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403, MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403,
@ -534,6 +535,9 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */ [MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */
[MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */
[MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */ [MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */
[MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */
[MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */
[MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */
[MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
[MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
[MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
@ -626,6 +630,9 @@ static struct clk_lookup lookups[] = {
CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */ CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */
CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */ CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */
CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */
CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */
CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */
CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */

View File

@ -24,6 +24,8 @@
#include <mach/irqs.h> #include <mach/irqs.h>
#include "board-harmony.h"
#define PMC_CTRL 0x0 #define PMC_CTRL 0x0
#define PMC_CTRL_INTR_LOW (1 << 17) #define PMC_CTRL_INTR_LOW (1 << 17)
@ -98,7 +100,7 @@ static struct tps6586x_platform_data tps_platform = {
.irq_base = TEGRA_NR_IRQS, .irq_base = TEGRA_NR_IRQS,
.num_subdevs = ARRAY_SIZE(tps_devs), .num_subdevs = ARRAY_SIZE(tps_devs),
.subdevs = tps_devs, .subdevs = tps_devs,
.gpio_base = TEGRA_NR_GPIOS, .gpio_base = HARMONY_GPIO_TPS6586X(0),
}; };
static struct i2c_board_info __initdata harmony_regulators[] = { static struct i2c_board_info __initdata harmony_regulators[] = {

View File

@ -17,7 +17,8 @@
#ifndef _MACH_TEGRA_BOARD_HARMONY_H #ifndef _MACH_TEGRA_BOARD_HARMONY_H
#define _MACH_TEGRA_BOARD_HARMONY_H #define _MACH_TEGRA_BOARD_HARMONY_H
#define HARMONY_GPIO_WM8903(_x_) (TEGRA_NR_GPIOS + (_x_)) #define HARMONY_GPIO_TPS6586X(_x_) (TEGRA_NR_GPIOS + (_x_))
#define HARMONY_GPIO_WM8903(_x_) (HARMONY_GPIO_TPS6586X(4) + (_x_))
#define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5 #define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5
#define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1 #define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1

View File

@ -25,7 +25,7 @@
ENTRY(_strncpy) ENTRY(_strncpy)
CC = R2 == 0; CC = R2 == 0;
if CC JUMP 4f; if CC JUMP 6f;
P2 = R2 ; /* size */ P2 = R2 ; /* size */
P0 = R0 ; /* dst*/ P0 = R0 ; /* dst*/

View File

@ -320,11 +320,12 @@
#define __NR_clock_adjtime 1328 #define __NR_clock_adjtime 1328
#define __NR_syncfs 1329 #define __NR_syncfs 1329
#define __NR_setns 1330 #define __NR_setns 1330
#define __NR_sendmmsg 1331
#ifdef __KERNEL__ #ifdef __KERNEL__
#define NR_syscalls 307 /* length of syscall table */ #define NR_syscalls 308 /* length of syscall table */
/* /*
* The following defines stop scripts/checksyscalls.sh from complaining about * The following defines stop scripts/checksyscalls.sh from complaining about

View File

@ -1776,6 +1776,7 @@ sys_call_table:
data8 sys_clock_adjtime data8 sys_clock_adjtime
data8 sys_syncfs data8 sys_syncfs
data8 sys_setns // 1330 data8 sys_setns // 1330
data8 sys_sendmmsg
.org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
#endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */

View File

@ -715,7 +715,8 @@ static struct syscore_ops pmacpic_syscore_ops = {
static int __init init_pmacpic_syscore(void) static int __init init_pmacpic_syscore(void)
{ {
register_syscore_ops(&pmacpic_syscore_ops); if (pmac_irq_hw[0])
register_syscore_ops(&pmacpic_syscore_ops);
return 0; return 0;
} }

View File

@ -161,7 +161,7 @@ config ARCH_HAS_CPU_IDLE_WAIT
config NO_IOPORT config NO_IOPORT
def_bool !PCI def_bool !PCI
depends on !SH_CAYMAN && !SH_SH4202_MICRODEV depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN
config IO_TRAPPED config IO_TRAPPED
bool bool

View File

@ -359,37 +359,31 @@ static struct soc_camera_link camera_link = {
.priv = &camera_info, .priv = &camera_info,
}; };
static void dummy_release(struct device *dev) static struct platform_device *camera_device;
{
}
static struct platform_device camera_device = { static void ap325rxa_camera_release(struct device *dev)
.name = "soc_camera_platform", {
.dev = { soc_camera_platform_release(&camera_device);
.platform_data = &camera_info, }
.release = dummy_release,
},
};
static int ap325rxa_camera_add(struct soc_camera_link *icl, static int ap325rxa_camera_add(struct soc_camera_link *icl,
struct device *dev) struct device *dev)
{ {
if (icl != &camera_link || camera_probe() <= 0) int ret = soc_camera_platform_add(icl, dev, &camera_device, &camera_link,
return -ENODEV; ap325rxa_camera_release, 0);
if (ret < 0)
return ret;
camera_info.dev = dev; ret = camera_probe();
if (ret < 0)
soc_camera_platform_del(icl, camera_device, &camera_link);
return platform_device_register(&camera_device); return ret;
} }
static void ap325rxa_camera_del(struct soc_camera_link *icl) static void ap325rxa_camera_del(struct soc_camera_link *icl)
{ {
if (icl != &camera_link) soc_camera_platform_del(icl, camera_device, &camera_link);
return;
platform_device_unregister(&camera_device);
memset(&camera_device.dev.kobj, 0,
sizeof(camera_device.dev.kobj));
} }
#endif /* CONFIG_I2C */ #endif /* CONFIG_I2C */

View File

@ -885,6 +885,9 @@ static struct platform_device sh_mmcif_device = {
}, },
.num_resources = ARRAY_SIZE(sh_mmcif_resources), .num_resources = ARRAY_SIZE(sh_mmcif_resources),
.resource = sh_mmcif_resources, .resource = sh_mmcif_resources,
.archdata = {
.hwblk_id = HWBLK_MMC,
},
}; };
#endif #endif

View File

@ -18,6 +18,7 @@
#include <asm/pgtable-2level.h> #include <asm/pgtable-2level.h>
#endif #endif
#include <asm/page.h> #include <asm/page.h>
#include <asm/mmu.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <asm/addrspace.h> #include <asm/addrspace.h>

View File

@ -41,7 +41,9 @@
#define user_mode(regs) (((regs)->sr & 0x40000000)==0) #define user_mode(regs) (((regs)->sr & 0x40000000)==0)
#define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) #define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15])
#define GET_USP(regs) ((regs)->regs[15])
#define GET_FP(regs) ((regs)->regs[14])
#define GET_USP(regs) ((regs)->regs[15])
extern void show_regs(struct pt_regs *); extern void show_regs(struct pt_regs *);
@ -131,7 +133,7 @@ extern void ptrace_triggered(struct perf_event *bp, int nmi,
static inline unsigned long profile_pc(struct pt_regs *regs) static inline unsigned long profile_pc(struct pt_regs *regs)
{ {
unsigned long pc = instruction_pointer(regs); unsigned long pc = regs->pc;
if (virt_addr_uncached(pc)) if (virt_addr_uncached(pc))
return CAC_ADDR(pc); return CAC_ADDR(pc);

View File

@ -9,6 +9,7 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
#include <linux/swap.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>

View File

@ -236,6 +236,7 @@ enum {
}; };
enum { enum {
SHDMA_SLAVE_INVALID,
SHDMA_SLAVE_SCIF0_TX, SHDMA_SLAVE_SCIF0_TX,
SHDMA_SLAVE_SCIF0_RX, SHDMA_SLAVE_SCIF0_RX,
SHDMA_SLAVE_SCIF1_TX, SHDMA_SLAVE_SCIF1_TX,

View File

@ -285,6 +285,7 @@ enum {
}; };
enum { enum {
SHDMA_SLAVE_INVALID,
SHDMA_SLAVE_SCIF0_TX, SHDMA_SLAVE_SCIF0_TX,
SHDMA_SLAVE_SCIF0_RX, SHDMA_SLAVE_SCIF0_RX,
SHDMA_SLAVE_SCIF1_TX, SHDMA_SLAVE_SCIF1_TX,

View File

@ -252,6 +252,7 @@ enum {
}; };
enum { enum {
SHDMA_SLAVE_INVALID,
SHDMA_SLAVE_SDHI_TX, SHDMA_SLAVE_SDHI_TX,
SHDMA_SLAVE_SDHI_RX, SHDMA_SLAVE_SDHI_RX,
SHDMA_SLAVE_MMCIF_TX, SHDMA_SLAVE_MMCIF_TX,

View File

@ -21,6 +21,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <linux/hw_breakpoint.h> #include <linux/hw_breakpoint.h>
#include <linux/prefetch.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/system.h> #include <asm/system.h>

View File

@ -82,7 +82,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
void *addr; void *addr;
addr = __in_29bit_mode() ? addr = __in_29bit_mode() ?
(void *)P1SEGADDR((unsigned long)vaddr) : vaddr; (void *)CAC_ADDR((unsigned long)vaddr) : vaddr;
switch (direction) { switch (direction) {
case DMA_FROM_DEVICE: /* invalidate only */ case DMA_FROM_DEVICE: /* invalidate only */

View File

@ -8,6 +8,7 @@ CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
ifdef CONFIG_FUNCTION_TRACER ifdef CONFIG_FUNCTION_TRACER
# Do not profile debug and lowlevel utilities # Do not profile debug and lowlevel utilities
CFLAGS_REMOVE_tsc.o = -pg
CFLAGS_REMOVE_rtc.o = -pg CFLAGS_REMOVE_rtc.o = -pg
CFLAGS_REMOVE_paravirt-spinlocks.o = -pg CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
CFLAGS_REMOVE_pvclock.o = -pg CFLAGS_REMOVE_pvclock.o = -pg
@ -28,6 +29,7 @@ CFLAGS_paravirt.o := $(nostackp)
GCOV_PROFILE_vsyscall_64.o := n GCOV_PROFILE_vsyscall_64.o := n
GCOV_PROFILE_hpet.o := n GCOV_PROFILE_hpet.o := n
GCOV_PROFILE_tsc.o := n GCOV_PROFILE_tsc.o := n
GCOV_PROFILE_vread_tsc_64.o := n
GCOV_PROFILE_paravirt.o := n GCOV_PROFILE_paravirt.o := n
# vread_tsc_64 is hot and should be fully optimized: # vread_tsc_64 is hot and should be fully optimized:

View File

@ -642,7 +642,7 @@ static int __init idle_setup(char *str)
boot_option_idle_override = IDLE_POLL; boot_option_idle_override = IDLE_POLL;
} else if (!strcmp(str, "mwait")) { } else if (!strcmp(str, "mwait")) {
boot_option_idle_override = IDLE_FORCE_MWAIT; boot_option_idle_override = IDLE_FORCE_MWAIT;
WARN_ONCE(1, "\idle=mwait\" will be removed in 2012\"\n"); WARN_ONCE(1, "\"idle=mwait\" will be removed in 2012\n");
} else if (!strcmp(str, "halt")) { } else if (!strcmp(str, "halt")) {
/* /*
* When the boot option of idle=halt is added, halt is * When the boot option of idle=halt is added, halt is

View File

@ -1332,7 +1332,7 @@ static inline void mwait_play_dead(void)
void *mwait_ptr; void *mwait_ptr;
struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info); struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info);
if (!this_cpu_has(X86_FEATURE_MWAIT) && mwait_usable(c)) if (!(this_cpu_has(X86_FEATURE_MWAIT) && mwait_usable(c)))
return; return;
if (!this_cpu_has(X86_FEATURE_CLFLSH)) if (!this_cpu_has(X86_FEATURE_CLFLSH))
return; return;

View File

@ -993,6 +993,7 @@ static void lguest_time_irq(unsigned int irq, struct irq_desc *desc)
static void lguest_time_init(void) static void lguest_time_init(void)
{ {
/* Set up the timer interrupt (0) to go to our simple timer routine */ /* Set up the timer interrupt (0) to go to our simple timer routine */
lguest_setup_irq(0);
irq_set_handler(0, lguest_time_irq); irq_set_handler(0, lguest_time_irq);
clocksource_register_hz(&lguest_clock, NSEC_PER_SEC); clocksource_register_hz(&lguest_clock, NSEC_PER_SEC);

View File

@ -21,7 +21,7 @@ static void cfq_dtor(struct io_context *ioc)
if (!hlist_empty(&ioc->cic_list)) { if (!hlist_empty(&ioc->cic_list)) {
struct cfq_io_context *cic; struct cfq_io_context *cic;
cic = list_entry(ioc->cic_list.first, struct cfq_io_context, cic = hlist_entry(ioc->cic_list.first, struct cfq_io_context,
cic_list); cic_list);
cic->dtor(ioc); cic->dtor(ioc);
} }
@ -57,7 +57,7 @@ static void cfq_exit(struct io_context *ioc)
if (!hlist_empty(&ioc->cic_list)) { if (!hlist_empty(&ioc->cic_list)) {
struct cfq_io_context *cic; struct cfq_io_context *cic;
cic = list_entry(ioc->cic_list.first, struct cfq_io_context, cic = hlist_entry(ioc->cic_list.first, struct cfq_io_context,
cic_list); cic_list);
cic->exit(ioc); cic->exit(ioc);
} }

View File

@ -185,7 +185,7 @@ struct cfq_group {
int nr_cfqq; int nr_cfqq;
/* /*
* Per group busy queus average. Useful for workload slice calc. We * Per group busy queues average. Useful for workload slice calc. We
* create the array for each prio class but at run time it is used * create the array for each prio class but at run time it is used
* only for RT and BE class and slot for IDLE class remains unused. * only for RT and BE class and slot for IDLE class remains unused.
* This is primarily done to avoid confusion and a gcc warning. * This is primarily done to avoid confusion and a gcc warning.
@ -369,16 +369,16 @@ CFQ_CFQQ_FNS(wait_busy);
#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \ #define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \
blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \ blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \
cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \ cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \
blkg_path(&(cfqq)->cfqg->blkg), ##args); blkg_path(&(cfqq)->cfqg->blkg), ##args)
#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) \ #define cfq_log_cfqg(cfqd, cfqg, fmt, args...) \
blk_add_trace_msg((cfqd)->queue, "%s " fmt, \ blk_add_trace_msg((cfqd)->queue, "%s " fmt, \
blkg_path(&(cfqg)->blkg), ##args); \ blkg_path(&(cfqg)->blkg), ##args) \
#else #else
#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \ #define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \
blk_add_trace_msg((cfqd)->queue, "cfq%d " fmt, (cfqq)->pid, ##args) blk_add_trace_msg((cfqd)->queue, "cfq%d " fmt, (cfqq)->pid, ##args)
#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do {} while (0); #define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do {} while (0)
#endif #endif
#define cfq_log(cfqd, fmt, args...) \ #define cfq_log(cfqd, fmt, args...) \
blk_add_trace_msg((cfqd)->queue, "cfq " fmt, ##args) blk_add_trace_msg((cfqd)->queue, "cfq " fmt, ##args)
@ -3786,9 +3786,6 @@ new_queue:
return 0; return 0;
queue_fail: queue_fail:
if (cic)
put_io_context(cic->ioc);
cfq_schedule_dispatch(cfqd); cfq_schedule_dispatch(cfqd);
spin_unlock_irqrestore(q->queue_lock, flags); spin_unlock_irqrestore(q->queue_lock, flags);
cfq_log(cfqd, "set_request fail"); cfq_log(cfqd, "set_request fail");

View File

@ -192,7 +192,8 @@ static int sock_xmit(struct nbd_device *lo, int send, void *buf, int size,
if (lo->xmit_timeout) if (lo->xmit_timeout)
del_timer_sync(&ti); del_timer_sync(&ti);
} else } else
result = kernel_recvmsg(sock, &msg, &iov, 1, size, 0); result = kernel_recvmsg(sock, &msg, &iov, 1, size,
msg.msg_flags);
if (signal_pending(current)) { if (signal_pending(current)) {
siginfo_t info; siginfo_t info;
@ -753,9 +754,26 @@ static int __init nbd_init(void)
return -ENOMEM; return -ENOMEM;
part_shift = 0; part_shift = 0;
if (max_part > 0) if (max_part > 0) {
part_shift = fls(max_part); part_shift = fls(max_part);
/*
* Adjust max_part according to part_shift as it is exported
* to user space so that user can know the max number of
* partition kernel should be able to manage.
*
* Note that -1 is required because partition 0 is reserved
* for the whole disk.
*/
max_part = (1UL << part_shift) - 1;
}
if ((1UL << part_shift) > DISK_MAX_PARTS)
return -EINVAL;
if (nbds_max > 1UL << (MINORBITS - part_shift))
return -EINVAL;
for (i = 0; i < nbds_max; i++) { for (i = 0; i < nbds_max; i++) {
struct gendisk *disk = alloc_disk(1 << part_shift); struct gendisk *disk = alloc_disk(1 << part_shift);
if (!disk) if (!disk)

View File

@ -321,7 +321,6 @@ static void pcd_init_units(void)
strcpy(disk->disk_name, cd->name); /* umm... */ strcpy(disk->disk_name, cd->name); /* umm... */
disk->fops = &pcd_bdops; disk->fops = &pcd_bdops;
disk->flags = GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE; disk->flags = GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE;
disk->events = DISK_EVENT_MEDIA_CHANGE;
} }
} }

View File

@ -6,10 +6,13 @@
#include <linux/virtio.h> #include <linux/virtio.h>
#include <linux/virtio_blk.h> #include <linux/virtio_blk.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/string_helpers.h>
#include <scsi/scsi_cmnd.h>
#define PART_BITS 4 #define PART_BITS 4
static int major, index; static int major, index;
struct workqueue_struct *virtblk_wq;
struct virtio_blk struct virtio_blk
{ {
@ -26,6 +29,9 @@ struct virtio_blk
mempool_t *pool; mempool_t *pool;
/* Process context for config space updates */
struct work_struct config_work;
/* What host tells us, plus 2 for header & tailer. */ /* What host tells us, plus 2 for header & tailer. */
unsigned int sg_elems; unsigned int sg_elems;
@ -141,7 +147,7 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
num = blk_rq_map_sg(q, vbr->req, vblk->sg + out); num = blk_rq_map_sg(q, vbr->req, vblk->sg + out);
if (vbr->req->cmd_type == REQ_TYPE_BLOCK_PC) { if (vbr->req->cmd_type == REQ_TYPE_BLOCK_PC) {
sg_set_buf(&vblk->sg[num + out + in++], vbr->req->sense, 96); sg_set_buf(&vblk->sg[num + out + in++], vbr->req->sense, SCSI_SENSE_BUFFERSIZE);
sg_set_buf(&vblk->sg[num + out + in++], &vbr->in_hdr, sg_set_buf(&vblk->sg[num + out + in++], &vbr->in_hdr,
sizeof(vbr->in_hdr)); sizeof(vbr->in_hdr));
} }
@ -291,6 +297,46 @@ static ssize_t virtblk_serial_show(struct device *dev,
} }
DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL); DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
static void virtblk_config_changed_work(struct work_struct *work)
{
struct virtio_blk *vblk =
container_of(work, struct virtio_blk, config_work);
struct virtio_device *vdev = vblk->vdev;
struct request_queue *q = vblk->disk->queue;
char cap_str_2[10], cap_str_10[10];
u64 capacity, size;
/* Host must always specify the capacity. */
vdev->config->get(vdev, offsetof(struct virtio_blk_config, capacity),
&capacity, sizeof(capacity));
/* If capacity is too big, truncate with warning. */
if ((sector_t)capacity != capacity) {
dev_warn(&vdev->dev, "Capacity %llu too large: truncating\n",
(unsigned long long)capacity);
capacity = (sector_t)-1;
}
size = capacity * queue_logical_block_size(q);
string_get_size(size, STRING_UNITS_2, cap_str_2, sizeof(cap_str_2));
string_get_size(size, STRING_UNITS_10, cap_str_10, sizeof(cap_str_10));
dev_notice(&vdev->dev,
"new size: %llu %d-byte logical blocks (%s/%s)\n",
(unsigned long long)capacity,
queue_logical_block_size(q),
cap_str_10, cap_str_2);
set_capacity(vblk->disk, capacity);
}
static void virtblk_config_changed(struct virtio_device *vdev)
{
struct virtio_blk *vblk = vdev->priv;
queue_work(virtblk_wq, &vblk->config_work);
}
static int __devinit virtblk_probe(struct virtio_device *vdev) static int __devinit virtblk_probe(struct virtio_device *vdev)
{ {
struct virtio_blk *vblk; struct virtio_blk *vblk;
@ -327,6 +373,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
vblk->vdev = vdev; vblk->vdev = vdev;
vblk->sg_elems = sg_elems; vblk->sg_elems = sg_elems;
sg_init_table(vblk->sg, vblk->sg_elems); sg_init_table(vblk->sg, vblk->sg_elems);
INIT_WORK(&vblk->config_work, virtblk_config_changed_work);
/* We expect one virtqueue, for output. */ /* We expect one virtqueue, for output. */
vblk->vq = virtio_find_single_vq(vdev, blk_done, "requests"); vblk->vq = virtio_find_single_vq(vdev, blk_done, "requests");
@ -477,6 +524,8 @@ static void __devexit virtblk_remove(struct virtio_device *vdev)
{ {
struct virtio_blk *vblk = vdev->priv; struct virtio_blk *vblk = vdev->priv;
flush_work(&vblk->config_work);
/* Nothing should be pending. */ /* Nothing should be pending. */
BUG_ON(!list_empty(&vblk->reqs)); BUG_ON(!list_empty(&vblk->reqs));
@ -508,27 +557,47 @@ static unsigned int features[] = {
* Use __refdata to avoid this warning. * Use __refdata to avoid this warning.
*/ */
static struct virtio_driver __refdata virtio_blk = { static struct virtio_driver __refdata virtio_blk = {
.feature_table = features, .feature_table = features,
.feature_table_size = ARRAY_SIZE(features), .feature_table_size = ARRAY_SIZE(features),
.driver.name = KBUILD_MODNAME, .driver.name = KBUILD_MODNAME,
.driver.owner = THIS_MODULE, .driver.owner = THIS_MODULE,
.id_table = id_table, .id_table = id_table,
.probe = virtblk_probe, .probe = virtblk_probe,
.remove = __devexit_p(virtblk_remove), .remove = __devexit_p(virtblk_remove),
.config_changed = virtblk_config_changed,
}; };
static int __init init(void) static int __init init(void)
{ {
int error;
virtblk_wq = alloc_workqueue("virtio-blk", 0, 0);
if (!virtblk_wq)
return -ENOMEM;
major = register_blkdev(0, "virtblk"); major = register_blkdev(0, "virtblk");
if (major < 0) if (major < 0) {
return major; error = major;
return register_virtio_driver(&virtio_blk); goto out_destroy_workqueue;
}
error = register_virtio_driver(&virtio_blk);
if (error)
goto out_unregister_blkdev;
return 0;
out_unregister_blkdev:
unregister_blkdev(major, "virtblk");
out_destroy_workqueue:
destroy_workqueue(virtblk_wq);
return error;
} }
static void __exit fini(void) static void __exit fini(void)
{ {
unregister_blkdev(major, "virtblk"); unregister_blkdev(major, "virtblk");
unregister_virtio_driver(&virtio_blk); unregister_virtio_driver(&virtio_blk);
destroy_workqueue(virtblk_wq);
} }
module_init(init); module_init(init);
module_exit(fini); module_exit(fini);

View File

@ -809,11 +809,13 @@ static int __init xen_blkif_init(void)
failed_init: failed_init:
kfree(blkbk->pending_reqs); kfree(blkbk->pending_reqs);
kfree(blkbk->pending_grant_handles); kfree(blkbk->pending_grant_handles);
for (i = 0; i < mmap_pages; i++) { if (blkbk->pending_pages) {
if (blkbk->pending_pages[i]) for (i = 0; i < mmap_pages; i++) {
__free_page(blkbk->pending_pages[i]); if (blkbk->pending_pages[i])
__free_page(blkbk->pending_pages[i]);
}
kfree(blkbk->pending_pages);
} }
kfree(blkbk->pending_pages);
kfree(blkbk); kfree(blkbk);
blkbk = NULL; blkbk = NULL;
return rc; return rc;

View File

@ -357,14 +357,13 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
} }
vbd->bdev = bdev; vbd->bdev = bdev;
vbd->size = vbd_sz(vbd);
if (vbd->bdev->bd_disk == NULL) { if (vbd->bdev->bd_disk == NULL) {
DPRINTK("xen_vbd_create: device %08x doesn't exist.\n", DPRINTK("xen_vbd_create: device %08x doesn't exist.\n",
vbd->pdevice); vbd->pdevice);
xen_vbd_free(vbd); xen_vbd_free(vbd);
return -ENOENT; return -ENOENT;
} }
vbd->size = vbd_sz(vbd);
if (vbd->bdev->bd_disk->flags & GENHD_FL_CD || cdrom) if (vbd->bdev->bd_disk->flags & GENHD_FL_CD || cdrom)
vbd->type |= VDISK_CDROM; vbd->type |= VDISK_CDROM;

View File

@ -355,29 +355,24 @@ static void hci_uart_tty_wakeup(struct tty_struct *tty)
* flags pointer to flags for data * flags pointer to flags for data
* count count of received data in bytes * count count of received data in bytes
* *
* Return Value: Number of bytes received * Return Value: None
*/ */
static unsigned int hci_uart_tty_receive(struct tty_struct *tty, static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *flags, int count)
const u8 *data, char *flags, int count)
{ {
struct hci_uart *hu = (void *)tty->disc_data; struct hci_uart *hu = (void *)tty->disc_data;
int received;
if (!hu || tty != hu->tty) if (!hu || tty != hu->tty)
return -ENODEV; return;
if (!test_bit(HCI_UART_PROTO_SET, &hu->flags)) if (!test_bit(HCI_UART_PROTO_SET, &hu->flags))
return -EINVAL; return;
spin_lock(&hu->rx_lock); spin_lock(&hu->rx_lock);
received = hu->proto->recv(hu, (void *) data, count); hu->proto->recv(hu, (void *) data, count);
if (received > 0) hu->hdev->stat.byte_rx += count;
hu->hdev->stat.byte_rx += received;
spin_unlock(&hu->rx_lock); spin_unlock(&hu->rx_lock);
tty_unthrottle(tty); tty_unthrottle(tty);
return received;
} }
static int hci_uart_register_dev(struct hci_uart *hu) static int hci_uart_register_dev(struct hci_uart *hu)

View File

@ -627,7 +627,6 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
gendisk->fops = &viocd_fops; gendisk->fops = &viocd_fops;
gendisk->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE | gendisk->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE |
GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE; GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE;
gendisk->events = DISK_EVENT_MEDIA_CHANGE;
set_capacity(gendisk, 0); set_capacity(gendisk, 0);
gendisk->private_data = d; gendisk->private_data = d;
d->viocd_disk = gendisk; d->viocd_disk = gendisk;

View File

@ -1677,17 +1677,12 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
portdev->config.max_nr_ports = 1; portdev->config.max_nr_ports = 1;
if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT)) { if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT)) {
multiport = true; multiport = true;
vdev->features[0] |= 1 << VIRTIO_CONSOLE_F_MULTIPORT;
vdev->config->get(vdev, offsetof(struct virtio_console_config, vdev->config->get(vdev, offsetof(struct virtio_console_config,
max_nr_ports), max_nr_ports),
&portdev->config.max_nr_ports, &portdev->config.max_nr_ports,
sizeof(portdev->config.max_nr_ports)); sizeof(portdev->config.max_nr_ports));
} }
/* Let the Host know we support multiple ports.*/
vdev->config->finalize_features(vdev);
err = init_vqs(portdev); err = init_vqs(portdev);
if (err < 0) { if (err < 0) {
dev_err(&vdev->dev, "Error %d initializing vqs\n", err); dev_err(&vdev->dev, "Error %d initializing vqs\n", err);

View File

@ -24,7 +24,6 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
@ -153,12 +152,10 @@ static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate)
{ {
int ret; int ret;
/* wake up device and enable clock */ /* enable clock */
pm_runtime_get_sync(&p->pdev->dev);
ret = clk_enable(p->clk); ret = clk_enable(p->clk);
if (ret) { if (ret) {
dev_err(&p->pdev->dev, "cannot enable clock\n"); dev_err(&p->pdev->dev, "cannot enable clock\n");
pm_runtime_put_sync(&p->pdev->dev);
return ret; return ret;
} }
@ -190,9 +187,8 @@ static void sh_cmt_disable(struct sh_cmt_priv *p)
/* disable interrupts in CMT block */ /* disable interrupts in CMT block */
sh_cmt_write(p, CMCSR, 0); sh_cmt_write(p, CMCSR, 0);
/* stop clock and mark device as idle */ /* stop clock */
clk_disable(p->clk); clk_disable(p->clk);
pm_runtime_put_sync(&p->pdev->dev);
} }
/* private flags */ /* private flags */
@ -664,7 +660,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
if (p) { if (p) {
dev_info(&pdev->dev, "kept as earlytimer\n"); dev_info(&pdev->dev, "kept as earlytimer\n");
pm_runtime_enable(&pdev->dev);
return 0; return 0;
} }
@ -679,9 +674,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
kfree(p); kfree(p);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
} }
if (!is_early_platform_device(pdev))
pm_runtime_enable(&pdev->dev);
return ret; return ret;
} }

View File

@ -25,7 +25,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
@ -110,12 +109,10 @@ static int sh_tmu_enable(struct sh_tmu_priv *p)
{ {
int ret; int ret;
/* wake up device and enable clock */ /* enable clock */
pm_runtime_get_sync(&p->pdev->dev);
ret = clk_enable(p->clk); ret = clk_enable(p->clk);
if (ret) { if (ret) {
dev_err(&p->pdev->dev, "cannot enable clock\n"); dev_err(&p->pdev->dev, "cannot enable clock\n");
pm_runtime_put_sync(&p->pdev->dev);
return ret; return ret;
} }
@ -144,9 +141,8 @@ static void sh_tmu_disable(struct sh_tmu_priv *p)
/* disable interrupts in TMU block */ /* disable interrupts in TMU block */
sh_tmu_write(p, TCR, 0x0000); sh_tmu_write(p, TCR, 0x0000);
/* stop clock and mark device as idle */ /* stop clock */
clk_disable(p->clk); clk_disable(p->clk);
pm_runtime_put_sync(&p->pdev->dev);
} }
static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta,
@ -415,7 +411,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
if (p) { if (p) {
dev_info(&pdev->dev, "kept as earlytimer\n"); dev_info(&pdev->dev, "kept as earlytimer\n");
pm_runtime_enable(&pdev->dev);
return 0; return 0;
} }
@ -430,9 +425,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
kfree(p); kfree(p);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
} }
if (!is_early_platform_device(pdev))
pm_runtime_enable(&pdev->dev);
return ret; return ret;
} }

View File

@ -343,7 +343,7 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan)
dmae_set_dmars(sh_chan, cfg->mid_rid); dmae_set_dmars(sh_chan, cfg->mid_rid);
dmae_set_chcr(sh_chan, cfg->chcr); dmae_set_chcr(sh_chan, cfg->chcr);
} else if ((sh_dmae_readl(sh_chan, CHCR) & 0xf00) != 0x400) { } else {
dmae_init(sh_chan); dmae_init(sh_chan);
} }
@ -1144,6 +1144,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
/* platform data */ /* platform data */
shdev->pdata = pdata; shdev->pdata = pdata;
platform_set_drvdata(pdev, shdev);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev); pm_runtime_get_sync(&pdev->dev);
@ -1256,7 +1258,6 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
platform_set_drvdata(pdev, shdev);
dma_async_device_register(&shdev->common); dma_async_device_register(&shdev->common);
return err; return err;
@ -1278,6 +1279,8 @@ rst_err:
if (dmars) if (dmars)
iounmap(shdev->dmars); iounmap(shdev->dmars);
platform_set_drvdata(pdev, NULL);
emapdmars: emapdmars:
iounmap(shdev->chan_reg); iounmap(shdev->chan_reg);
synchronize_rcu(); synchronize_rcu();
@ -1316,6 +1319,8 @@ static int __exit sh_dmae_remove(struct platform_device *pdev)
iounmap(shdev->dmars); iounmap(shdev->dmars);
iounmap(shdev->chan_reg); iounmap(shdev->chan_reg);
platform_set_drvdata(pdev, NULL);
synchronize_rcu(); synchronize_rcu();
kfree(shdev); kfree(shdev);

View File

@ -432,7 +432,6 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
{ {
void __iomem *base = bank->base; void __iomem *base = bank->base;
u32 gpio_bit = 1 << gpio; u32 gpio_bit = 1 << gpio;
u32 val;
if (cpu_is_omap44xx()) { if (cpu_is_omap44xx()) {
MOD_REG_BIT(OMAP4_GPIO_LEVELDETECT0, gpio_bit, MOD_REG_BIT(OMAP4_GPIO_LEVELDETECT0, gpio_bit,
@ -455,15 +454,8 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
} }
if (likely(!(bank->non_wakeup_gpios & gpio_bit))) { if (likely(!(bank->non_wakeup_gpios & gpio_bit))) {
if (cpu_is_omap44xx()) { if (cpu_is_omap44xx()) {
if (trigger != 0) MOD_REG_BIT(OMAP4_GPIO_IRQWAKEN0, gpio_bit,
__raw_writel(1 << gpio, bank->base+ trigger != 0);
OMAP4_GPIO_IRQWAKEN0);
else {
val = __raw_readl(bank->base +
OMAP4_GPIO_IRQWAKEN0);
__raw_writel(val & (~(1 << gpio)), bank->base +
OMAP4_GPIO_IRQWAKEN0);
}
} else { } else {
/* /*
* GPIO wakeup request can only be generated on edge * GPIO wakeup request can only be generated on edge
@ -1134,8 +1126,11 @@ static void gpio_irq_shutdown(struct irq_data *d)
{ {
unsigned int gpio = d->irq - IH_GPIO_BASE; unsigned int gpio = d->irq - IH_GPIO_BASE;
struct gpio_bank *bank = irq_data_get_irq_chip_data(d); struct gpio_bank *bank = irq_data_get_irq_chip_data(d);
unsigned long flags;
spin_lock_irqsave(&bank->lock, flags);
_reset_gpio(bank, gpio); _reset_gpio(bank, gpio);
spin_unlock_irqrestore(&bank->lock, flags);
} }
static void gpio_ack_irq(struct irq_data *d) static void gpio_ack_irq(struct irq_data *d)
@ -1150,9 +1145,12 @@ static void gpio_mask_irq(struct irq_data *d)
{ {
unsigned int gpio = d->irq - IH_GPIO_BASE; unsigned int gpio = d->irq - IH_GPIO_BASE;
struct gpio_bank *bank = irq_data_get_irq_chip_data(d); struct gpio_bank *bank = irq_data_get_irq_chip_data(d);
unsigned long flags;
spin_lock_irqsave(&bank->lock, flags);
_set_gpio_irqenable(bank, gpio, 0); _set_gpio_irqenable(bank, gpio, 0);
_set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE); _set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE);
spin_unlock_irqrestore(&bank->lock, flags);
} }
static void gpio_unmask_irq(struct irq_data *d) static void gpio_unmask_irq(struct irq_data *d)
@ -1161,7 +1159,9 @@ static void gpio_unmask_irq(struct irq_data *d)
struct gpio_bank *bank = irq_data_get_irq_chip_data(d); struct gpio_bank *bank = irq_data_get_irq_chip_data(d);
unsigned int irq_mask = 1 << get_gpio_index(gpio); unsigned int irq_mask = 1 << get_gpio_index(gpio);
u32 trigger = irqd_get_trigger_type(d); u32 trigger = irqd_get_trigger_type(d);
unsigned long flags;
spin_lock_irqsave(&bank->lock, flags);
if (trigger) if (trigger)
_set_gpio_triggering(bank, get_gpio_index(gpio), trigger); _set_gpio_triggering(bank, get_gpio_index(gpio), trigger);
@ -1173,6 +1173,7 @@ static void gpio_unmask_irq(struct irq_data *d)
} }
_set_gpio_irqenable(bank, gpio, 1); _set_gpio_irqenable(bank, gpio, 1);
spin_unlock_irqrestore(&bank->lock, flags);
} }
static struct irq_chip gpio_irq_chip = { static struct irq_chip gpio_irq_chip = {
@ -1524,7 +1525,7 @@ static void omap_gpio_mod_init(struct gpio_bank *bank, int id)
} }
} }
static void __init omap_gpio_chip_init(struct gpio_bank *bank) static void __devinit omap_gpio_chip_init(struct gpio_bank *bank)
{ {
int j; int j;
static int gpio; static int gpio;

View File

@ -296,7 +296,7 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
* If the TjMax is not plausible, an assumption * If the TjMax is not plausible, an assumption
* will be used * will be used
*/ */
if (val > 80 && val < 120) { if (val) {
dev_info(dev, "TjMax is %d C.\n", val); dev_info(dev, "TjMax is %d C.\n", val);
return val * 1000; return val * 1000;
} }
@ -304,24 +304,9 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
/* /*
* An assumption is made for early CPUs and unreadable MSR. * An assumption is made for early CPUs and unreadable MSR.
* NOTE: the given value may not be correct. * NOTE: the calculated value may not be correct.
*/ */
return adjust_tjmax(c, id, dev);
switch (c->x86_model) {
case 0xe:
case 0xf:
case 0x16:
case 0x1a:
dev_warn(dev, "TjMax is assumed as 100 C!\n");
return 100000;
case 0x17:
case 0x1c: /* Atom CPUs */
return adjust_tjmax(c, id, dev);
default:
dev_warn(dev, "CPU (model=0x%x) is not supported yet,"
" using default TjMax of 100C.\n", c->x86_model);
return 100000;
}
} }
static void __devinit get_ucode_rev_on_cpu(void *edx) static void __devinit get_ucode_rev_on_cpu(void *edx)
@ -341,7 +326,7 @@ static int get_pkg_tjmax(unsigned int cpu, struct device *dev)
err = rdmsr_safe_on_cpu(cpu, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx); err = rdmsr_safe_on_cpu(cpu, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx);
if (!err) { if (!err) {
val = (eax >> 16) & 0xff; val = (eax >> 16) & 0xff;
if (val > 80 && val < 120) if (val)
return val * 1000; return val * 1000;
} }
dev_warn(dev, "Unable to read Pkg-TjMax from CPU:%u\n", cpu); dev_warn(dev, "Unable to read Pkg-TjMax from CPU:%u\n", cpu);

View File

@ -136,15 +136,29 @@ static int max6642_detect(struct i2c_client *client,
if (man_id != 0x4D) if (man_id != 0x4D)
return -ENODEV; return -ENODEV;
/* sanity check */
if (i2c_smbus_read_byte_data(client, 0x04) != 0x4D
|| i2c_smbus_read_byte_data(client, 0x06) != 0x4D
|| i2c_smbus_read_byte_data(client, 0xff) != 0x4D)
return -ENODEV;
/* /*
* We read the config and status register, the 4 lower bits in the * We read the config and status register, the 4 lower bits in the
* config register should be zero and bit 5, 3, 1 and 0 should be * config register should be zero and bit 5, 3, 1 and 0 should be
* zero in the status register. * zero in the status register.
*/ */
reg_config = i2c_smbus_read_byte_data(client, MAX6642_REG_R_CONFIG); reg_config = i2c_smbus_read_byte_data(client, MAX6642_REG_R_CONFIG);
if ((reg_config & 0x0f) != 0x00)
return -ENODEV;
/* in between, another round of sanity checks */
if (i2c_smbus_read_byte_data(client, 0x04) != reg_config
|| i2c_smbus_read_byte_data(client, 0x06) != reg_config
|| i2c_smbus_read_byte_data(client, 0xff) != reg_config)
return -ENODEV;
reg_status = i2c_smbus_read_byte_data(client, MAX6642_REG_R_STATUS); reg_status = i2c_smbus_read_byte_data(client, MAX6642_REG_R_STATUS);
if (((reg_config & 0x0f) != 0x00) || if ((reg_status & 0x2b) != 0x00)
((reg_status & 0x2b) != 0x00))
return -ENODEV; return -ENODEV;
strlcpy(info->type, "max6642", I2C_NAME_SIZE); strlcpy(info->type, "max6642", I2C_NAME_SIZE);
@ -246,7 +260,7 @@ static SENSOR_DEVICE_ATTR_2(temp1_max, S_IWUSR | S_IRUGO, show_temp_max,
set_temp_max, 0, MAX6642_REG_W_LOCAL_HIGH); set_temp_max, 0, MAX6642_REG_W_LOCAL_HIGH);
static SENSOR_DEVICE_ATTR_2(temp2_max, S_IWUSR | S_IRUGO, show_temp_max, static SENSOR_DEVICE_ATTR_2(temp2_max, S_IWUSR | S_IRUGO, show_temp_max,
set_temp_max, 1, MAX6642_REG_W_REMOTE_HIGH); set_temp_max, 1, MAX6642_REG_W_REMOTE_HIGH);
static SENSOR_DEVICE_ATTR(temp_fault, S_IRUGO, show_alarm, NULL, 2); static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_alarm, NULL, 2);
static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 6); static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 6);
static SENSOR_DEVICE_ATTR(temp2_max_alarm, S_IRUGO, show_alarm, NULL, 4); static SENSOR_DEVICE_ATTR(temp2_max_alarm, S_IRUGO, show_alarm, NULL, 4);
@ -256,7 +270,7 @@ static struct attribute *max6642_attributes[] = {
&sensor_dev_attr_temp1_max.dev_attr.attr, &sensor_dev_attr_temp1_max.dev_attr.attr,
&sensor_dev_attr_temp2_max.dev_attr.attr, &sensor_dev_attr_temp2_max.dev_attr.attr,
&sensor_dev_attr_temp_fault.dev_attr.attr, &sensor_dev_attr_temp2_fault.dev_attr.attr,
&sensor_dev_attr_temp1_max_alarm.dev_attr.attr, &sensor_dev_attr_temp1_max_alarm.dev_attr.attr,
&sensor_dev_attr_temp2_max_alarm.dev_attr.attr, &sensor_dev_attr_temp2_max_alarm.dev_attr.attr,
NULL NULL

View File

@ -1782,7 +1782,6 @@ static int ide_cd_probe(ide_drive_t *drive)
ide_cd_read_toc(drive, &sense); ide_cd_read_toc(drive, &sense);
g->fops = &idecd_ops; g->fops = &idecd_ops;
g->flags |= GENHD_FL_REMOVABLE | GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE; g->flags |= GENHD_FL_REMOVABLE | GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE;
g->events = DISK_EVENT_MEDIA_CHANGE;
add_disk(g); add_disk(g);
return 0; return 0;

View File

@ -120,21 +120,17 @@ static void serport_ldisc_close(struct tty_struct *tty)
* 'interrupt' routine. * 'interrupt' routine.
*/ */
static unsigned int serport_ldisc_receive(struct tty_struct *tty, static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count)
const unsigned char *cp, char *fp, int count)
{ {
struct serport *serport = (struct serport*) tty->disc_data; struct serport *serport = (struct serport*) tty->disc_data;
unsigned long flags; unsigned long flags;
unsigned int ch_flags; unsigned int ch_flags;
int ret = 0;
int i; int i;
spin_lock_irqsave(&serport->lock, flags); spin_lock_irqsave(&serport->lock, flags);
if (!test_bit(SERPORT_ACTIVE, &serport->flags)) { if (!test_bit(SERPORT_ACTIVE, &serport->flags))
ret = -EINVAL;
goto out; goto out;
}
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
switch (fp[i]) { switch (fp[i]) {
@ -156,8 +152,6 @@ static unsigned int serport_ldisc_receive(struct tty_struct *tty,
out: out:
spin_unlock_irqrestore(&serport->lock, flags); spin_unlock_irqrestore(&serport->lock, flags);
return ret == 0 ? count : ret;
} }
/* /*

View File

@ -674,7 +674,7 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file,
* cflags buffer containing error flags for received characters (ignored) * cflags buffer containing error flags for received characters (ignored)
* count number of received characters * count number of received characters
*/ */
static unsigned int static void
gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf, gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf,
char *cflags, int count) char *cflags, int count)
{ {
@ -683,12 +683,12 @@ gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf,
struct inbuf_t *inbuf; struct inbuf_t *inbuf;
if (!cs) if (!cs)
return -ENODEV; return;
inbuf = cs->inbuf; inbuf = cs->inbuf;
if (!inbuf) { if (!inbuf) {
dev_err(cs->dev, "%s: no inbuf\n", __func__); dev_err(cs->dev, "%s: no inbuf\n", __func__);
cs_put(cs); cs_put(cs);
return -EINVAL; return;
} }
tail = inbuf->tail; tail = inbuf->tail;
@ -725,8 +725,6 @@ gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf,
gig_dbg(DEBUG_INTR, "%s-->BH", __func__); gig_dbg(DEBUG_INTR, "%s-->BH", __func__);
gigaset_schedule_event(cs); gigaset_schedule_event(cs);
cs_put(cs); cs_put(cs);
return count;
} }
/* /*

View File

@ -304,7 +304,10 @@ static int check_and_rewind_pc(char *put_str, char *arg)
return 1; return 1;
} }
/* Readjust the instruction pointer if needed */ /* Readjust the instruction pointer if needed */
instruction_pointer_set(&kgdbts_regs, ip + offset); ip += offset;
#ifdef GDB_ADJUSTS_BREAK_OFFSET
instruction_pointer_set(&kgdbts_regs, ip);
#endif
return 0; return 0;
} }

View File

@ -747,8 +747,8 @@ static void st_tty_close(struct tty_struct *tty)
pr_debug("%s: done ", __func__); pr_debug("%s: done ", __func__);
} }
static unsigned int st_tty_receive(struct tty_struct *tty, static void st_tty_receive(struct tty_struct *tty, const unsigned char *data,
const unsigned char *data, char *tty_flags, int count) char *tty_flags, int count)
{ {
#ifdef VERBOSE #ifdef VERBOSE
print_hex_dump(KERN_DEBUG, ">in>", DUMP_PREFIX_NONE, print_hex_dump(KERN_DEBUG, ">in>", DUMP_PREFIX_NONE,
@ -761,8 +761,6 @@ static unsigned int st_tty_receive(struct tty_struct *tty,
*/ */
st_recv(tty->disc_data, data, count); st_recv(tty->disc_data, data, count);
pr_debug("done %s", __func__); pr_debug("done %s", __func__);
return count;
} }
/* wake-up function called in from the TTY layer /* wake-up function called in from the TTY layer

View File

@ -185,7 +185,7 @@ static int max_interrupt_work = 10;
static int nopnp; static int nopnp;
#endif #endif
static int el3_common_init(struct net_device *dev); static int __devinit el3_common_init(struct net_device *dev);
static void el3_common_remove(struct net_device *dev); static void el3_common_remove(struct net_device *dev);
static ushort id_read_eeprom(int index); static ushort id_read_eeprom(int index);
static ushort read_eeprom(int ioaddr, int index); static ushort read_eeprom(int ioaddr, int index);
@ -395,7 +395,7 @@ static struct isa_driver el3_isa_driver = {
static int isa_registered; static int isa_registered;
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
static const struct pnp_device_id el3_pnp_ids[] __devinitconst = { static struct pnp_device_id el3_pnp_ids[] = {
{ .id = "TCM5090" }, /* 3Com Etherlink III (TP) */ { .id = "TCM5090" }, /* 3Com Etherlink III (TP) */
{ .id = "TCM5091" }, /* 3Com Etherlink III */ { .id = "TCM5091" }, /* 3Com Etherlink III */
{ .id = "TCM5094" }, /* 3Com Etherlink III (combo) */ { .id = "TCM5094" }, /* 3Com Etherlink III (combo) */
@ -478,7 +478,7 @@ static int pnp_registered;
#endif /* CONFIG_PNP */ #endif /* CONFIG_PNP */
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
static const struct eisa_device_id el3_eisa_ids[] __devinitconst = { static struct eisa_device_id el3_eisa_ids[] = {
{ "TCM5090" }, { "TCM5090" },
{ "TCM5091" }, { "TCM5091" },
{ "TCM5092" }, { "TCM5092" },
@ -508,7 +508,7 @@ static int eisa_registered;
#ifdef CONFIG_MCA #ifdef CONFIG_MCA
static int el3_mca_probe(struct device *dev); static int el3_mca_probe(struct device *dev);
static const short el3_mca_adapter_ids[] __devinitconst = { static short el3_mca_adapter_ids[] __initdata = {
0x627c, 0x627c,
0x627d, 0x627d,
0x62db, 0x62db,
@ -517,7 +517,7 @@ static const short el3_mca_adapter_ids[] __devinitconst = {
0x0000 0x0000
}; };
static const char *const el3_mca_adapter_names[] __devinitconst = { static char *el3_mca_adapter_names[] __initdata = {
"3Com 3c529 EtherLink III (10base2)", "3Com 3c529 EtherLink III (10base2)",
"3Com 3c529 EtherLink III (10baseT)", "3Com 3c529 EtherLink III (10baseT)",
"3Com 3c529 EtherLink III (test mode)", "3Com 3c529 EtherLink III (test mode)",
@ -601,7 +601,7 @@ static void el3_common_remove (struct net_device *dev)
} }
#ifdef CONFIG_MCA #ifdef CONFIG_MCA
static int __devinit el3_mca_probe(struct device *device) static int __init el3_mca_probe(struct device *device)
{ {
/* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch, /* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch,
* heavily modified by Chris Beauregard * heavily modified by Chris Beauregard
@ -671,7 +671,7 @@ static int __devinit el3_mca_probe(struct device *device)
#endif /* CONFIG_MCA */ #endif /* CONFIG_MCA */
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
static int __devinit el3_eisa_probe (struct device *device) static int __init el3_eisa_probe (struct device *device)
{ {
short i; short i;
int ioaddr, irq, if_port; int ioaddr, irq, if_port;

View File

@ -901,14 +901,14 @@ static const struct dev_pm_ops vortex_pm_ops = {
#endif /* !CONFIG_PM */ #endif /* !CONFIG_PM */
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
static const struct eisa_device_id vortex_eisa_ids[] __devinitconst = { static struct eisa_device_id vortex_eisa_ids[] = {
{ "TCM5920", CH_3C592 }, { "TCM5920", CH_3C592 },
{ "TCM5970", CH_3C597 }, { "TCM5970", CH_3C597 },
{ "" } { "" }
}; };
MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids); MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids);
static int __devinit vortex_eisa_probe(struct device *device) static int __init vortex_eisa_probe(struct device *device)
{ {
void __iomem *ioaddr; void __iomem *ioaddr;
struct eisa_device *edev; struct eisa_device *edev;

View File

@ -167,8 +167,8 @@ static inline void debugfs_tx(struct ser_device *ser, const u8 *data, int size)
#endif #endif
static unsigned int ldisc_receive(struct tty_struct *tty, static void ldisc_receive(struct tty_struct *tty, const u8 *data,
const u8 *data, char *flags, int count) char *flags, int count)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct ser_device *ser; struct ser_device *ser;
@ -215,8 +215,6 @@ static unsigned int ldisc_receive(struct tty_struct *tty,
} else } else
++ser->dev->stats.rx_dropped; ++ser->dev->stats.rx_dropped;
update_tty_status(ser); update_tty_status(ser);
return count;
} }
static int handle_tx(struct ser_device *ser) static int handle_tx(struct ser_device *ser)

View File

@ -923,7 +923,7 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
mem_size = resource_size(mem); mem_size = resource_size(mem);
if (!request_mem_region(mem->start, mem_size, pdev->name)) { if (!request_mem_region(mem->start, mem_size, pdev->name)) {
err = -EBUSY; err = -EBUSY;
goto failed_req; goto failed_get;
} }
base = ioremap(mem->start, mem_size); base = ioremap(mem->start, mem_size);
@ -977,9 +977,8 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
iounmap(base); iounmap(base);
failed_map: failed_map:
release_mem_region(mem->start, mem_size); release_mem_region(mem->start, mem_size);
failed_req:
clk_put(clk);
failed_get: failed_get:
clk_put(clk);
failed_clock: failed_clock:
return err; return err;
} }

View File

@ -425,17 +425,16 @@ static void slc_setup(struct net_device *dev)
* in parallel * in parallel
*/ */
static unsigned int slcan_receive_buf(struct tty_struct *tty, static void slcan_receive_buf(struct tty_struct *tty,
const unsigned char *cp, char *fp, int count) const unsigned char *cp, char *fp, int count)
{ {
struct slcan *sl = (struct slcan *) tty->disc_data; struct slcan *sl = (struct slcan *) tty->disc_data;
int bytes = count;
if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev)) if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev))
return -ENODEV; return;
/* Read the characters out of the buffer */ /* Read the characters out of the buffer */
while (bytes--) { while (count--) {
if (fp && *fp++) { if (fp && *fp++) {
if (!test_and_set_bit(SLF_ERROR, &sl->flags)) if (!test_and_set_bit(SLF_ERROR, &sl->flags))
sl->dev->stats.rx_errors++; sl->dev->stats.rx_errors++;
@ -444,8 +443,6 @@ static unsigned int slcan_receive_buf(struct tty_struct *tty,
} }
slcan_unesc(sl, *cp++); slcan_unesc(sl, *cp++);
} }
return count;
} }
/************************************ /************************************

View File

@ -1781,8 +1781,8 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
ndev = alloc_etherdev(sizeof(struct emac_priv)); ndev = alloc_etherdev(sizeof(struct emac_priv));
if (!ndev) { if (!ndev) {
dev_err(&pdev->dev, "error allocating net_device\n"); dev_err(&pdev->dev, "error allocating net_device\n");
clk_put(emac_clk); rc = -ENOMEM;
return -ENOMEM; goto free_clk;
} }
platform_set_drvdata(pdev, ndev); platform_set_drvdata(pdev, ndev);
@ -1796,7 +1796,8 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
pdata = pdev->dev.platform_data; pdata = pdev->dev.platform_data;
if (!pdata) { if (!pdata) {
dev_err(&pdev->dev, "no platform data\n"); dev_err(&pdev->dev, "no platform data\n");
return -ENODEV; rc = -ENODEV;
goto probe_quit;
} }
/* MAC addr and PHY mask , RMII enable info from platform_data */ /* MAC addr and PHY mask , RMII enable info from platform_data */
@ -1929,8 +1930,9 @@ no_dma:
iounmap(priv->remap_addr); iounmap(priv->remap_addr);
probe_quit: probe_quit:
clk_put(emac_clk);
free_netdev(ndev); free_netdev(ndev);
free_clk:
clk_put(emac_clk);
return rc; return rc;
} }

View File

@ -331,18 +331,18 @@ static struct {
"DE422",\ "DE422",\
""} ""}
static const char* const depca_signature[] __devinitconst = DEPCA_SIGNATURE; static char* __initdata depca_signature[] = DEPCA_SIGNATURE;
enum depca_type { enum depca_type {
DEPCA, de100, de101, de200, de201, de202, de210, de212, de422, unknown DEPCA, de100, de101, de200, de201, de202, de210, de212, de422, unknown
}; };
static const char depca_string[] = "depca"; static char depca_string[] = "depca";
static int depca_device_remove (struct device *device); static int depca_device_remove (struct device *device);
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
static const struct eisa_device_id depca_eisa_ids[] __devinitconst = { static struct eisa_device_id depca_eisa_ids[] = {
{ "DEC4220", de422 }, { "DEC4220", de422 },
{ "" } { "" }
}; };
@ -367,19 +367,19 @@ static struct eisa_driver depca_eisa_driver = {
#define DE210_ID 0x628d #define DE210_ID 0x628d
#define DE212_ID 0x6def #define DE212_ID 0x6def
static const short depca_mca_adapter_ids[] __devinitconst = { static short depca_mca_adapter_ids[] = {
DE210_ID, DE210_ID,
DE212_ID, DE212_ID,
0x0000 0x0000
}; };
static const char *depca_mca_adapter_name[] = { static char *depca_mca_adapter_name[] = {
"DEC EtherWORKS MC Adapter (DE210)", "DEC EtherWORKS MC Adapter (DE210)",
"DEC EtherWORKS MC Adapter (DE212)", "DEC EtherWORKS MC Adapter (DE212)",
NULL NULL
}; };
static const enum depca_type depca_mca_adapter_type[] = { static enum depca_type depca_mca_adapter_type[] = {
de210, de210,
de212, de212,
0 0
@ -541,9 +541,10 @@ static void SetMulticastFilter(struct net_device *dev);
static int load_packet(struct net_device *dev, struct sk_buff *skb); static int load_packet(struct net_device *dev, struct sk_buff *skb);
static void depca_dbg_open(struct net_device *dev); static void depca_dbg_open(struct net_device *dev);
static const u_char de1xx_irq[] __devinitconst = { 2, 3, 4, 5, 7, 9, 0 }; static u_char de1xx_irq[] __initdata = { 2, 3, 4, 5, 7, 9, 0 };
static const u_char de2xx_irq[] __devinitconst = { 5, 9, 10, 11, 15, 0 }; static u_char de2xx_irq[] __initdata = { 5, 9, 10, 11, 15, 0 };
static const u_char de422_irq[] __devinitconst = { 5, 9, 10, 11, 0 }; static u_char de422_irq[] __initdata = { 5, 9, 10, 11, 0 };
static u_char *depca_irq;
static int irq; static int irq;
static int io; static int io;
@ -579,7 +580,7 @@ static const struct net_device_ops depca_netdev_ops = {
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
}; };
static int __devinit depca_hw_init (struct net_device *dev, struct device *device) static int __init depca_hw_init (struct net_device *dev, struct device *device)
{ {
struct depca_private *lp; struct depca_private *lp;
int i, j, offset, netRAM, mem_len, status = 0; int i, j, offset, netRAM, mem_len, status = 0;
@ -747,7 +748,6 @@ static int __devinit depca_hw_init (struct net_device *dev, struct device *devic
if (dev->irq < 2) { if (dev->irq < 2) {
unsigned char irqnum; unsigned char irqnum;
unsigned long irq_mask, delay; unsigned long irq_mask, delay;
const u_char *depca_irq;
irq_mask = probe_irq_on(); irq_mask = probe_irq_on();
@ -770,7 +770,6 @@ static int __devinit depca_hw_init (struct net_device *dev, struct device *devic
break; break;
default: default:
depca_irq = NULL;
break; /* Not reached */ break; /* Not reached */
} }
@ -1303,7 +1302,7 @@ static void SetMulticastFilter(struct net_device *dev)
} }
} }
static int __devinit depca_common_init (u_long ioaddr, struct net_device **devp) static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
{ {
int status = 0; int status = 0;
@ -1334,7 +1333,7 @@ static int __devinit depca_common_init (u_long ioaddr, struct net_device **devp)
/* /*
** Microchannel bus I/O device probe ** Microchannel bus I/O device probe
*/ */
static int __devinit depca_mca_probe(struct device *device) static int __init depca_mca_probe(struct device *device)
{ {
unsigned char pos[2]; unsigned char pos[2];
unsigned char where; unsigned char where;
@ -1458,7 +1457,7 @@ static int __devinit depca_mca_probe(struct device *device)
** ISA bus I/O device probe ** ISA bus I/O device probe
*/ */
static void __devinit depca_platform_probe (void) static void __init depca_platform_probe (void)
{ {
int i; int i;
struct platform_device *pldev; struct platform_device *pldev;
@ -1498,7 +1497,7 @@ static void __devinit depca_platform_probe (void)
} }
} }
static enum depca_type __devinit depca_shmem_probe (ulong *mem_start) static enum depca_type __init depca_shmem_probe (ulong *mem_start)
{ {
u_long mem_base[] = DEPCA_RAM_BASE_ADDRESSES; u_long mem_base[] = DEPCA_RAM_BASE_ADDRESSES;
enum depca_type adapter = unknown; enum depca_type adapter = unknown;
@ -1559,7 +1558,7 @@ static int __devinit depca_isa_probe (struct platform_device *device)
*/ */
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
static int __devinit depca_eisa_probe (struct device *device) static int __init depca_eisa_probe (struct device *device)
{ {
enum depca_type adapter = unknown; enum depca_type adapter = unknown;
struct eisa_device *edev; struct eisa_device *edev;
@ -1630,7 +1629,7 @@ static int __devexit depca_device_remove (struct device *device)
** and Boot (readb) ROM. This will also give us a clue to the network RAM ** and Boot (readb) ROM. This will also give us a clue to the network RAM
** base address. ** base address.
*/ */
static int __devinit DepcaSignature(char *name, u_long base_addr) static int __init DepcaSignature(char *name, u_long base_addr)
{ {
u_int i, j, k; u_int i, j, k;
void __iomem *ptr; void __iomem *ptr;

View File

@ -1157,9 +1157,6 @@ dm9000_open(struct net_device *dev)
irqflags |= IRQF_SHARED; irqflags |= IRQF_SHARED;
if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
return -EAGAIN;
/* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */ /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
mdelay(1); /* delay needs by DM9000B */ mdelay(1); /* delay needs by DM9000B */
@ -1168,6 +1165,9 @@ dm9000_open(struct net_device *dev)
dm9000_reset(db); dm9000_reset(db);
dm9000_init_dm9000(dev); dm9000_init_dm9000(dev);
if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
return -EAGAIN;
/* Init driver variable */ /* Init driver variable */
db->dbug_cnt = 0; db->dbug_cnt = 0;

View File

@ -456,7 +456,7 @@ out:
* a block of 6pack data has been received, which can now be decapsulated * a block of 6pack data has been received, which can now be decapsulated
* and sent on to some IP layer for further processing. * and sent on to some IP layer for further processing.
*/ */
static unsigned int sixpack_receive_buf(struct tty_struct *tty, static void sixpack_receive_buf(struct tty_struct *tty,
const unsigned char *cp, char *fp, int count) const unsigned char *cp, char *fp, int count)
{ {
struct sixpack *sp; struct sixpack *sp;
@ -464,11 +464,11 @@ static unsigned int sixpack_receive_buf(struct tty_struct *tty,
int count1; int count1;
if (!count) if (!count)
return 0; return;
sp = sp_get(tty); sp = sp_get(tty);
if (!sp) if (!sp)
return -ENODEV; return;
memcpy(buf, cp, count < sizeof(buf) ? count : sizeof(buf)); memcpy(buf, cp, count < sizeof(buf) ? count : sizeof(buf));
@ -487,8 +487,6 @@ static unsigned int sixpack_receive_buf(struct tty_struct *tty,
sp_put(sp); sp_put(sp);
tty_unthrottle(tty); tty_unthrottle(tty);
return count1;
} }
/* /*

View File

@ -923,14 +923,13 @@ static long mkiss_compat_ioctl(struct tty_struct *tty, struct file *file,
* a block of data has been received, which can now be decapsulated * a block of data has been received, which can now be decapsulated
* and sent on to the AX.25 layer for further processing. * and sent on to the AX.25 layer for further processing.
*/ */
static unsigned int mkiss_receive_buf(struct tty_struct *tty, static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp,
const unsigned char *cp, char *fp, int count) char *fp, int count)
{ {
struct mkiss *ax = mkiss_get(tty); struct mkiss *ax = mkiss_get(tty);
int bytes = count;
if (!ax) if (!ax)
return -ENODEV; return;
/* /*
* Argh! mtu change time! - costs us the packet part received * Argh! mtu change time! - costs us the packet part received
@ -940,7 +939,7 @@ static unsigned int mkiss_receive_buf(struct tty_struct *tty,
ax_changedmtu(ax); ax_changedmtu(ax);
/* Read the characters out of the buffer */ /* Read the characters out of the buffer */
while (bytes--) { while (count--) {
if (fp != NULL && *fp++) { if (fp != NULL && *fp++) {
if (!test_and_set_bit(AXF_ERROR, &ax->flags)) if (!test_and_set_bit(AXF_ERROR, &ax->flags))
ax->dev->stats.rx_errors++; ax->dev->stats.rx_errors++;
@ -953,8 +952,6 @@ static unsigned int mkiss_receive_buf(struct tty_struct *tty,
mkiss_put(ax); mkiss_put(ax);
tty_unthrottle(tty); tty_unthrottle(tty);
return count;
} }
/* /*

View File

@ -188,14 +188,14 @@ struct hp100_private {
* variables * variables
*/ */
#ifdef CONFIG_ISA #ifdef CONFIG_ISA
static const char *const hp100_isa_tbl[] __devinitconst = { static const char *hp100_isa_tbl[] = {
"HWPF150", /* HP J2573 rev A */ "HWPF150", /* HP J2573 rev A */
"HWP1950", /* HP J2573 */ "HWP1950", /* HP J2573 */
}; };
#endif #endif
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
static const struct eisa_device_id hp100_eisa_tbl[] __devinitconst = { static struct eisa_device_id hp100_eisa_tbl[] = {
{ "HWPF180" }, /* HP J2577 rev A */ { "HWPF180" }, /* HP J2577 rev A */
{ "HWP1920" }, /* HP 27248B */ { "HWP1920" }, /* HP 27248B */
{ "HWP1940" }, /* HP J2577 */ { "HWP1940" }, /* HP J2577 */
@ -336,7 +336,7 @@ static __devinit const char *hp100_read_id(int ioaddr)
} }
#ifdef CONFIG_ISA #ifdef CONFIG_ISA
static __devinit int hp100_isa_probe1(struct net_device *dev, int ioaddr) static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr)
{ {
const char *sig; const char *sig;
int i; int i;
@ -372,7 +372,7 @@ static __devinit int hp100_isa_probe1(struct net_device *dev, int ioaddr)
* EISA and PCI are handled by device infrastructure. * EISA and PCI are handled by device infrastructure.
*/ */
static int __devinit hp100_isa_probe(struct net_device *dev, int addr) static int __init hp100_isa_probe(struct net_device *dev, int addr)
{ {
int err = -ENODEV; int err = -ENODEV;
@ -396,7 +396,7 @@ static int __devinit hp100_isa_probe(struct net_device *dev, int addr)
#endif /* CONFIG_ISA */ #endif /* CONFIG_ISA */
#if !defined(MODULE) && defined(CONFIG_ISA) #if !defined(MODULE) && defined(CONFIG_ISA)
struct net_device * __devinit hp100_probe(int unit) struct net_device * __init hp100_probe(int unit)
{ {
struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
int err; int err;
@ -2843,7 +2843,7 @@ static void cleanup_dev(struct net_device *d)
} }
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
static int __devinit hp100_eisa_probe (struct device *gendev) static int __init hp100_eisa_probe (struct device *gendev)
{ {
struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
struct eisa_device *edev = to_eisa_device(gendev); struct eisa_device *edev = to_eisa_device(gendev);

View File

@ -895,12 +895,12 @@ static int ibmlana_irq;
static int ibmlana_io; static int ibmlana_io;
static int startslot; /* counts through slots when probing multiple devices */ static int startslot; /* counts through slots when probing multiple devices */
static const short ibmlana_adapter_ids[] __devinitconst = { static short ibmlana_adapter_ids[] __initdata = {
IBM_LANA_ID, IBM_LANA_ID,
0x0000 0x0000
}; };
static const char *const ibmlana_adapter_names[] __devinitconst = { static char *ibmlana_adapter_names[] __devinitdata = {
"IBM LAN Adapter/A", "IBM LAN Adapter/A",
NULL NULL
}; };

View File

@ -216,23 +216,23 @@ static int irtty_do_write(struct sir_dev *dev, const unsigned char *ptr, size_t
* usbserial: urb-complete-interrupt / softint * usbserial: urb-complete-interrupt / softint
*/ */
static unsigned int irtty_receive_buf(struct tty_struct *tty, static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
const unsigned char *cp, char *fp, int count) char *fp, int count)
{ {
struct sir_dev *dev; struct sir_dev *dev;
struct sirtty_cb *priv = tty->disc_data; struct sirtty_cb *priv = tty->disc_data;
int i; int i;
IRDA_ASSERT(priv != NULL, return -ENODEV;); IRDA_ASSERT(priv != NULL, return;);
IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -EINVAL;); IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return;);
if (unlikely(count==0)) /* yes, this happens */ if (unlikely(count==0)) /* yes, this happens */
return 0; return;
dev = priv->dev; dev = priv->dev;
if (!dev) { if (!dev) {
IRDA_WARNING("%s(), not ready yet!\n", __func__); IRDA_WARNING("%s(), not ready yet!\n", __func__);
return -ENODEV; return;
} }
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
@ -242,13 +242,11 @@ static unsigned int irtty_receive_buf(struct tty_struct *tty,
if (fp && *fp++) { if (fp && *fp++) {
IRDA_DEBUG(0, "Framing or parity error!\n"); IRDA_DEBUG(0, "Framing or parity error!\n");
sirdev_receive(dev, NULL, 0); /* notify sir_dev (updating stats) */ sirdev_receive(dev, NULL, 0); /* notify sir_dev (updating stats) */
return -EINVAL; return;
} }
} }
sirdev_receive(dev, cp, count); sirdev_receive(dev, cp, count);
return count;
} }
/* /*

View File

@ -222,19 +222,19 @@ static void smsc_ircc_set_transceiver_for_speed(struct smsc_ircc_cb *self, u32 s
static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self); static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self);
/* Probing */ /* Probing */
static int smsc_ircc_look_for_chips(void); static int __init smsc_ircc_look_for_chips(void);
static const struct smsc_chip * smsc_ircc_probe(unsigned short cfg_base, u8 reg, const struct smsc_chip *chip, char *type); static const struct smsc_chip * __init smsc_ircc_probe(unsigned short cfg_base, u8 reg, const struct smsc_chip *chip, char *type);
static int smsc_superio_flat(const struct smsc_chip *chips, unsigned short cfg_base, char *type); static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned short cfg_base, char *type);
static int smsc_superio_paged(const struct smsc_chip *chips, unsigned short cfg_base, char *type); static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned short cfg_base, char *type);
static int smsc_superio_fdc(unsigned short cfg_base); static int __init smsc_superio_fdc(unsigned short cfg_base);
static int smsc_superio_lpc(unsigned short cfg_base); static int __init smsc_superio_lpc(unsigned short cfg_base);
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static int preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf); static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf);
static int preconfigure_through_82801(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); static int __init preconfigure_through_82801(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf);
static void preconfigure_ali_port(struct pci_dev *dev, static void __init preconfigure_ali_port(struct pci_dev *dev,
unsigned short port); unsigned short port);
static int preconfigure_through_ali(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); static int __init preconfigure_through_ali(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf);
static int smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
unsigned short ircc_fir, unsigned short ircc_fir,
unsigned short ircc_sir, unsigned short ircc_sir,
unsigned char ircc_dma, unsigned char ircc_dma,
@ -366,7 +366,7 @@ static inline void register_bank(int iobase, int bank)
} }
/* PNP hotplug support */ /* PNP hotplug support */
static const struct pnp_device_id smsc_ircc_pnp_table[] __devinitconst = { static const struct pnp_device_id smsc_ircc_pnp_table[] = {
{ .id = "SMCf010", .driver_data = 0 }, { .id = "SMCf010", .driver_data = 0 },
/* and presumably others */ /* and presumably others */
{ } { }
@ -515,7 +515,7 @@ static const struct net_device_ops smsc_ircc_netdev_ops = {
* Try to open driver instance * Try to open driver instance
* *
*/ */
static int __devinit smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq)
{ {
struct smsc_ircc_cb *self; struct smsc_ircc_cb *self;
struct net_device *dev; struct net_device *dev;
@ -2273,7 +2273,7 @@ static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned sho
} }
static int __devinit smsc_access(unsigned short cfg_base, unsigned char reg) static int __init smsc_access(unsigned short cfg_base, unsigned char reg)
{ {
IRDA_DEBUG(1, "%s\n", __func__); IRDA_DEBUG(1, "%s\n", __func__);
@ -2281,7 +2281,7 @@ static int __devinit smsc_access(unsigned short cfg_base, unsigned char reg)
return inb(cfg_base) != reg ? -1 : 0; return inb(cfg_base) != reg ? -1 : 0;
} }
static const struct smsc_chip * __devinit smsc_ircc_probe(unsigned short cfg_base, u8 reg, const struct smsc_chip *chip, char *type) static const struct smsc_chip * __init smsc_ircc_probe(unsigned short cfg_base, u8 reg, const struct smsc_chip *chip, char *type)
{ {
u8 devid, xdevid, rev; u8 devid, xdevid, rev;
@ -2406,7 +2406,7 @@ static int __init smsc_superio_lpc(unsigned short cfg_base)
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
#define PCIID_VENDOR_INTEL 0x8086 #define PCIID_VENDOR_INTEL 0x8086
#define PCIID_VENDOR_ALI 0x10b9 #define PCIID_VENDOR_ALI 0x10b9
static const struct smsc_ircc_subsystem_configuration subsystem_configurations[] __devinitconst = { static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __initdata = {
/* /*
* Subsystems needing entries: * Subsystems needing entries:
* 0x10b9:0x1533 0x103c:0x0850 HP nx9010 family * 0x10b9:0x1533 0x103c:0x0850 HP nx9010 family
@ -2532,7 +2532,7 @@ static const struct smsc_ircc_subsystem_configuration subsystem_configurations[]
* (FIR port, SIR port, FIR DMA, FIR IRQ) * (FIR port, SIR port, FIR DMA, FIR IRQ)
* through the chip configuration port. * through the chip configuration port.
*/ */
static int __devinit preconfigure_smsc_chip(struct static int __init preconfigure_smsc_chip(struct
smsc_ircc_subsystem_configuration smsc_ircc_subsystem_configuration
*conf) *conf)
{ {
@ -2633,7 +2633,7 @@ static int __devinit preconfigure_smsc_chip(struct
* or Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge. * or Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge.
* They all work the same way! * They all work the same way!
*/ */
static int __devinit preconfigure_through_82801(struct pci_dev *dev, static int __init preconfigure_through_82801(struct pci_dev *dev,
struct struct
smsc_ircc_subsystem_configuration smsc_ircc_subsystem_configuration
*conf) *conf)
@ -2786,7 +2786,7 @@ static int __devinit preconfigure_through_82801(struct pci_dev *dev,
* This is based on reverse-engineering since ALi does not * This is based on reverse-engineering since ALi does not
* provide any data sheet for the 1533 chip. * provide any data sheet for the 1533 chip.
*/ */
static void __devinit preconfigure_ali_port(struct pci_dev *dev, static void __init preconfigure_ali_port(struct pci_dev *dev,
unsigned short port) unsigned short port)
{ {
unsigned char reg; unsigned char reg;
@ -2824,7 +2824,7 @@ static void __devinit preconfigure_ali_port(struct pci_dev *dev,
IRDA_MESSAGE("Activated ALi 1533 ISA bridge port 0x%04x.\n", port); IRDA_MESSAGE("Activated ALi 1533 ISA bridge port 0x%04x.\n", port);
} }
static int __devinit preconfigure_through_ali(struct pci_dev *dev, static int __init preconfigure_through_ali(struct pci_dev *dev,
struct struct
smsc_ircc_subsystem_configuration smsc_ircc_subsystem_configuration
*conf) *conf)
@ -2837,7 +2837,7 @@ static int __devinit preconfigure_through_ali(struct pci_dev *dev,
return preconfigure_smsc_chip(conf); return preconfigure_smsc_chip(conf);
} }
static int __devinit smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
unsigned short ircc_fir, unsigned short ircc_fir,
unsigned short ircc_sir, unsigned short ircc_sir,
unsigned char ircc_dma, unsigned char ircc_dma,
@ -2849,7 +2849,7 @@ static int __devinit smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
int ret = 0; int ret = 0;
for_each_pci_dev(dev) { for_each_pci_dev(dev) {
const struct smsc_ircc_subsystem_configuration *conf; struct smsc_ircc_subsystem_configuration *conf;
/* /*
* Cache the subsystem vendor/device: * Cache the subsystem vendor/device:

View File

@ -661,7 +661,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
/* check the status */ /* check the status */
if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) { if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len); struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 3);
if (skb) { if (skb) {

View File

@ -80,20 +80,17 @@ static void ne3210_block_output(struct net_device *dev, int count, const unsigne
#define NE3210_DEBUG 0x0 #define NE3210_DEBUG 0x0
static const unsigned char irq_map[] __devinitconst = static unsigned char irq_map[] __initdata = {15, 12, 11, 10, 9, 7, 5, 3};
{ 15, 12, 11, 10, 9, 7, 5, 3 }; static unsigned int shmem_map[] __initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0};
static const unsigned int shmem_map[] __devinitconst = static const char *ifmap[] __initdata = {"UTP", "?", "BNC", "AUI"};
{ 0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0 }; static int ifmap_val[] __initdata = {
static const char *const ifmap[] __devinitconst =
{ "UTP", "?", "BNC", "AUI" };
static const int ifmap_val[] __devinitconst = {
IF_PORT_10BASET, IF_PORT_10BASET,
IF_PORT_UNKNOWN, IF_PORT_UNKNOWN,
IF_PORT_10BASE2, IF_PORT_10BASE2,
IF_PORT_AUI, IF_PORT_AUI,
}; };
static int __devinit ne3210_eisa_probe (struct device *device) static int __init ne3210_eisa_probe (struct device *device)
{ {
unsigned long ioaddr, phys_mem; unsigned long ioaddr, phys_mem;
int i, retval, port_index; int i, retval, port_index;
@ -316,7 +313,7 @@ static void ne3210_block_output(struct net_device *dev, int count,
memcpy_toio(shmem, buf, count); memcpy_toio(shmem, buf, count);
} }
static const struct eisa_device_id ne3210_ids[] __devinitconst = { static struct eisa_device_id ne3210_ids[] = {
{ "EGL0101" }, { "EGL0101" },
{ "NVL1801" }, { "NVL1801" },
{ "" }, { "" },

View File

@ -340,7 +340,7 @@ ppp_asynctty_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
} }
/* May sleep, don't call from interrupt level or with interrupts disabled */ /* May sleep, don't call from interrupt level or with interrupts disabled */
static unsigned int static void
ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
char *cflags, int count) char *cflags, int count)
{ {
@ -348,7 +348,7 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
unsigned long flags; unsigned long flags;
if (!ap) if (!ap)
return -ENODEV; return;
spin_lock_irqsave(&ap->recv_lock, flags); spin_lock_irqsave(&ap->recv_lock, flags);
ppp_async_input(ap, buf, cflags, count); ppp_async_input(ap, buf, cflags, count);
spin_unlock_irqrestore(&ap->recv_lock, flags); spin_unlock_irqrestore(&ap->recv_lock, flags);
@ -356,8 +356,6 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
tasklet_schedule(&ap->tsk); tasklet_schedule(&ap->tsk);
ap_put(ap); ap_put(ap);
tty_unthrottle(tty); tty_unthrottle(tty);
return count;
} }
static void static void

View File

@ -381,7 +381,7 @@ ppp_sync_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
} }
/* May sleep, don't call from interrupt level or with interrupts disabled */ /* May sleep, don't call from interrupt level or with interrupts disabled */
static unsigned int static void
ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
char *cflags, int count) char *cflags, int count)
{ {
@ -389,7 +389,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
unsigned long flags; unsigned long flags;
if (!ap) if (!ap)
return -ENODEV; return;
spin_lock_irqsave(&ap->recv_lock, flags); spin_lock_irqsave(&ap->recv_lock, flags);
ppp_sync_input(ap, buf, cflags, count); ppp_sync_input(ap, buf, cflags, count);
spin_unlock_irqrestore(&ap->recv_lock, flags); spin_unlock_irqrestore(&ap->recv_lock, flags);
@ -397,8 +397,6 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
tasklet_schedule(&ap->tsk); tasklet_schedule(&ap->tsk);
sp_put(ap); sp_put(ap);
tty_unthrottle(tty); tty_unthrottle(tty);
return count;
} }
static void static void

View File

@ -670,17 +670,16 @@ static void sl_setup(struct net_device *dev)
* in parallel * in parallel
*/ */
static unsigned int slip_receive_buf(struct tty_struct *tty, static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
const unsigned char *cp, char *fp, int count) char *fp, int count)
{ {
struct slip *sl = tty->disc_data; struct slip *sl = tty->disc_data;
int bytes = count;
if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev))
return -ENODEV; return;
/* Read the characters out of the buffer */ /* Read the characters out of the buffer */
while (bytes--) { while (count--) {
if (fp && *fp++) { if (fp && *fp++) {
if (!test_and_set_bit(SLF_ERROR, &sl->flags)) if (!test_and_set_bit(SLF_ERROR, &sl->flags))
sl->dev->stats.rx_errors++; sl->dev->stats.rx_errors++;
@ -694,8 +693,6 @@ static unsigned int slip_receive_buf(struct tty_struct *tty,
#endif #endif
slip_unesc(sl, *cp++); slip_unesc(sl, *cp++);
} }
return count;
} }
/************************************ /************************************

View File

@ -156,7 +156,7 @@ static const struct {
{ 14, 15 } { 14, 15 }
}; };
static const short smc_mca_adapter_ids[] __devinitconst = { static short smc_mca_adapter_ids[] __initdata = {
0x61c8, 0x61c8,
0x61c9, 0x61c9,
0x6fc0, 0x6fc0,
@ -168,7 +168,7 @@ static const short smc_mca_adapter_ids[] __devinitconst = {
0x0000 0x0000
}; };
static const char *const smc_mca_adapter_names[] __devinitconst = { static char *smc_mca_adapter_names[] __initdata = {
"SMC Ethercard PLUS Elite/A BNC/AUI (WD8013EP/A)", "SMC Ethercard PLUS Elite/A BNC/AUI (WD8013EP/A)",
"SMC Ethercard PLUS Elite/A UTP/AUI (WD8013WP/A)", "SMC Ethercard PLUS Elite/A UTP/AUI (WD8013WP/A)",
"WD Ethercard PLUS/A (WD8003E/A or WD8003ET/A)", "WD Ethercard PLUS/A (WD8003E/A or WD8003ET/A)",
@ -199,7 +199,7 @@ static const struct net_device_ops ultramca_netdev_ops = {
#endif #endif
}; };
static int __devinit ultramca_probe(struct device *gen_dev) static int __init ultramca_probe(struct device *gen_dev)
{ {
unsigned short ioaddr; unsigned short ioaddr;
struct net_device *dev; struct net_device *dev;

View File

@ -5774,7 +5774,7 @@ static void tg3_skb_error_unmap(struct tg3_napi *tnapi,
dma_unmap_addr(txb, mapping), dma_unmap_addr(txb, mapping),
skb_headlen(skb), skb_headlen(skb),
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
for (i = 0; i <= last; i++) { for (i = 0; i < last; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
entry = NEXT_TX(entry); entry = NEXT_TX(entry);

View File

@ -727,7 +727,7 @@ static int __devexit madgemc_remove(struct device *device)
return 0; return 0;
} }
static const short madgemc_adapter_ids[] __devinitconst = { static short madgemc_adapter_ids[] __initdata = {
0x002d, 0x002d,
0x0000 0x0000
}; };

View File

@ -1995,7 +1995,7 @@ SetMulticastFilter(struct net_device *dev)
static u_char de4x5_irq[] = EISA_ALLOWED_IRQ_LIST; static u_char de4x5_irq[] = EISA_ALLOWED_IRQ_LIST;
static int __devinit de4x5_eisa_probe (struct device *gendev) static int __init de4x5_eisa_probe (struct device *gendev)
{ {
struct eisa_device *edev; struct eisa_device *edev;
u_long iobase; u_long iobase;
@ -2097,7 +2097,7 @@ static int __devexit de4x5_eisa_remove (struct device *device)
return 0; return 0;
} }
static const struct eisa_device_id de4x5_eisa_ids[] __devinitconst = { static struct eisa_device_id de4x5_eisa_ids[] = {
{ "DEC4250", 0 }, /* 0 is the board name index... */ { "DEC4250", 0 }, /* 0 is the board name index... */
{ "" } { "" }
}; };

View File

@ -495,7 +495,7 @@ static void catc_ctrl_run(struct catc *catc)
if (!q->dir && q->buf && q->len) if (!q->dir && q->buf && q->len)
memcpy(catc->ctrl_buf, q->buf, q->len); memcpy(catc->ctrl_buf, q->buf, q->len);
if ((status = usb_submit_urb(catc->ctrl_urb, GFP_KERNEL))) if ((status = usb_submit_urb(catc->ctrl_urb, GFP_ATOMIC)))
err("submit(ctrl_urb) status %d", status); err("submit(ctrl_urb) status %d", status);
} }

View File

@ -54,7 +54,7 @@
#include <linux/usb/usbnet.h> #include <linux/usb/usbnet.h>
#include <linux/usb/cdc.h> #include <linux/usb/cdc.h>
#define DRIVER_VERSION "24-May-2011" #define DRIVER_VERSION "01-June-2011"
/* CDC NCM subclass 3.2.1 */ /* CDC NCM subclass 3.2.1 */
#define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10
@ -1234,6 +1234,7 @@ static struct usb_driver cdc_ncm_driver = {
.disconnect = cdc_ncm_disconnect, .disconnect = cdc_ncm_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.reset_resume = usbnet_resume,
.supports_autosuspend = 1, .supports_autosuspend = 1,
}; };

View File

@ -609,7 +609,7 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
* before it gets out of hand. Naturally, this wastes entries. */ * before it gets out of hand. Naturally, this wastes entries. */
if (capacity < 2+MAX_SKB_FRAGS) { if (capacity < 2+MAX_SKB_FRAGS) {
netif_stop_queue(dev); netif_stop_queue(dev);
if (unlikely(!virtqueue_enable_cb(vi->svq))) { if (unlikely(!virtqueue_enable_cb_delayed(vi->svq))) {
/* More just got used, free them then recheck. */ /* More just got used, free them then recheck. */
capacity += free_old_xmit_skbs(vi); capacity += free_old_xmit_skbs(vi);
if (capacity >= 2+MAX_SKB_FRAGS) { if (capacity >= 2+MAX_SKB_FRAGS) {

View File

@ -517,18 +517,17 @@ static int x25_asy_close(struct net_device *dev)
* and sent on to some IP layer for further processing. * and sent on to some IP layer for further processing.
*/ */
static unsigned int x25_asy_receive_buf(struct tty_struct *tty, static void x25_asy_receive_buf(struct tty_struct *tty,
const unsigned char *cp, char *fp, int count) const unsigned char *cp, char *fp, int count)
{ {
struct x25_asy *sl = tty->disc_data; struct x25_asy *sl = tty->disc_data;
int bytes = count;
if (!sl || sl->magic != X25_ASY_MAGIC || !netif_running(sl->dev)) if (!sl || sl->magic != X25_ASY_MAGIC || !netif_running(sl->dev))
return; return;
/* Read the characters out of the buffer */ /* Read the characters out of the buffer */
while (bytes--) { while (count--) {
if (fp && *fp++) { if (fp && *fp++) {
if (!test_and_set_bit(SLF_ERROR, &sl->flags)) if (!test_and_set_bit(SLF_ERROR, &sl->flags))
sl->dev->stats.rx_errors++; sl->dev->stats.rx_errors++;
@ -537,8 +536,6 @@ static unsigned int x25_asy_receive_buf(struct tty_struct *tty,
} }
x25_asy_unesc(sl, *cp++); x25_asy_unesc(sl, *cp++);
} }
return count;
} }
/* /*

View File

@ -26,7 +26,6 @@ config ATH9K
config ATH9K_PCI config ATH9K_PCI
bool "Atheros ath9k PCI/PCIe bus support" bool "Atheros ath9k PCI/PCIe bus support"
depends on ATH9K && PCI depends on ATH9K && PCI
default PCI
---help--- ---help---
This option enables the PCI bus support in ath9k. This option enables the PCI bus support in ath9k.

View File

@ -829,7 +829,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
if (AR_SREV_9271(ah)) { if (AR_SREV_9271(ah)) {
if (!ar9285_hw_cl_cal(ah, chan)) if (!ar9285_hw_cl_cal(ah, chan))
return false; return false;
} else if (AR_SREV_9285_12_OR_LATER(ah)) { } else if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) {
if (!ar9285_hw_clc(ah, chan)) if (!ar9285_hw_clc(ah, chan))
return false; return false;
} else { } else {

View File

@ -4645,10 +4645,16 @@ static void ar9003_hw_set_power_per_rate_table(struct ath_hw *ah,
case 1: case 1:
break; break;
case 2: case 2:
scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN)
scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
else
scaledPower = 0;
break; break;
case 3: case 3:
scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN)
scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
else
scaledPower = 0;
break; break;
} }

View File

@ -1381,3 +1381,25 @@ void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah)
"==== BB update: done ====\n\n"); "==== BB update: done ====\n\n");
} }
EXPORT_SYMBOL(ar9003_hw_bb_watchdog_dbg_info); EXPORT_SYMBOL(ar9003_hw_bb_watchdog_dbg_info);
void ar9003_hw_disable_phy_restart(struct ath_hw *ah)
{
u32 val;
/* While receiving unsupported rate frame rx state machine
* gets into a state 0xb and if phy_restart happens in that
* state, BB would go hang. If RXSM is in 0xb state after
* first bb panic, ensure to disable the phy_restart.
*/
if (!((MS(ah->bb_watchdog_last_status,
AR_PHY_WATCHDOG_RX_OFDM_SM) == 0xb) ||
ah->bb_hang_rx_ofdm))
return;
ah->bb_hang_rx_ofdm = true;
val = REG_READ(ah, AR_PHY_RESTART);
val &= ~AR_PHY_RESTART_ENA;
REG_WRITE(ah, AR_PHY_RESTART, val);
}
EXPORT_SYMBOL(ar9003_hw_disable_phy_restart);

View File

@ -524,10 +524,16 @@ static void ath9k_hw_set_ar9287_power_per_rate_table(struct ath_hw *ah,
case 1: case 1:
break; break;
case 2: case 2:
scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN)
scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
else
scaledPower = 0;
break; break;
case 3: case 3:
scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN)
scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
else
scaledPower = 0;
break; break;
} }
scaledPower = max((u16)0, scaledPower); scaledPower = max((u16)0, scaledPower);

View File

@ -1555,9 +1555,12 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
if (ah->btcoex_hw.enabled) if (ah->btcoex_hw.enabled)
ath9k_hw_btcoex_enable(ah); ath9k_hw_btcoex_enable(ah);
if (AR_SREV_9300_20_OR_LATER(ah)) if (AR_SREV_9300_20_OR_LATER(ah)) {
ar9003_hw_bb_watchdog_config(ah); ar9003_hw_bb_watchdog_config(ah);
ar9003_hw_disable_phy_restart(ah);
}
ath9k_hw_apply_gpio_override(ah); ath9k_hw_apply_gpio_override(ah);
return 0; return 0;

View File

@ -842,6 +842,7 @@ struct ath_hw {
u32 bb_watchdog_last_status; u32 bb_watchdog_last_status;
u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */ u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */
u8 bb_hang_rx_ofdm; /* true if bb hang due to rx_ofdm */
unsigned int paprd_target_power; unsigned int paprd_target_power;
unsigned int paprd_training_power; unsigned int paprd_training_power;
@ -990,6 +991,7 @@ void ar9002_hw_enable_wep_aggregation(struct ath_hw *ah);
void ar9003_hw_bb_watchdog_config(struct ath_hw *ah); void ar9003_hw_bb_watchdog_config(struct ath_hw *ah);
void ar9003_hw_bb_watchdog_read(struct ath_hw *ah); void ar9003_hw_bb_watchdog_read(struct ath_hw *ah);
void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah); void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah);
void ar9003_hw_disable_phy_restart(struct ath_hw *ah);
void ar9003_paprd_enable(struct ath_hw *ah, bool val); void ar9003_paprd_enable(struct ath_hw *ah, bool val);
void ar9003_paprd_populate_single_table(struct ath_hw *ah, void ar9003_paprd_populate_single_table(struct ath_hw *ah,
struct ath9k_hw_cal_data *caldata, struct ath9k_hw_cal_data *caldata,

View File

@ -670,7 +670,8 @@ void ath9k_tasklet(unsigned long data)
u32 status = sc->intrstatus; u32 status = sc->intrstatus;
u32 rxmask; u32 rxmask;
if (status & ATH9K_INT_FATAL) { if ((status & ATH9K_INT_FATAL) ||
(status & ATH9K_INT_BB_WATCHDOG)) {
ath_reset(sc, true); ath_reset(sc, true);
return; return;
} }
@ -737,6 +738,7 @@ irqreturn_t ath_isr(int irq, void *dev)
{ {
#define SCHED_INTR ( \ #define SCHED_INTR ( \
ATH9K_INT_FATAL | \ ATH9K_INT_FATAL | \
ATH9K_INT_BB_WATCHDOG | \
ATH9K_INT_RXORN | \ ATH9K_INT_RXORN | \
ATH9K_INT_RXEOL | \ ATH9K_INT_RXEOL | \
ATH9K_INT_RX | \ ATH9K_INT_RX | \

View File

@ -689,7 +689,8 @@ static void ath_rc_rate_set_series(const struct ath_rate_table *rate_table,
if (WLAN_RC_PHY_HT(rate_table->info[rix].phy)) { if (WLAN_RC_PHY_HT(rate_table->info[rix].phy)) {
rate->flags |= IEEE80211_TX_RC_MCS; rate->flags |= IEEE80211_TX_RC_MCS;
if (WLAN_RC_PHY_40(rate_table->info[rix].phy)) if (WLAN_RC_PHY_40(rate_table->info[rix].phy) &&
conf_is_ht40(&txrc->hw->conf))
rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH;
if (WLAN_RC_PHY_SGI(rate_table->info[rix].phy)) if (WLAN_RC_PHY_SGI(rate_table->info[rix].phy))
rate->flags |= IEEE80211_TX_RC_SHORT_GI; rate->flags |= IEEE80211_TX_RC_SHORT_GI;

View File

@ -3093,7 +3093,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
int freq; int freq;
bool avoid = false; bool avoid = false;
u8 length; u8 length;
u16 tmp, core, type, count, max, numb, last, cmd; u16 tmp, core, type, count, max, numb, last = 0, cmd;
const u16 *table; const u16 *table;
bool phy6or5x; bool phy6or5x;

View File

@ -628,11 +628,11 @@ void iwl4965_rx_reply_rx(struct iwl_priv *priv,
/* rx_status carries information about the packet to mac80211 */ /* rx_status carries information about the packet to mac80211 */
rx_status.mactime = le64_to_cpu(phy_res->timestamp); rx_status.mactime = le64_to_cpu(phy_res->timestamp);
rx_status.band = (phy_res->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
rx_status.freq = rx_status.freq =
ieee80211_channel_to_frequency(le16_to_cpu(phy_res->channel), ieee80211_channel_to_frequency(le16_to_cpu(phy_res->channel),
rx_status.band); rx_status.band);
rx_status.band = (phy_res->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
rx_status.rate_idx = rx_status.rate_idx =
iwl4965_hwrate_to_mac80211_idx(rate_n_flags, rx_status.band); iwl4965_hwrate_to_mac80211_idx(rate_n_flags, rx_status.band);
rx_status.flag = 0; rx_status.flag = 0;

View File

@ -1543,7 +1543,7 @@ static void iwl4965_temperature_calib(struct iwl_priv *priv)
s32 temp; s32 temp;
temp = iwl4965_hw_get_temperature(priv); temp = iwl4965_hw_get_temperature(priv);
if (temp < 0) if (IWL_TX_POWER_TEMPERATURE_OUT_OF_RANGE(temp))
return; return;
if (priv->temperature != temp) { if (priv->temperature != temp) {

View File

@ -603,19 +603,27 @@ struct iwl_cfg iwl6050_2abg_cfg = {
IWL_DEVICE_6050, IWL_DEVICE_6050,
}; };
#define IWL_DEVICE_6150 \
.fw_name_pre = IWL6050_FW_PRE, \
.ucode_api_max = IWL6050_UCODE_API_MAX, \
.ucode_api_min = IWL6050_UCODE_API_MIN, \
.ops = &iwl6150_ops, \
.eeprom_ver = EEPROM_6150_EEPROM_VERSION, \
.eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
.base_params = &iwl6050_base_params, \
.need_dc_calib = true, \
.led_mode = IWL_LED_BLINK, \
.internal_wimax_coex = true
struct iwl_cfg iwl6150_bgn_cfg = { struct iwl_cfg iwl6150_bgn_cfg = {
.name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN", .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
.fw_name_pre = IWL6050_FW_PRE, IWL_DEVICE_6150,
.ucode_api_max = IWL6050_UCODE_API_MAX,
.ucode_api_min = IWL6050_UCODE_API_MIN,
.eeprom_ver = EEPROM_6150_EEPROM_VERSION,
.eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION,
.ops = &iwl6150_ops,
.base_params = &iwl6050_base_params,
.ht_params = &iwl6000_ht_params, .ht_params = &iwl6000_ht_params,
.need_dc_calib = true, };
.led_mode = IWL_LED_RF_STATE,
.internal_wimax_coex = true, struct iwl_cfg iwl6150_bg_cfg = {
.name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
IWL_DEVICE_6150,
}; };
struct iwl_cfg iwl6000_3agn_cfg = { struct iwl_cfg iwl6000_3agn_cfg = {

View File

@ -3831,11 +3831,11 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
/* 6150 WiFi/WiMax Series */ /* 6150 WiFi/WiMax Series */
{IWL_PCI_DEVICE(0x0885, 0x1305, iwl6150_bgn_cfg)}, {IWL_PCI_DEVICE(0x0885, 0x1305, iwl6150_bgn_cfg)},
{IWL_PCI_DEVICE(0x0885, 0x1306, iwl6150_bgn_cfg)}, {IWL_PCI_DEVICE(0x0885, 0x1307, iwl6150_bg_cfg)},
{IWL_PCI_DEVICE(0x0885, 0x1325, iwl6150_bgn_cfg)}, {IWL_PCI_DEVICE(0x0885, 0x1325, iwl6150_bgn_cfg)},
{IWL_PCI_DEVICE(0x0885, 0x1326, iwl6150_bgn_cfg)}, {IWL_PCI_DEVICE(0x0885, 0x1327, iwl6150_bg_cfg)},
{IWL_PCI_DEVICE(0x0886, 0x1315, iwl6150_bgn_cfg)}, {IWL_PCI_DEVICE(0x0886, 0x1315, iwl6150_bgn_cfg)},
{IWL_PCI_DEVICE(0x0886, 0x1316, iwl6150_bgn_cfg)}, {IWL_PCI_DEVICE(0x0886, 0x1317, iwl6150_bg_cfg)},
/* 1000 Series WiFi */ /* 1000 Series WiFi */
{IWL_PCI_DEVICE(0x0083, 0x1205, iwl1000_bgn_cfg)}, {IWL_PCI_DEVICE(0x0083, 0x1205, iwl1000_bgn_cfg)},

View File

@ -89,6 +89,7 @@ extern struct iwl_cfg iwl6000_3agn_cfg;
extern struct iwl_cfg iwl6050_2agn_cfg; extern struct iwl_cfg iwl6050_2agn_cfg;
extern struct iwl_cfg iwl6050_2abg_cfg; extern struct iwl_cfg iwl6050_2abg_cfg;
extern struct iwl_cfg iwl6150_bgn_cfg; extern struct iwl_cfg iwl6150_bgn_cfg;
extern struct iwl_cfg iwl6150_bg_cfg;
extern struct iwl_cfg iwl1000_bgn_cfg; extern struct iwl_cfg iwl1000_bgn_cfg;
extern struct iwl_cfg iwl1000_bg_cfg; extern struct iwl_cfg iwl1000_bg_cfg;
extern struct iwl_cfg iwl100_bgn_cfg; extern struct iwl_cfg iwl100_bgn_cfg;

View File

@ -994,6 +994,8 @@ static void lbs_submit_command(struct lbs_private *priv,
cmd = cmdnode->cmdbuf; cmd = cmdnode->cmdbuf;
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
priv->seqnum++;
cmd->seqnum = cpu_to_le16(priv->seqnum);
priv->cur_cmd = cmdnode; priv->cur_cmd = cmdnode;
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
@ -1621,11 +1623,9 @@ struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv,
/* Copy the incoming command to the buffer */ /* Copy the incoming command to the buffer */
memcpy(cmdnode->cmdbuf, in_cmd, in_cmd_size); memcpy(cmdnode->cmdbuf, in_cmd, in_cmd_size);
/* Set sequence number, clean result, move to buffer */ /* Set command, clean result, move to buffer */
priv->seqnum++;
cmdnode->cmdbuf->command = cpu_to_le16(command); cmdnode->cmdbuf->command = cpu_to_le16(command);
cmdnode->cmdbuf->size = cpu_to_le16(in_cmd_size); cmdnode->cmdbuf->size = cpu_to_le16(in_cmd_size);
cmdnode->cmdbuf->seqnum = cpu_to_le16(priv->seqnum);
cmdnode->cmdbuf->result = 0; cmdnode->cmdbuf->result = 0;
lbs_deb_host("PREP_CMD: command 0x%04x\n", command); lbs_deb_host("PREP_CMD: command 0x%04x\n", command);

View File

@ -167,8 +167,8 @@
/* Rx unit register */ /* Rx unit register */
#define CARD_RX_UNIT_REG 0x63 #define CARD_RX_UNIT_REG 0x63
/* Event header Len*/ /* Event header len w/o 4 bytes of interface header */
#define MWIFIEX_EVENT_HEADER_LEN 8 #define MWIFIEX_EVENT_HEADER_LEN 4
/* Max retry number of CMD53 write */ /* Max retry number of CMD53 write */
#define MAX_WRITE_IOMEM_RETRY 2 #define MAX_WRITE_IOMEM_RETRY 2

View File

@ -166,7 +166,6 @@ config RT2800USB_RT35XX
config RT2800USB_RT53XX config RT2800USB_RT53XX
bool "rt2800usb - Include support for rt53xx devices (EXPERIMENTAL)" bool "rt2800usb - Include support for rt53xx devices (EXPERIMENTAL)"
depends on EXPERIMENTAL depends on EXPERIMENTAL
default y
---help--- ---help---
This adds support for rt53xx wireless chipset family to the This adds support for rt53xx wireless chipset family to the
rt2800pci driver. rt2800pci driver.

View File

@ -669,11 +669,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
&rx_status, &rx_status,
(u8 *) pdesc, skb); (u8 *) pdesc, skb);
pci_unmap_single(rtlpci->pdev,
*((dma_addr_t *) skb->cb),
rtlpci->rxbuffersize,
PCI_DMA_FROMDEVICE);
skb_put(skb, rtlpriv->cfg->ops->get_desc((u8 *) pdesc, skb_put(skb, rtlpriv->cfg->ops->get_desc((u8 *) pdesc,
false, false,
HW_DESC_RXPKT_LEN)); HW_DESC_RXPKT_LEN));
@ -690,6 +685,21 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
hdr = rtl_get_hdr(skb); hdr = rtl_get_hdr(skb);
fc = rtl_get_fc(skb); fc = rtl_get_fc(skb);
/* try for new buffer - if allocation fails, drop
* frame and reuse old buffer
*/
new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
if (unlikely(!new_skb)) {
RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV),
DBG_DMESG,
("can't alloc skb for rx\n"));
goto done;
}
pci_unmap_single(rtlpci->pdev,
*((dma_addr_t *) skb->cb),
rtlpci->rxbuffersize,
PCI_DMA_FROMDEVICE);
if (!stats.crc || !stats.hwerror) { if (!stats.crc || !stats.hwerror) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, memcpy(IEEE80211_SKB_RXCB(skb), &rx_status,
sizeof(rx_status)); sizeof(rx_status));
@ -758,15 +768,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
rtl_lps_leave(hw); rtl_lps_leave(hw);
} }
new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
if (unlikely(!new_skb)) {
RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV),
DBG_DMESG,
("can't alloc skb for rx\n"));
goto done;
}
skb = new_skb; skb = new_skb;
/*skb->dev = dev; */
rtlpci->rx_ring[rx_queue_idx].rx_buf[rtlpci-> rtlpci->rx_ring[rx_queue_idx].rx_buf[rtlpci->
rx_ring rx_ring
@ -1113,6 +1115,13 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
rtlpci->rx_ring[rx_queue_idx].idx = 0; rtlpci->rx_ring[rx_queue_idx].idx = 0;
/* If amsdu_8k is disabled, set buffersize to 4096. This
* change will reduce memory fragmentation.
*/
if (rtlpci->rxbuffersize > 4096 &&
rtlpriv->rtlhal.disable_amsdu_8k)
rtlpci->rxbuffersize = 4096;
for (i = 0; i < rtlpci->rxringcount; i++) { for (i = 0; i < rtlpci->rxringcount; i++) {
struct sk_buff *skb = struct sk_buff *skb =
dev_alloc_skb(rtlpci->rxbuffersize); dev_alloc_skb(rtlpci->rxbuffersize);

View File

@ -1157,6 +1157,9 @@ struct conf_sched_scan_settings {
/* time to wait on the channel for passive scans (in TUs) */ /* time to wait on the channel for passive scans (in TUs) */
u32 dwell_time_passive; u32 dwell_time_passive;
/* time to wait on the channel for DFS scans (in TUs) */
u32 dwell_time_dfs;
/* number of probe requests to send on each channel in active scans */ /* number of probe requests to send on each channel in active scans */
u8 num_probe_reqs; u8 num_probe_reqs;

View File

@ -311,6 +311,7 @@ static struct conf_drv_settings default_conf = {
.min_dwell_time_active = 8, .min_dwell_time_active = 8,
.max_dwell_time_active = 30, .max_dwell_time_active = 30,
.dwell_time_passive = 100, .dwell_time_passive = 100,
.dwell_time_dfs = 150,
.num_probe_reqs = 2, .num_probe_reqs = 2,
.rssi_threshold = -90, .rssi_threshold = -90,
.snr_threshold = 0, .snr_threshold = 0,

View File

@ -331,16 +331,22 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
struct conf_sched_scan_settings *c = &wl->conf.sched_scan; struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
int i, j; int i, j;
u32 flags; u32 flags;
bool force_passive = !req->n_ssids;
for (i = 0, j = start; for (i = 0, j = start;
i < req->n_channels && j < MAX_CHANNELS_ALL_BANDS; i < req->n_channels && j < MAX_CHANNELS_ALL_BANDS;
i++) { i++) {
flags = req->channels[i]->flags; flags = req->channels[i]->flags;
if (!(flags & IEEE80211_CHAN_DISABLED) && if (force_passive)
((flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive) && flags |= IEEE80211_CHAN_PASSIVE_SCAN;
((flags & IEEE80211_CHAN_RADAR) == radar) &&
(req->channels[i]->band == band)) { if ((req->channels[i]->band == band) &&
!(flags & IEEE80211_CHAN_DISABLED) &&
(!!(flags & IEEE80211_CHAN_RADAR) == radar) &&
/* if radar is set, we ignore the passive flag */
(radar ||
!!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive)) {
wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ", wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
req->channels[i]->band, req->channels[i]->band,
req->channels[i]->center_freq); req->channels[i]->center_freq);
@ -350,7 +356,12 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
wl1271_debug(DEBUG_SCAN, "max_power %d", wl1271_debug(DEBUG_SCAN, "max_power %d",
req->channels[i]->max_power); req->channels[i]->max_power);
if (flags & IEEE80211_CHAN_PASSIVE_SCAN) { if (flags & IEEE80211_CHAN_RADAR) {
channels[j].flags |= SCAN_CHANNEL_FLAGS_DFS;
channels[j].passive_duration =
cpu_to_le16(c->dwell_time_dfs);
}
else if (flags & IEEE80211_CHAN_PASSIVE_SCAN) {
channels[j].passive_duration = channels[j].passive_duration =
cpu_to_le16(c->dwell_time_passive); cpu_to_le16(c->dwell_time_passive);
} else { } else {
@ -359,7 +370,7 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
channels[j].max_duration = channels[j].max_duration =
cpu_to_le16(c->max_dwell_time_active); cpu_to_le16(c->max_dwell_time_active);
} }
channels[j].tx_power_att = req->channels[j]->max_power; channels[j].tx_power_att = req->channels[i]->max_power;
channels[j].channel = req->channels[i]->hw_value; channels[j].channel = req->channels[i]->hw_value;
j++; j++;
@ -386,7 +397,11 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl,
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
IEEE80211_BAND_2GHZ, IEEE80211_BAND_2GHZ,
false, false, idx); false, false, idx);
idx += cfg->active[0]; /*
* 5GHz channels always start at position 14, not immediately
* after the last 2.4GHz channel
*/
idx = 14;
cfg->passive[1] = cfg->passive[1] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
@ -394,22 +409,23 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl,
false, true, idx); false, true, idx);
idx += cfg->passive[1]; idx += cfg->passive[1];
cfg->active[1] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
IEEE80211_BAND_5GHZ,
false, false, 14);
idx += cfg->active[1];
cfg->dfs = cfg->dfs =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
IEEE80211_BAND_5GHZ, IEEE80211_BAND_5GHZ,
true, false, idx); true, true, idx);
idx += cfg->dfs; idx += cfg->dfs;
cfg->active[1] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
IEEE80211_BAND_5GHZ,
false, false, idx);
idx += cfg->active[1];
wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d", wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d",
cfg->active[0], cfg->passive[0]); cfg->active[0], cfg->passive[0]);
wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d", wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d",
cfg->active[1], cfg->passive[1]); cfg->active[1], cfg->passive[1]);
wl1271_debug(DEBUG_SCAN, " DFS: %d", cfg->dfs);
return idx; return idx;
} }
@ -421,6 +437,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
struct wl1271_cmd_sched_scan_config *cfg = NULL; struct wl1271_cmd_sched_scan_config *cfg = NULL;
struct conf_sched_scan_settings *c = &wl->conf.sched_scan; struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
int i, total_channels, ret; int i, total_channels, ret;
bool force_passive = !req->n_ssids;
wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config"); wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config");
@ -444,7 +461,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++) for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++)
cfg->intervals[i] = cpu_to_le32(req->interval); cfg->intervals[i] = cpu_to_le32(req->interval);
if (req->ssids[0].ssid_len && req->ssids[0].ssid) { if (!force_passive && req->ssids[0].ssid_len && req->ssids[0].ssid) {
cfg->filter_type = SCAN_SSID_FILTER_SPECIFIC; cfg->filter_type = SCAN_SSID_FILTER_SPECIFIC;
cfg->ssid_len = req->ssids[0].ssid_len; cfg->ssid_len = req->ssids[0].ssid_len;
memcpy(cfg->ssid, req->ssids[0].ssid, memcpy(cfg->ssid, req->ssids[0].ssid,
@ -461,7 +478,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
goto out; goto out;
} }
if (cfg->active[0]) { if (!force_passive && cfg->active[0]) {
ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid, ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid,
req->ssids[0].ssid_len, req->ssids[0].ssid_len,
ies->ie[IEEE80211_BAND_2GHZ], ies->ie[IEEE80211_BAND_2GHZ],
@ -473,7 +490,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
} }
} }
if (cfg->active[1]) { if (!force_passive && cfg->active[1]) {
ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid, ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid,
req->ssids[0].ssid_len, req->ssids[0].ssid_len,
ies->ie[IEEE80211_BAND_5GHZ], ies->ie[IEEE80211_BAND_5GHZ],

View File

@ -137,6 +137,9 @@ enum {
SCAN_BSS_TYPE_ANY, SCAN_BSS_TYPE_ANY,
}; };
#define SCAN_CHANNEL_FLAGS_DFS BIT(0)
#define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1)
struct conn_scan_ch_params { struct conn_scan_ch_params {
__le16 min_duration; __le16 min_duration;
__le16 max_duration; __le16 max_duration;

View File

@ -1533,6 +1533,31 @@ static void __exit usb_exit(void)
module_init(usb_init); module_init(usb_init);
module_exit(usb_exit); module_exit(usb_exit);
static int zd_ep_regs_out_msg(struct usb_device *udev, void *data, int len,
int *actual_length, int timeout)
{
/* In USB 2.0 mode EP_REGS_OUT endpoint is interrupt type. However in
* USB 1.1 mode endpoint is bulk. Select correct type URB by endpoint
* descriptor.
*/
struct usb_host_endpoint *ep;
unsigned int pipe;
pipe = usb_sndintpipe(udev, EP_REGS_OUT);
ep = usb_pipe_endpoint(udev, pipe);
if (!ep)
return -EINVAL;
if (usb_endpoint_xfer_int(&ep->desc)) {
return usb_interrupt_msg(udev, pipe, data, len,
actual_length, timeout);
} else {
pipe = usb_sndbulkpipe(udev, EP_REGS_OUT);
return usb_bulk_msg(udev, pipe, data, len, actual_length,
timeout);
}
}
static int usb_int_regs_length(unsigned int count) static int usb_int_regs_length(unsigned int count)
{ {
return sizeof(struct usb_int_regs) + count * sizeof(struct reg_data); return sizeof(struct usb_int_regs) + count * sizeof(struct reg_data);
@ -1648,15 +1673,14 @@ int zd_usb_ioread16v(struct zd_usb *usb, u16 *values,
udev = zd_usb_to_usbdev(usb); udev = zd_usb_to_usbdev(usb);
prepare_read_regs_int(usb); prepare_read_regs_int(usb);
r = usb_interrupt_msg(udev, usb_sndintpipe(udev, EP_REGS_OUT), r = zd_ep_regs_out_msg(udev, req, req_len, &actual_req_len, 50 /*ms*/);
req, req_len, &actual_req_len, 50 /* ms */);
if (r) { if (r) {
dev_dbg_f(zd_usb_dev(usb), dev_dbg_f(zd_usb_dev(usb),
"error in usb_interrupt_msg(). Error number %d\n", r); "error in zd_ep_regs_out_msg(). Error number %d\n", r);
goto error; goto error;
} }
if (req_len != actual_req_len) { if (req_len != actual_req_len) {
dev_dbg_f(zd_usb_dev(usb), "error in usb_interrupt_msg()\n" dev_dbg_f(zd_usb_dev(usb), "error in zd_ep_regs_out_msg()\n"
" req_len %d != actual_req_len %d\n", " req_len %d != actual_req_len %d\n",
req_len, actual_req_len); req_len, actual_req_len);
r = -EIO; r = -EIO;
@ -1818,9 +1842,17 @@ int zd_usb_iowrite16v_async(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
rw->value = cpu_to_le16(ioreqs[i].value); rw->value = cpu_to_le16(ioreqs[i].value);
} }
usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT), /* In USB 2.0 mode endpoint is interrupt type. However in USB 1.1 mode
req, req_len, iowrite16v_urb_complete, usb, * endpoint is bulk. Select correct type URB by endpoint descriptor.
ep->desc.bInterval); */
if (usb_endpoint_xfer_int(&ep->desc))
usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT),
req, req_len, iowrite16v_urb_complete, usb,
ep->desc.bInterval);
else
usb_fill_bulk_urb(urb, udev, usb_sndbulkpipe(udev, EP_REGS_OUT),
req, req_len, iowrite16v_urb_complete, usb);
urb->transfer_flags |= URB_FREE_BUFFER; urb->transfer_flags |= URB_FREE_BUFFER;
/* Submit previous URB */ /* Submit previous URB */
@ -1924,15 +1956,14 @@ int zd_usb_rfwrite(struct zd_usb *usb, u32 value, u8 bits)
} }
udev = zd_usb_to_usbdev(usb); udev = zd_usb_to_usbdev(usb);
r = usb_interrupt_msg(udev, usb_sndintpipe(udev, EP_REGS_OUT), r = zd_ep_regs_out_msg(udev, req, req_len, &actual_req_len, 50 /*ms*/);
req, req_len, &actual_req_len, 50 /* ms */);
if (r) { if (r) {
dev_dbg_f(zd_usb_dev(usb), dev_dbg_f(zd_usb_dev(usb),
"error in usb_interrupt_msg(). Error number %d\n", r); "error in zd_ep_regs_out_msg(). Error number %d\n", r);
goto out; goto out;
} }
if (req_len != actual_req_len) { if (req_len != actual_req_len) {
dev_dbg_f(zd_usb_dev(usb), "error in usb_interrupt_msg()" dev_dbg_f(zd_usb_dev(usb), "error in zd_ep_regs_out_msg()"
" req_len %d != actual_req_len %d\n", " req_len %d != actual_req_len %d\n",
req_len, actual_req_len); req_len, actual_req_len);
r = -EIO; r = -EIO;

Some files were not shown because too many files have changed in this diff Show More