diff --git a/[refs] b/[refs] index 500bbf3e8929..c86e820f814c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 41e904dee22066ae7ac3a7f695b2c8bd43ce4e04 +refs/heads/master: 78bfd36169398bfc07bca218952a429bf301bc55 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index bef79776b388..8fa3005de459 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -723,52 +723,42 @@ M: rpurdie@rpsys.net S: Maintained BLACKFIN ARCHITECTURE -P: Aubrey Li -M: aubrey.li@analog.com -P: Bernd Schmidt -M: bernd.schmidt@analog.com -P: Bryan Wu -M: bryan.wu@analog.com -P: Grace Pan -M: grace.pan@analog.com -P: Marc Hoffman -M: marc.hoffman@analog.com -P: Michael Hennerich -M: michael.hennerich@analog.com -P: Mike Frysinger -M: michael.frysinger@analog.com -P: Jerry Zeng -M: jerry.zeng@analog.com -P: Jie Zhang -M: jie.zhang@analog.com -P: Robin Getz -M: robin.getz@analog.com -P: Roy Huang -M: roy.huang@analog.com -P: Sonic Zhang -M: sonic.zhang@analog.com -P: Vivi Li -M: vivi.li@analog.com -P: Yi Li -M: yi.li@analog.com -L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) -W: http://blackfin.uclinux.org -S: Supported - -BLACKFIN RTC DRIVER -P: Mike Frysinger -M: michael.frysinger@analog.com -M: vapier.adi@gmail.com -L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) -W: http://blackfin.uclinux.org -S: Supported +P: Aubrey Li +M: aubrey.li@analog.com +P: Bernd Schmidt +M: bernd.schmidt@analog.com +P: Bryan Wu +M: bryan.wu@analog.com +P: Grace Pan +M: grace.pan@analog.com +P: Michael Hennerich +M: michael.hennerich@analog.com +P: Mike Frysinger +M: michael.frysinger@analog.com +P: Jane Lv +M: jane.lv@analog.com +P: Jerry Zeng +M: jerry.zeng@analog.com +P: Jie Zhang +M: jie.zhang@analog.com +P: Robin Getz +M: robin.getz@analog.com +P: Roy Huang +M: roy.huang@analog.com +P: Sonic Zhang +M: sonic.zhang@analog.com +P: Yi Li +M: yi.li@analog.com +L: uclinux-dist-devel@blackfin.uclinux.org +W: http://blackfin.uclinux.org +S: Supported BLACKFIN SERIAL DRIVER -P: Aubrey Li -M: aubrey.li@analog.com -L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) -W: http://blackfin.uclinux.org -S: Supported +P: Aubrey Li +M: aubrey.li@analog.com +L: uclinux-dist-devel@blackfin.uclinux.org +W: http://blackfin.uclinux.org +S: Supported BAYCOM/HDLCDRV DRIVERS FOR AX.25 P: Thomas Sailer @@ -4022,7 +4012,7 @@ S: Supported XFS FILESYSTEM P: Silicon Graphics Inc -P: Tim Shimmin, David Chatterton +P: Tim Shimmin M: xfs-masters@oss.sgi.com L: xfs@oss.sgi.com W: http://oss.sgi.com/projects/xfs diff --git a/trunk/Makefile b/trunk/Makefile index b76ee94a6c9f..30d685b629a4 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,8 +1,8 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 22 -EXTRAVERSION = -rc5 -NAME = Holy Dancing Manatees, Batman! +EXTRAVERSION = -rc4 +NAME = Jeff Thinks I Should Change This, But To What? # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff --git a/trunk/arch/arm/mach-s3c2440/mach-anubis.c b/trunk/arch/arm/mach-s3c2440/mach-anubis.c index bff7ddd06a52..b5d387ef37e1 100644 --- a/trunk/arch/arm/mach-s3c2440/mach-anubis.c +++ b/trunk/arch/arm/mach-s3c2440/mach-anubis.c @@ -76,8 +76,8 @@ static struct map_desc anubis_iodesc[] __initdata = { .length = SZ_4K, .type = MT_DEVICE, }, { - .virtual = (u32)ANUBIS_VA_IDREG, - .pfn = __phys_to_pfn(ANUBIS_PA_IDREG), + .virtual = (u32)ANUBIS_VA_CTRL2, + .pfn = __phys_to_pfn(ANUBIS_PA_CTRL2), .length = SZ_4K, .type = MT_DEVICE, }, diff --git a/trunk/arch/arm/mach-s3c2440/mach-osiris.c b/trunk/arch/arm/mach-s3c2440/mach-osiris.c index 15811601f03d..4d6c7a574c1a 100644 --- a/trunk/arch/arm/mach-s3c2440/mach-osiris.c +++ b/trunk/arch/arm/mach-s3c2440/mach-osiris.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -66,11 +65,6 @@ static struct map_desc osiris_iodesc[] __initdata = { /* CPLD control registers */ { - .virtual = (u32)OSIRIS_VA_CTRL0, - .pfn = __phys_to_pfn(OSIRIS_PA_CTRL0), - .length = SZ_16K, - .type = MT_DEVICE, - }, { .virtual = (u32)OSIRIS_VA_CTRL1, .pfn = __phys_to_pfn(OSIRIS_PA_CTRL1), .length = SZ_16K, @@ -80,11 +74,6 @@ static struct map_desc osiris_iodesc[] __initdata = { .pfn = __phys_to_pfn(OSIRIS_PA_CTRL2), .length = SZ_16K, .type = MT_DEVICE, - }, { - .virtual = (u32)OSIRIS_VA_IDREG, - .pfn = __phys_to_pfn(OSIRIS_PA_IDREG), - .length = SZ_16K, - .type = MT_DEVICE, }, }; @@ -206,13 +195,13 @@ static void osiris_nand_select(struct s3c2410_nand_set *set, int slot) pr_debug("osiris_nand: selecting slot %d (set %p,%p)\n", slot, set, set->nr_map); - tmp = __raw_readb(OSIRIS_VA_CTRL0); - tmp &= ~OSIRIS_CTRL0_NANDSEL; + tmp = __raw_readb(OSIRIS_VA_CTRL1); + tmp &= ~OSIRIS_CTRL1_NANDSEL; tmp |= slot; - pr_debug("osiris_nand: ctrl0 now %02x\n", tmp); + pr_debug("osiris_nand: ctrl1 now %02x\n", tmp); - __raw_writeb(tmp, OSIRIS_VA_CTRL0); + __raw_writeb(tmp, OSIRIS_VA_CTRL1); } static struct s3c2410_platform_nand osiris_nand_info = { @@ -246,45 +235,10 @@ static struct platform_device osiris_pcmcia = { .resource = osiris_pcmcia_resource, }; -/* Osiris power management device */ - -#ifdef CONFIG_PM -static unsigned char pm_osiris_ctrl0; - -static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) -{ - pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0); - return 0; -} - -static int osiris_pm_resume(struct sys_device *sd) -{ - if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) - __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); - - return 0; -} - -#else -#define osiris_pm_suspend NULL -#define osiris_pm_resume NULL -#endif - -static struct sysdev_class osiris_pm_sysclass = { - set_kset_name("mach-osiris"), - .suspend = osiris_pm_suspend, - .resume = osiris_pm_resume, -}; - -static struct sys_device osiris_pm_sysdev = { - .cls = &osiris_pm_sysclass, -}; - /* Standard Osiris devices */ static struct platform_device *osiris_devices[] __initdata = { &s3c_device_i2c, - &s3c_device_wdt, &s3c_device_nand, &osiris_pcmcia, }; @@ -334,9 +288,6 @@ static void __init osiris_map_io(void) static void __init osiris_init(void) { - sysdev_class_register(&osiris_pm_sysclass); - sysdev_register(&osiris_pm_sysdev); - platform_add_devices(osiris_devices, ARRAY_SIZE(osiris_devices)); }; @@ -348,6 +299,5 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") .map_io = osiris_map_io, .init_machine = osiris_init, .init_irq = s3c24xx_init_irq, - .init_machine = osiris_init, .timer = &s3c24xx_timer, MACHINE_END diff --git a/trunk/arch/arm/vfp/entry.S b/trunk/arch/arm/vfp/entry.S index 806ce26d5243..ca2a5ad19ea6 100644 --- a/trunk/arch/arm/vfp/entry.S +++ b/trunk/arch/arm/vfp/entry.S @@ -29,10 +29,6 @@ do_vfp: add r10, r10, #TI_VFPSTATE @ r10 = workspace ldr pc, [r4] @ call VFP entry point -ENTRY(vfp_null_entry) - mov pc, lr -ENDPROC(vfp_null_entry) - .LCvfp: .word vfp_vector diff --git a/trunk/arch/arm/vfp/vfpmodule.c b/trunk/arch/arm/vfp/vfpmodule.c index 1106b5f9cf19..f1e5951dc721 100644 --- a/trunk/arch/arm/vfp/vfpmodule.c +++ b/trunk/arch/arm/vfp/vfpmodule.c @@ -26,9 +26,8 @@ */ void vfp_testing_entry(void); void vfp_support_entry(void); -void vfp_null_entry(void); -void (*vfp_vector)(void) = vfp_null_entry; +void (*vfp_vector)(void) = vfp_testing_entry; union vfp_state *last_VFP_context[NR_CPUS]; /* @@ -322,10 +321,8 @@ static int __init vfp_init(void) * The handler is already setup to just log calls, so * we just need to read the VFPSID register. */ - vfp_vector = vfp_testing_entry; vfpsid = fmrx(FPSID); barrier(); - vfp_vector = vfp_null_entry; printk(KERN_INFO "VFP support v0.3: "); if (VFP_arch) { diff --git a/trunk/arch/avr32/boards/atstk1000/atstk1002.c b/trunk/arch/avr32/boards/atstk1000/atstk1002.c index e253e86a1a39..fe1dbe2e28f4 100644 --- a/trunk/arch/avr32/boards/atstk1000/atstk1002.c +++ b/trunk/arch/avr32/boards/atstk1000/atstk1002.c @@ -42,7 +42,6 @@ static struct spi_board_info spi0_board_info[] __initdata = { .modalias = "ltv350qv", .max_speed_hz = 16000000, .chip_select = 1, - .mode = SPI_MODE_3, }, }; diff --git a/trunk/arch/avr32/mm/fault.c b/trunk/arch/avr32/mm/fault.c index 4b2495285d94..e011f1ce1875 100644 --- a/trunk/arch/avr32/mm/fault.c +++ b/trunk/arch/avr32/mm/fault.c @@ -158,7 +158,7 @@ asmlinkage void do_page_fault(unsigned long ecr, struct pt_regs *regs) up_read(&mm->mmap_sem); if (user_mode(regs)) { - if (exception_trace && printk_ratelimit()) + if (exception_trace) printk("%s%s[%d]: segfault at %08lx pc %08lx " "sp %08lx ecr %lu\n", is_init(tsk) ? KERN_EMERG : KERN_INFO, diff --git a/trunk/arch/blackfin/Kconfig b/trunk/arch/blackfin/Kconfig index 1fad8560c7af..b1b111bb2f3a 100644 --- a/trunk/arch/blackfin/Kconfig +++ b/trunk/arch/blackfin/Kconfig @@ -394,6 +394,41 @@ config BFIN_IDLE_LED_PIN default 0x08 if (BFIN533_STAMP && BFIN_IDLE_LED_NUM = 2) default 0x10 if (BFIN533_STAMP && BFIN_IDLE_LED_NUM = 3) +comment "Console UART Setup" + +choice + prompt "Baud Rate" + default BAUD_57600 +config BAUD_9600 + bool "9600" +config BAUD_19200 + bool "19200" +config BAUD_38400 + bool "38400" +config BAUD_57600 + bool "57600" +config BAUD_115200 + bool "115200" +endchoice + +choice + prompt "Parity" + default BAUD_NO_PARITY +config BAUD_NO_PARITY + bool "No Parity" +config BAUD_PARITY + bool "Parity" +endchoice + +choice + prompt "Stop Bits" + default BAUD_1_STOPBIT +config BAUD_1_STOPBIT + bool "1" +config BAUD_2_STOPBIT + bool "2" +endchoice + endmenu diff --git a/trunk/arch/blackfin/configs/BF533-EZKIT_defconfig b/trunk/arch/blackfin/configs/BF533-EZKIT_defconfig index 90d58aabe693..377c8e05e4ab 100644 --- a/trunk/arch/blackfin/configs/BF533-EZKIT_defconfig +++ b/trunk/arch/blackfin/configs/BF533-EZKIT_defconfig @@ -1,21 +1,20 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.21.3 +# Linux kernel version: 2.6.19.3 # # CONFIG_MMU is not set # CONFIG_FPU is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set CONFIG_BLACKFIN=y -CONFIG_ZONE_DMA=y CONFIG_BFIN=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y -# CONFIG_GENERIC_TIME is not set CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_UCLINUX=y CONFIG_FORCE_MAX_ZONEORDER=14 CONFIG_IRQCHIP_DEMUX_GPIO=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" @@ -34,16 +33,13 @@ CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SYSVIPC=y # CONFIG_IPC_NS is not set -CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set -CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set -CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y @@ -58,7 +54,9 @@ CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y +CONFIG_EPOLL=y CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 +# CONFIG_LIMIT_PAGECACHE is not set CONFIG_BUDDY=y # CONFIG_NP2 is not set CONFIG_SLAB=y @@ -82,9 +80,7 @@ CONFIG_KMOD=y # Block layer # CONFIG_BLOCK=y -# CONFIG_LBD is not set # CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set # # IO Schedulers @@ -113,6 +109,7 @@ CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_BF532 is not set CONFIG_BF533=y # CONFIG_BF534 is not set +# CONFIG_BF535 is not set # CONFIG_BF536 is not set # CONFIG_BF537 is not set # CONFIG_BF561 is not set @@ -128,7 +125,6 @@ CONFIG_BFIN533_EZKIT=y # CONFIG_BFIN537_BLUETECHNIX_CM is not set # CONFIG_BFIN561_BLUETECHNIX_CM is not set # CONFIG_BFIN561_EZKIT is not set -# CONFIG_BFIN561_TEPLA is not set # CONFIG_PNAV10 is not set # CONFIG_GENERIC_BOARD is not set CONFIG_MEM_MT48LC16M16A2TG_75=y @@ -172,7 +168,6 @@ CONFIG_WDTIMER=13 # # Board customizations # -# CONFIG_CMDLINE_BOOL is not set # # Board Setup @@ -182,6 +177,19 @@ CONFIG_MEM_SIZE=32 CONFIG_MEM_ADD_WIDTH=9 CONFIG_BOOT_LOAD=0x1000 +# +# Console UART Setup +# +# CONFIG_BAUD_9600 is not set +# CONFIG_BAUD_19200 is not set +# CONFIG_BAUD_38400 is not set +CONFIG_BAUD_57600=y +# CONFIG_BAUD_115200 is not set +CONFIG_BAUD_NO_PARITY=y +# CONFIG_BAUD_PARITY is not set +CONFIG_BAUD_1_STOPBIT=y +# CONFIG_BAUD_2_STOPBIT is not set + # # Blackfin Kernel Optimizations # @@ -191,7 +199,6 @@ CONFIG_BOOT_LOAD=0x1000 # # CONFIG_HZ_100 is not set CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set # CONFIG_HZ_1000 is not set CONFIG_HZ=250 @@ -210,7 +217,6 @@ CONFIG_MEMSET_L1=y CONFIG_MEMCPY_L1=y CONFIG_SYS_BFIN_SPINLOCK_L1=y # CONFIG_IP_CHECKSUM_L1 is not set -CONFIG_CACHELINE_ALIGNED_L1=y # CONFIG_SYSCALL_TAB_L1 is not set # CONFIG_CPLB_SWITCH_TAB_L1 is not set CONFIG_RAMKERNEL=y @@ -224,7 +230,6 @@ CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 CONFIG_LARGE_ALLOCS=y CONFIG_BFIN_DMA_5XX=y # CONFIG_DMA_UNCACHED_2M is not set @@ -297,7 +302,7 @@ CONFIG_BINFMT_ZFLAT=y # Power management options # CONFIG_PM=y -# CONFIG_PM_LEGACY is not set +CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set # CONFIG_PM_SYSFS_DEPRECATED is not set CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR=y @@ -325,7 +330,6 @@ CONFIG_UNIX=y CONFIG_XFRM=y # CONFIG_XFRM_USER is not set # CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -352,7 +356,6 @@ CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set # CONFIG_IPV6 is not set # CONFIG_INET6_XFRM_TUNNEL is not set # CONFIG_INET6_TUNNEL is not set @@ -396,48 +399,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic" # # CONFIG_NET_PKTGEN is not set # CONFIG_HAMRADIO is not set -CONFIG_IRDA=m - -# -# IrDA protocols -# -CONFIG_IRLAN=m -CONFIG_IRCOMM=m -# CONFIG_IRDA_ULTRA is not set - -# -# IrDA options -# -CONFIG_IRDA_CACHE_LAST_LSAP=y -# CONFIG_IRDA_FAST_RR is not set -# CONFIG_IRDA_DEBUG is not set - -# -# Infrared-port device drivers -# - -# -# SIR device drivers -# -CONFIG_IRTTY_SIR=m - -# -# Dongle support -# -# CONFIG_DONGLE is not set - -# -# Old SIR device drivers -# -# CONFIG_IRPORT_SIR is not set - -# -# Old Serial dongle support -# - -# -# FIR device drivers -# +# CONFIG_IRDA is not set # CONFIG_BT is not set # CONFIG_IEEE80211 is not set @@ -472,7 +434,6 @@ CONFIG_MTD_PARTITIONS=y # User Modules And Translation Layers # CONFIG_MTD_CHAR=m -CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set @@ -528,8 +489,6 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0 # # Self-contained MTD device drivers # -# CONFIG_MTD_DATAFLASH is not set -# CONFIG_MTD_M25P80 is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set @@ -560,7 +519,6 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0 # # Plug and Play support # -# CONFIG_PNPACPI is not set # # Block devices @@ -572,12 +530,14 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +# CONFIG_BLK_DEV_INITRD is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # Misc devices # +# CONFIG_TIFM_CORE is not set # # ATA/ATAPI/MFM/RLL support @@ -676,26 +636,7 @@ CONFIG_SMC91X=y # # Input device support # -CONFIG_INPUT=m -# CONFIG_INPUT_FF_MEMLESS is not set - -# -# Userland interfaces -# -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_TSDEV is not set -CONFIG_INPUT_EVDEV=m -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set +# CONFIG_INPUT is not set # # Hardware I/O ports @@ -708,14 +649,12 @@ CONFIG_INPUT_EVDEV=m # # CONFIG_AD9960 is not set # CONFIG_SPI_ADC_BF533 is not set -# CONFIG_BF5xx_PFLAGS is not set +# CONFIG_BF533_PFLAGS is not set # CONFIG_BF5xx_PPIFCD is not set # CONFIG_BF5xx_TIMERS is not set # CONFIG_BF5xx_PPI is not set -CONFIG_BFIN_SPORT=y +# CONFIG_BFIN_SPORT is not set # CONFIG_BFIN_TIMER_LATENCY is not set -# CONFIG_AD5304 is not set -# CONFIG_BF5xx_FBDMA is not set # CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -752,19 +691,16 @@ CONFIG_UNIX98_PTYS=y # # Watchdog Cards # -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -CONFIG_BFIN_WDT=y +# CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=y # CONFIG_GEN_RTC is not set CONFIG_BLACKFIN_DPMC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set + +# +# Ftape, the floppy tape device driver +# # CONFIG_RAW_DRIVER is not set # @@ -780,19 +716,8 @@ CONFIG_BLACKFIN_DPMC=y # # SPI support # -CONFIG_SPI=y -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -CONFIG_SPI_BFIN=y -# CONFIG_SPI_BITBANG is not set - -# -# SPI Protocol Masters -# -# CONFIG_SPI_AT25 is not set +# CONFIG_SPI is not set +# CONFIG_SPI_MASTER is not set # # Dallas's 1-wire bus @@ -806,16 +731,9 @@ CONFIG_HWMON=y # CONFIG_HWMON_VID is not set # CONFIG_SENSORS_ABITUGURU is not set # CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_LM70 is not set -# CONFIG_SENSORS_PC87427 is not set # CONFIG_SENSORS_VT1211 is not set # CONFIG_HWMON_DEBUG_CHIP is not set -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set - # # Multimedia devices # @@ -829,20 +747,15 @@ CONFIG_HWMON=y # # Graphics support # -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set +CONFIG_FIRMWARE_EDID=y # CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound # # CONFIG_SOUND is not set -# -# HID Devices -# -CONFIG_HID=m -# CONFIG_HID_DEBUG is not set - # # USB support # @@ -863,7 +776,6 @@ CONFIG_USB_ARCH_HAS_HCD=y # # MMC/SD Card support # -# CONFIG_SPI_MMC is not set # CONFIG_MMC is not set # @@ -909,10 +821,8 @@ CONFIG_RTC_INTF_DEV=y # # CONFIG_RTC_DRV_DS1553 is not set # CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_RS5C348 is not set # CONFIG_RTC_DRV_M48T86 is not set # CONFIG_RTC_DRV_TEST is not set -# CONFIG_RTC_DRV_MAX6902 is not set # CONFIG_RTC_DRV_V3020 is not set CONFIG_RTC_DRV_BFIN=y @@ -929,14 +839,6 @@ CONFIG_RTC_DRV_BFIN=y # DMA Devices # -# -# Auxiliary Display support -# - -# -# Virtualization -# - # # PBX support # @@ -945,9 +847,13 @@ CONFIG_RTC_DRV_BFIN=y # # File systems # -# CONFIG_EXT2_FS is not set +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_POSIX_ACL is not set +# CONFIG_EXT2_FS_SECURITY is not set # CONFIG_EXT3_FS is not set # CONFIG_EXT4DEV_FS is not set +CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set @@ -956,8 +862,7 @@ CONFIG_RTC_DRV_BFIN=y # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set -CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y +# CONFIG_INOTIFY is not set # CONFIG_QUOTA is not set # CONFIG_DNOTIFY is not set # CONFIG_AUTOFS_FS is not set @@ -1008,6 +913,7 @@ CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10 # CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set # CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y +# CONFIG_JFFS_FS is not set CONFIG_JFFS2_FS=m CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y @@ -1039,8 +945,7 @@ CONFIG_NFS_COMMON=y CONFIG_SUNRPC=m # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set -CONFIG_SMB_FS=m -# CONFIG_SMB_NLS_DEFAULT is not set +# CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set @@ -1056,51 +961,7 @@ CONFIG_MSDOS_PARTITION=y # # Native Language Support # -CONFIG_NLS=m -CONFIG_NLS_DEFAULT="iso8859-1" -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -# CONFIG_NLS_ISO8859_1 is not set -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set - -# -# Distributed Lock Manager -# -# CONFIG_DLM is not set +# CONFIG_NLS is not set # # Profiling support @@ -1114,16 +975,19 @@ CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_ENABLE_MUST_CHECK=y # CONFIG_MAGIC_SYSRQ is not set # CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_UNWIND_INFO is not set +# CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_SERIAL_EARLY_INIT is not set CONFIG_DEBUG_HUNT_FOR_ZERO=y # CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set +# CONFIG_BOOTPARAM is not set +# CONFIG_NO_KERNEL_MSG is not set CONFIG_CPLB_INFO=y -CONFIG_ACCESS_CHECK=y +# CONFIG_NO_ACCESS_CHECK is not set # # Security options @@ -1131,7 +995,7 @@ CONFIG_ACCESS_CHECK=y # CONFIG_KEYS is not set CONFIG_SECURITY=y # CONFIG_SECURITY_NETWORK is not set -CONFIG_SECURITY_CAPABILITIES=m +CONFIG_SECURITY_CAPABILITIES=y # # Cryptographic options @@ -1141,13 +1005,10 @@ CONFIG_SECURITY_CAPABILITIES=m # # Library routines # -CONFIG_BITREVERSE=y -CONFIG_CRC_CCITT=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y diff --git a/trunk/arch/blackfin/configs/BF533-STAMP_defconfig b/trunk/arch/blackfin/configs/BF533-STAMP_defconfig index fee918957392..14a948c288a5 100644 --- a/trunk/arch/blackfin/configs/BF533-STAMP_defconfig +++ b/trunk/arch/blackfin/configs/BF533-STAMP_defconfig @@ -1,13 +1,12 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.21.3 +# Linux kernel version: 2.6.20.4 # # CONFIG_MMU is not set # CONFIG_FPU is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set CONFIG_BLACKFIN=y -CONFIG_ZONE_DMA=y CONFIG_BFIN=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_GENERIC_FIND_NEXT_BIT=y @@ -34,7 +33,6 @@ CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SYSVIPC=y # CONFIG_IPC_NS is not set -CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set @@ -43,7 +41,6 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_IKCONFIG is not set CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set -CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y @@ -58,7 +55,9 @@ CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y +CONFIG_EPOLL=y CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 +# CONFIG_LIMIT_PAGECACHE is not set CONFIG_BUDDY=y # CONFIG_NP2 is not set CONFIG_SLAB=y @@ -128,7 +127,6 @@ CONFIG_BFIN533_STAMP=y # CONFIG_BFIN537_BLUETECHNIX_CM is not set # CONFIG_BFIN561_BLUETECHNIX_CM is not set # CONFIG_BFIN561_EZKIT is not set -# CONFIG_BFIN561_TEPLA is not set # CONFIG_PNAV10 is not set # CONFIG_GENERIC_BOARD is not set CONFIG_MEM_MT48LC64M4A2FB_7E=y @@ -194,6 +192,19 @@ CONFIG_BFIN_ALIVE_LED_DPORT=0xFFC00730 CONFIG_BFIN_IDLE_LED_PORT=0xFFC00700 CONFIG_BFIN_IDLE_LED_DPORT=0xFFC00730 +# +# Console UART Setup +# +# CONFIG_BAUD_9600 is not set +# CONFIG_BAUD_19200 is not set +# CONFIG_BAUD_38400 is not set +CONFIG_BAUD_57600=y +# CONFIG_BAUD_115200 is not set +CONFIG_BAUD_NO_PARITY=y +# CONFIG_BAUD_PARITY is not set +CONFIG_BAUD_1_STOPBIT=y +# CONFIG_BAUD_2_STOPBIT is not set + # # Blackfin Kernel Optimizations # @@ -222,7 +233,6 @@ CONFIG_MEMSET_L1=y CONFIG_MEMCPY_L1=y CONFIG_SYS_BFIN_SPINLOCK_L1=y # CONFIG_IP_CHECKSUM_L1 is not set -CONFIG_CACHELINE_ALIGNED_L1=y # CONFIG_SYSCALL_TAB_L1 is not set # CONFIG_CPLB_SWITCH_TAB_L1 is not set CONFIG_RAMKERNEL=y @@ -236,7 +246,6 @@ CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 CONFIG_LARGE_ALLOCS=y CONFIG_BFIN_DMA_5XX=y # CONFIG_DMA_UNCACHED_2M is not set @@ -309,7 +318,7 @@ CONFIG_BINFMT_ZFLAT=y # Power management options # CONFIG_PM=y -# CONFIG_PM_LEGACY is not set +CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set # CONFIG_PM_SYSFS_DEPRECATED is not set CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR=y @@ -337,7 +346,6 @@ CONFIG_UNIX=y CONFIG_XFRM=y # CONFIG_XFRM_USER is not set # CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -572,7 +580,6 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0 # # Plug and Play support # -# CONFIG_PNPACPI is not set # # Block devices @@ -584,12 +591,14 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +# CONFIG_BLK_DEV_INITRD is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # Misc devices # +# CONFIG_TIFM_CORE is not set # # ATA/ATAPI/MFM/RLL support @@ -724,7 +733,7 @@ CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=39 # # CONFIG_AD9960 is not set # CONFIG_SPI_ADC_BF533 is not set -# CONFIG_BF5xx_PFLAGS is not set +# CONFIG_BF533_PFLAGS is not set # CONFIG_BF5xx_PPIFCD is not set # CONFIG_BF5xx_TIMERS is not set # CONFIG_BF5xx_PPI is not set @@ -733,8 +742,6 @@ CONFIG_BFIN_SPORT=y CONFIG_TWI_LCD=m CONFIG_TWI_LCD_SLAVE_ADDR=34 # CONFIG_AD5304 is not set -# CONFIG_BF5xx_TEA5764 is not set -# CONFIG_BF5xx_FBDMA is not set # CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -771,14 +778,7 @@ CONFIG_UNIX98_PTYS=y # # Watchdog Cards # -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -CONFIG_BFIN_WDT=y +# CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=y # CONFIG_GEN_RTC is not set CONFIG_BLACKFIN_DPMC=y @@ -840,13 +840,12 @@ CONFIG_SPI_MASTER=y # # SPI Master Controller Drivers # -CONFIG_SPI_BFIN=y # CONFIG_SPI_BITBANG is not set # # SPI Protocol Masters # -# CONFIG_SPI_AT25 is not set +CONFIG_SPI_BFIN=y # # Dallas's 1-wire bus @@ -862,7 +861,6 @@ CONFIG_HWMON=y # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ADM9240 is not set # CONFIG_SENSORS_ASB100 is not set @@ -901,11 +899,6 @@ CONFIG_HWMON=y # CONFIG_SENSORS_W83627EHF is not set # CONFIG_HWMON_DEBUG_CHIP is not set -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set - # # Multimedia devices # @@ -919,22 +912,15 @@ CONFIG_HWMON=y # # Graphics support # -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -CONFIG_FB=m CONFIG_FIRMWARE_EDID=y -# CONFIG_FB_DDC is not set +CONFIG_FB=m CONFIG_FB_CFB_FILLRECT=m CONFIG_FB_CFB_COPYAREA=m CONFIG_FB_CFB_IMAGEBLIT=m -# CONFIG_FB_SVGALIB is not set # CONFIG_FB_MACMODES is not set # CONFIG_FB_BACKLIGHT is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# CONFIG_FB_BFIN_7171=m CONFIG_FB_BFIN_7393=m CONFIG_NTSC=y @@ -952,6 +938,7 @@ CONFIG_ADV7393_1XMEM=y # Logo configuration # # CONFIG_LOGO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -983,18 +970,6 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set -# -# ALSA Blackfin devices -# -# CONFIG_SND_BLACKFIN_AD1836 is not set -# CONFIG_SND_BLACKFIN_AD1981B is not set -# CONFIG_SND_BFIN_AD73311 is not set - -# -# SoC audio support -# -# CONFIG_SND_SOC is not set - # # Open Sound System # @@ -1004,7 +979,6 @@ CONFIG_SND_VERBOSE_PROCFS=y # HID Devices # CONFIG_HID=y -# CONFIG_HID_DEBUG is not set # # USB support @@ -1077,6 +1051,7 @@ CONFIG_RTC_INTF_DEV=y # CONFIG_RTC_DRV_DS1672 is not set # CONFIG_RTC_DRV_DS1742 is not set # CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set # CONFIG_RTC_DRV_RS5C348 is not set # CONFIG_RTC_DRV_RS5C372 is not set # CONFIG_RTC_DRV_M48T86 is not set @@ -1098,10 +1073,6 @@ CONFIG_RTC_DRV_BFIN=y # DMA Devices # -# -# Auxiliary Display support -# - # # Virtualization # @@ -1114,9 +1085,13 @@ CONFIG_RTC_DRV_BFIN=y # # File systems # -# CONFIG_EXT2_FS is not set +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_POSIX_ACL is not set +# CONFIG_EXT2_FS_SECURITY is not set # CONFIG_EXT3_FS is not set # CONFIG_EXT4DEV_FS is not set +CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set @@ -1128,7 +1103,7 @@ CONFIG_RTC_DRV_BFIN=y CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y # CONFIG_QUOTA is not set -# CONFIG_DNOTIFY is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set @@ -1300,7 +1275,7 @@ CONFIG_ACCESS_CHECK=y # CONFIG_KEYS is not set CONFIG_SECURITY=y # CONFIG_SECURITY_NETWORK is not set -CONFIG_SECURITY_CAPABILITIES=m +CONFIG_SECURITY_CAPABILITIES=y # # Cryptographic options @@ -1318,5 +1293,4 @@ CONFIG_CRC32=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y +CONFIG_IOMAP_COPY=y diff --git a/trunk/arch/blackfin/configs/BF537-STAMP_defconfig b/trunk/arch/blackfin/configs/BF537-STAMP_defconfig index 37688bb55b9a..8ed67dc450fd 100644 --- a/trunk/arch/blackfin/configs/BF537-STAMP_defconfig +++ b/trunk/arch/blackfin/configs/BF537-STAMP_defconfig @@ -1,13 +1,12 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.21.3 +# Linux kernel version: 2.6.20.4 # # CONFIG_MMU is not set # CONFIG_FPU is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set CONFIG_BLACKFIN=y -CONFIG_ZONE_DMA=y CONFIG_BFIN=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_GENERIC_FIND_NEXT_BIT=y @@ -34,7 +33,6 @@ CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SYSVIPC=y # CONFIG_IPC_NS is not set -CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set @@ -43,7 +41,6 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_IKCONFIG is not set CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set -CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y @@ -58,7 +55,9 @@ CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y +CONFIG_EPOLL=y CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 +# CONFIG_LIMIT_PAGECACHE is not set CONFIG_BUDDY=y # CONFIG_NP2 is not set CONFIG_SLAB=y @@ -128,7 +127,6 @@ CONFIG_BFIN537_STAMP=y # CONFIG_BFIN537_BLUETECHNIX_CM is not set # CONFIG_BFIN561_BLUETECHNIX_CM is not set # CONFIG_BFIN561_EZKIT is not set -# CONFIG_BFIN561_TEPLA is not set # CONFIG_PNAV10 is not set # CONFIG_GENERIC_BOARD is not set CONFIG_MEM_MT48LC32M8A2_75=y @@ -197,6 +195,19 @@ CONFIG_MEM_SIZE=64 CONFIG_MEM_ADD_WIDTH=10 CONFIG_BOOT_LOAD=0x1000 +# +# Console UART Setup +# +# CONFIG_BAUD_9600 is not set +# CONFIG_BAUD_19200 is not set +# CONFIG_BAUD_38400 is not set +CONFIG_BAUD_57600=y +# CONFIG_BAUD_115200 is not set +CONFIG_BAUD_NO_PARITY=y +# CONFIG_BAUD_PARITY is not set +CONFIG_BAUD_1_STOPBIT=y +# CONFIG_BAUD_2_STOPBIT is not set + # # Blackfin Kernel Optimizations # @@ -225,7 +236,6 @@ CONFIG_MEMSET_L1=y CONFIG_MEMCPY_L1=y CONFIG_SYS_BFIN_SPINLOCK_L1=y # CONFIG_IP_CHECKSUM_L1 is not set -CONFIG_CACHELINE_ALIGNED_L1=y # CONFIG_SYSCALL_TAB_L1 is not set # CONFIG_CPLB_SWITCH_TAB_L1 is not set CONFIG_RAMKERNEL=y @@ -239,7 +249,6 @@ CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 CONFIG_LARGE_ALLOCS=y CONFIG_BFIN_DMA_5XX=y # CONFIG_DMA_UNCACHED_2M is not set @@ -312,7 +321,7 @@ CONFIG_BINFMT_ZFLAT=y # Power management options # CONFIG_PM=y -# CONFIG_PM_LEGACY is not set +CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set # CONFIG_PM_SYSFS_DEPRECATED is not set CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR=y @@ -340,7 +349,6 @@ CONFIG_UNIX=y CONFIG_XFRM=y # CONFIG_XFRM_USER is not set # CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -585,7 +593,6 @@ CONFIG_MTD_NAND_IDS=m # # Plug and Play support # -# CONFIG_PNPACPI is not set # # Block devices @@ -597,12 +604,14 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +# CONFIG_BLK_DEV_INITRD is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # Misc devices # +# CONFIG_TIFM_CORE is not set # # ATA/ATAPI/MFM/RLL support @@ -742,7 +751,7 @@ CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=72 # # CONFIG_AD9960 is not set # CONFIG_SPI_ADC_BF533 is not set -# CONFIG_BF5xx_PFLAGS is not set +# CONFIG_BF533_PFLAGS is not set # CONFIG_BF5xx_PPIFCD is not set # CONFIG_BF5xx_TIMERS is not set # CONFIG_BF5xx_PPI is not set @@ -751,8 +760,6 @@ CONFIG_BFIN_SPORT=y CONFIG_TWI_LCD=m CONFIG_TWI_LCD_SLAVE_ADDR=34 # CONFIG_AD5304 is not set -# CONFIG_BF5xx_TEA5764 is not set -# CONFIG_BF5xx_FBDMA is not set # CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -797,14 +804,7 @@ CONFIG_CAN_BLACKFIN=m # # Watchdog Cards # -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -CONFIG_BFIN_WDT=y +# CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=y # CONFIG_GEN_RTC is not set CONFIG_BLACKFIN_DPMC=y @@ -868,13 +868,12 @@ CONFIG_SPI_MASTER=y # # SPI Master Controller Drivers # -CONFIG_SPI_BFIN=y # CONFIG_SPI_BITBANG is not set # # SPI Protocol Masters # -# CONFIG_SPI_AT25 is not set +CONFIG_SPI_BFIN=y # # Dallas's 1-wire bus @@ -890,7 +889,6 @@ CONFIG_HWMON=y # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ADM9240 is not set # CONFIG_SENSORS_ASB100 is not set @@ -929,11 +927,6 @@ CONFIG_HWMON=y # CONFIG_SENSORS_W83627EHF is not set # CONFIG_HWMON_DEBUG_CHIP is not set -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set - # # Multimedia devices # @@ -947,24 +940,15 @@ CONFIG_HWMON=y # # Graphics support # -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_CLASS_DEVICE=m -CONFIG_LCD_CLASS_DEVICE=m -CONFIG_FB=m CONFIG_FIRMWARE_EDID=y -# CONFIG_FB_DDC is not set +CONFIG_FB=m CONFIG_FB_CFB_FILLRECT=m CONFIG_FB_CFB_COPYAREA=m CONFIG_FB_CFB_IMAGEBLIT=m -# CONFIG_FB_SVGALIB is not set # CONFIG_FB_MACMODES is not set # CONFIG_FB_BACKLIGHT is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# CONFIG_FB_BFIN_7171=m CONFIG_FB_BFIN_7393=m CONFIG_NTSC=y @@ -986,6 +970,11 @@ CONFIG_LQ035_SLAVE_ADDR=0x58 # Logo configuration # # CONFIG_LOGO is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=m +CONFIG_BACKLIGHT_DEVICE=y +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_DEVICE=y # # Sound @@ -1017,18 +1006,6 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set -# -# ALSA Blackfin devices -# -# CONFIG_SND_BLACKFIN_AD1836 is not set -# CONFIG_SND_BLACKFIN_AD1981B is not set -# CONFIG_SND_BFIN_AD73311 is not set - -# -# SoC audio support -# -# CONFIG_SND_SOC is not set - # # Open Sound System # @@ -1038,7 +1015,6 @@ CONFIG_SND_VERBOSE_PROCFS=y # HID Devices # CONFIG_HID=y -# CONFIG_HID_DEBUG is not set # # USB support @@ -1111,6 +1087,7 @@ CONFIG_RTC_INTF_DEV=y # CONFIG_RTC_DRV_DS1672 is not set # CONFIG_RTC_DRV_DS1742 is not set # CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set # CONFIG_RTC_DRV_RS5C348 is not set # CONFIG_RTC_DRV_RS5C372 is not set # CONFIG_RTC_DRV_M48T86 is not set @@ -1132,10 +1109,6 @@ CONFIG_RTC_DRV_BFIN=y # DMA Devices # -# -# Auxiliary Display support -# - # # Virtualization # @@ -1148,9 +1121,13 @@ CONFIG_RTC_DRV_BFIN=y # # File systems # -# CONFIG_EXT2_FS is not set +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_POSIX_ACL is not set +# CONFIG_EXT2_FS_SECURITY is not set # CONFIG_EXT3_FS is not set # CONFIG_EXT4DEV_FS is not set +CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set @@ -1162,7 +1139,7 @@ CONFIG_RTC_DRV_BFIN=y CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y # CONFIG_QUOTA is not set -# CONFIG_DNOTIFY is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set @@ -1334,7 +1311,7 @@ CONFIG_ACCESS_CHECK=y # CONFIG_KEYS is not set CONFIG_SECURITY=y # CONFIG_SECURITY_NETWORK is not set -CONFIG_SECURITY_CAPABILITIES=m +CONFIG_SECURITY_CAPABILITIES=y # # Cryptographic options @@ -1352,5 +1329,4 @@ CONFIG_CRC32=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y +CONFIG_IOMAP_COPY=y diff --git a/trunk/arch/blackfin/configs/BF561-EZKIT_defconfig b/trunk/arch/blackfin/configs/BF561-EZKIT_defconfig index fe4e67debaca..e32ca2072cbf 100644 --- a/trunk/arch/blackfin/configs/BF561-EZKIT_defconfig +++ b/trunk/arch/blackfin/configs/BF561-EZKIT_defconfig @@ -1,21 +1,20 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.21.3 +# Linux kernel version: 2.6.19.3 # # CONFIG_MMU is not set # CONFIG_FPU is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set CONFIG_BLACKFIN=y -CONFIG_ZONE_DMA=y CONFIG_BFIN=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y -# CONFIG_GENERIC_TIME is not set CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_UCLINUX=y CONFIG_FORCE_MAX_ZONEORDER=14 CONFIG_IRQCHIP_DEMUX_GPIO=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" @@ -34,21 +33,18 @@ CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SYSVIPC=y # CONFIG_IPC_NS is not set -CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set -CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set -CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y CONFIG_EMBEDDED=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_SYSCTL_SYSCALL=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set @@ -58,7 +54,9 @@ CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y +CONFIG_EPOLL=y CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 +# CONFIG_LIMIT_PAGECACHE is not set CONFIG_BUDDY=y # CONFIG_NP2 is not set CONFIG_SLAB=y @@ -82,9 +80,7 @@ CONFIG_KMOD=y # Block layer # CONFIG_BLOCK=y -# CONFIG_LBD is not set # CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set # # IO Schedulers @@ -113,6 +109,7 @@ CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_BF532 is not set # CONFIG_BF533 is not set # CONFIG_BF534 is not set +# CONFIG_BF535 is not set # CONFIG_BF536 is not set # CONFIG_BF537 is not set CONFIG_BF561=y @@ -128,7 +125,6 @@ CONFIG_BFIN_DUAL_CORE=y # CONFIG_BFIN537_BLUETECHNIX_CM is not set # CONFIG_BFIN561_BLUETECHNIX_CM is not set CONFIG_BFIN561_EZKIT=y -# CONFIG_BFIN561_TEPLA is not set # CONFIG_PNAV10 is not set # CONFIG_GENERIC_BOARD is not set CONFIG_MEM_MT48LC16M16A2TG_75=y @@ -218,7 +214,6 @@ CONFIG_IRQ_WDTIMER=13 # # Board customizations # -# CONFIG_CMDLINE_BOOL is not set # # Board Setup @@ -228,6 +223,19 @@ CONFIG_MEM_SIZE=64 CONFIG_MEM_ADD_WIDTH=9 CONFIG_BOOT_LOAD=0x1000 +# +# Console UART Setup +# +# CONFIG_BAUD_9600 is not set +# CONFIG_BAUD_19200 is not set +# CONFIG_BAUD_38400 is not set +CONFIG_BAUD_57600=y +# CONFIG_BAUD_115200 is not set +CONFIG_BAUD_NO_PARITY=y +# CONFIG_BAUD_PARITY is not set +CONFIG_BAUD_1_STOPBIT=y +# CONFIG_BAUD_2_STOPBIT is not set + # # Blackfin Kernel Optimizations # @@ -237,7 +245,6 @@ CONFIG_BOOT_LOAD=0x1000 # # CONFIG_HZ_100 is not set CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set # CONFIG_HZ_1000 is not set CONFIG_HZ=250 @@ -256,7 +263,6 @@ CONFIG_MEMSET_L1=y CONFIG_MEMCPY_L1=y CONFIG_SYS_BFIN_SPINLOCK_L1=y # CONFIG_IP_CHECKSUM_L1 is not set -CONFIG_CACHELINE_ALIGNED_L1=y # CONFIG_SYSCALL_TAB_L1 is not set # CONFIG_CPLB_SWITCH_TAB_L1 is not set CONFIG_RAMKERNEL=y @@ -270,7 +276,6 @@ CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 CONFIG_LARGE_ALLOCS=y CONFIG_BFIN_DMA_5XX=y # CONFIG_DMA_UNCACHED_2M is not set @@ -363,7 +368,6 @@ CONFIG_UNIX=y CONFIG_XFRM=y # CONFIG_XFRM_USER is not set # CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -390,7 +394,6 @@ CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set # CONFIG_IPV6 is not set # CONFIG_INET6_XFRM_TUNNEL is not set # CONFIG_INET6_TUNNEL is not set @@ -434,48 +437,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic" # # CONFIG_NET_PKTGEN is not set # CONFIG_HAMRADIO is not set -CONFIG_IRDA=m - -# -# IrDA protocols -# -CONFIG_IRLAN=m -CONFIG_IRCOMM=m -# CONFIG_IRDA_ULTRA is not set - -# -# IrDA options -# -CONFIG_IRDA_CACHE_LAST_LSAP=y -# CONFIG_IRDA_FAST_RR is not set -# CONFIG_IRDA_DEBUG is not set - -# -# Infrared-port device drivers -# - -# -# SIR device drivers -# -CONFIG_IRTTY_SIR=m - -# -# Dongle support -# -# CONFIG_DONGLE is not set - -# -# Old SIR device drivers -# -# CONFIG_IRPORT_SIR is not set - -# -# Old Serial dongle support -# - -# -# FIR device drivers -# +# CONFIG_IRDA is not set # CONFIG_BT is not set # CONFIG_IEEE80211 is not set @@ -510,7 +472,6 @@ CONFIG_MTD_PARTITIONS=y # User Modules And Translation Layers # CONFIG_MTD_CHAR=m -CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set @@ -567,8 +528,6 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0 # # Self-contained MTD device drivers # -# CONFIG_MTD_DATAFLASH is not set -# CONFIG_MTD_M25P80 is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set @@ -599,7 +558,6 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0 # # Plug and Play support # -# CONFIG_PNPACPI is not set # # Block devices @@ -611,12 +569,14 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +# CONFIG_BLK_DEV_INITRD is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # Misc devices # +# CONFIG_TIFM_CORE is not set # # ATA/ATAPI/MFM/RLL support @@ -715,26 +675,7 @@ CONFIG_SMC91X=y # # Input device support # -CONFIG_INPUT=m -# CONFIG_INPUT_FF_MEMLESS is not set - -# -# Userland interfaces -# -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_TSDEV is not set -CONFIG_INPUT_EVDEV=m -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set +# CONFIG_INPUT is not set # # Hardware I/O ports @@ -747,14 +688,12 @@ CONFIG_INPUT_EVDEV=m # # CONFIG_AD9960 is not set # CONFIG_SPI_ADC_BF533 is not set -# CONFIG_BF5xx_PFLAGS is not set +# CONFIG_BF533_PFLAGS is not set # CONFIG_BF5xx_PPIFCD is not set # CONFIG_BF5xx_TIMERS is not set # CONFIG_BF5xx_PPI is not set # CONFIG_BFIN_SPORT is not set # CONFIG_BFIN_TIMER_LATENCY is not set -# CONFIG_AD5304 is not set -# CONFIG_BF5xx_FBDMA is not set # CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -791,19 +730,16 @@ CONFIG_UNIX98_PTYS=y # # Watchdog Cards # -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -CONFIG_BFIN_WDT=y +# CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=y # CONFIG_GEN_RTC is not set # CONFIG_BLACKFIN_DPMC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set + +# +# Ftape, the floppy tape device driver +# # CONFIG_RAW_DRIVER is not set # @@ -819,19 +755,8 @@ CONFIG_HW_RANDOM=y # # SPI support # -CONFIG_SPI=y -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -CONFIG_SPI_BFIN=y -# CONFIG_SPI_BITBANG is not set - -# -# SPI Protocol Masters -# -# CONFIG_SPI_AT25 is not set +# CONFIG_SPI is not set +# CONFIG_SPI_MASTER is not set # # Dallas's 1-wire bus @@ -845,16 +770,9 @@ CONFIG_HWMON=y # CONFIG_HWMON_VID is not set # CONFIG_SENSORS_ABITUGURU is not set # CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_LM70 is not set -# CONFIG_SENSORS_PC87427 is not set # CONFIG_SENSORS_VT1211 is not set # CONFIG_HWMON_DEBUG_CHIP is not set -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set - # # Multimedia devices # @@ -868,20 +786,15 @@ CONFIG_HWMON=y # # Graphics support # -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set +CONFIG_FIRMWARE_EDID=y # CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound # # CONFIG_SOUND is not set -# -# HID Devices -# -CONFIG_HID=m -# CONFIG_HID_DEBUG is not set - # # USB support # @@ -902,7 +815,6 @@ CONFIG_USB_ARCH_HAS_HCD=y # # MMC/SD Card support # -# CONFIG_SPI_MMC is not set # CONFIG_MMC is not set # @@ -944,14 +856,6 @@ CONFIG_USB_ARCH_HAS_HCD=y # DMA Devices # -# -# Auxiliary Display support -# - -# -# Virtualization -# - # # PBX support # @@ -960,9 +864,13 @@ CONFIG_USB_ARCH_HAS_HCD=y # # File systems # -# CONFIG_EXT2_FS is not set +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_POSIX_ACL is not set +# CONFIG_EXT2_FS_SECURITY is not set # CONFIG_EXT3_FS is not set # CONFIG_EXT4DEV_FS is not set +CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set @@ -974,7 +882,7 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y # CONFIG_QUOTA is not set -# CONFIG_DNOTIFY is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set @@ -1023,6 +931,7 @@ CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10 # CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set # CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y +# CONFIG_JFFS_FS is not set CONFIG_JFFS2_FS=m CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y @@ -1112,11 +1021,6 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set -# -# Distributed Lock Manager -# -# CONFIG_DLM is not set - # # Profiling support # @@ -1129,17 +1033,20 @@ CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_ENABLE_MUST_CHECK=y # CONFIG_MAGIC_SYSRQ is not set # CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_UNWIND_INFO is not set +# CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_SERIAL_EARLY_INIT is not set CONFIG_DEBUG_HUNT_FOR_ZERO=y # CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set # CONFIG_DUAL_CORE_TEST_MODULE is not set +# CONFIG_BOOTPARAM is not set +# CONFIG_NO_KERNEL_MSG is not set CONFIG_CPLB_INFO=y -CONFIG_ACCESS_CHECK=y +# CONFIG_NO_ACCESS_CHECK is not set # # Security options @@ -1147,7 +1054,7 @@ CONFIG_ACCESS_CHECK=y # CONFIG_KEYS is not set CONFIG_SECURITY=y # CONFIG_SECURITY_NETWORK is not set -CONFIG_SECURITY_CAPABILITIES=m +CONFIG_SECURITY_CAPABILITIES=y # # Cryptographic options @@ -1157,13 +1064,10 @@ CONFIG_SECURITY_CAPABILITIES=m # # Library routines # -CONFIG_BITREVERSE=y -CONFIG_CRC_CCITT=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y diff --git a/trunk/arch/blackfin/configs/PNAV-10_defconfig b/trunk/arch/blackfin/configs/PNAV-10_defconfig index a783ff69ace1..97b4ffa2b4ac 100644 --- a/trunk/arch/blackfin/configs/PNAV-10_defconfig +++ b/trunk/arch/blackfin/configs/PNAV-10_defconfig @@ -1,21 +1,20 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.21.3 +# Linux kernel version: 2.6.19.3 # # CONFIG_MMU is not set # CONFIG_FPU is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set CONFIG_BLACKFIN=y -CONFIG_ZONE_DMA=y CONFIG_BFIN=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y -# CONFIG_GENERIC_TIME is not set CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_UCLINUX=y CONFIG_FORCE_MAX_ZONEORDER=14 CONFIG_IRQCHIP_DEMUX_GPIO=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" @@ -34,16 +33,14 @@ CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SYSVIPC=y # CONFIG_IPC_NS is not set -CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set -CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set -# CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y CONFIG_EMBEDDED=y @@ -57,7 +54,9 @@ CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y +CONFIG_EPOLL=y CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=9 +# CONFIG_LIMIT_PAGECACHE is not set CONFIG_BUDDY=y # CONFIG_NP2 is not set CONFIG_SLAB=y @@ -81,9 +80,7 @@ CONFIG_KMOD=y # Block layer # CONFIG_BLOCK=y -# CONFIG_LBD is not set # CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set # # IO Schedulers @@ -112,6 +109,7 @@ CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_BF532 is not set # CONFIG_BF533 is not set # CONFIG_BF534 is not set +# CONFIG_BF535 is not set # CONFIG_BF536 is not set CONFIG_BF537=y # CONFIG_BF561 is not set @@ -127,7 +125,6 @@ CONFIG_BFIN_SINGLE_CORE=y # CONFIG_BFIN537_BLUETECHNIX_CM is not set # CONFIG_BFIN561_BLUETECHNIX_CM is not set # CONFIG_BFIN561_EZKIT is not set -# CONFIG_BFIN561_TEPLA is not set CONFIG_PNAV10=y # CONFIG_GENERIC_BOARD is not set CONFIG_MEM_MT48LC32M8A2_75=y @@ -186,7 +183,6 @@ CONFIG_IRQ_WATCH=13 # # Board customizations # -# CONFIG_CMDLINE_BOOL is not set # # Board Setup @@ -196,6 +192,19 @@ CONFIG_MEM_SIZE=64 CONFIG_MEM_ADD_WIDTH=10 CONFIG_BOOT_LOAD=0x1000 +# +# Console UART Setup +# +# CONFIG_BAUD_9600 is not set +# CONFIG_BAUD_19200 is not set +# CONFIG_BAUD_38400 is not set +# CONFIG_BAUD_57600 is not set +CONFIG_BAUD_115200=y +CONFIG_BAUD_NO_PARITY=y +# CONFIG_BAUD_PARITY is not set +CONFIG_BAUD_1_STOPBIT=y +# CONFIG_BAUD_2_STOPBIT is not set + # # Blackfin Kernel Optimizations # @@ -205,7 +214,6 @@ CONFIG_BOOT_LOAD=0x1000 # # CONFIG_HZ_100 is not set CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set # CONFIG_HZ_1000 is not set CONFIG_HZ=250 @@ -224,7 +232,6 @@ CONFIG_MEMSET_L1=y CONFIG_MEMCPY_L1=y CONFIG_SYS_BFIN_SPINLOCK_L1=y CONFIG_IP_CHECKSUM_L1=y -CONFIG_CACHELINE_ALIGNED_L1=y CONFIG_SYSCALL_TAB_L1=y CONFIG_CPLB_SWITCH_TAB_L1=y CONFIG_RAMKERNEL=y @@ -238,7 +245,6 @@ CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 CONFIG_LARGE_ALLOCS=y CONFIG_BFIN_DMA_5XX=y # CONFIG_DMA_UNCACHED_2M is not set @@ -332,7 +338,6 @@ CONFIG_UNIX=y CONFIG_XFRM=y # CONFIG_XFRM_USER is not set # CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -359,7 +364,6 @@ CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set # CONFIG_IPV6 is not set # CONFIG_INET6_XFRM_TUNNEL is not set # CONFIG_INET6_TUNNEL is not set @@ -438,7 +442,6 @@ CONFIG_MTD_PARTITIONS=y # User Modules And Translation Layers # CONFIG_MTD_CHAR=m -CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set @@ -519,7 +522,6 @@ CONFIG_MTD_NAND_IDS=y # # Plug and Play support # -# CONFIG_PNPACPI is not set # # Block devices @@ -531,12 +533,14 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +# CONFIG_BLK_DEV_INITRD is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # Misc devices # +# CONFIG_TIFM_CORE is not set # # ATA/ATAPI/MFM/RLL support @@ -670,7 +674,6 @@ CONFIG_TOUCHSCREEN_AD7877=y # CONFIG_TOUCHSCREEN_PENMOUNT is not set # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set # CONFIG_TOUCHSCREEN_TOUCHWIN is not set -# CONFIG_TOUCHSCREEN_UCB1400 is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_UINPUT=y # CONFIG_BF53X_PFBUTTONS is not set @@ -687,7 +690,7 @@ CONFIG_INPUT_UINPUT=y # # CONFIG_AD9960 is not set # CONFIG_SPI_ADC_BF533 is not set -# CONFIG_BF5xx_PFLAGS is not set +# CONFIG_BF533_PFLAGS is not set # CONFIG_BF5xx_PPIFCD is not set # CONFIG_BF5xx_TIMERS is not set # CONFIG_BF5xx_PPI is not set @@ -696,8 +699,6 @@ CONFIG_BFIN_SPORT=y CONFIG_TWI_LCD=m CONFIG_TWI_LCD_SLAVE_ADDR=34 # CONFIG_AD5304 is not set -# CONFIG_BF5xx_TEA5764 is not set -# CONFIG_BF5xx_FBDMA is not set # CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -749,6 +750,10 @@ CONFIG_HW_RANDOM=y CONFIG_BLACKFIN_DPMC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set + +# +# Ftape, the floppy tape device driver +# # CONFIG_RAW_DRIVER is not set # @@ -772,9 +777,9 @@ CONFIG_I2C_CHARDEV=y # # I2C Hardware Bus support # -# CONFIG_I2C_BLACKFIN_GPIO is not set -CONFIG_I2C_BLACKFIN_TWI=y -CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 +# CONFIG_I2C_BFIN_GPIO is not set +CONFIG_I2C_BFIN_TWI=y +CONFIG_TWICLK_KHZ=50 # CONFIG_I2C_OCORES is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_STUB is not set @@ -807,13 +812,12 @@ CONFIG_SPI_MASTER=y # # SPI Master Controller Drivers # -CONFIG_SPI_BFIN=y # CONFIG_SPI_BITBANG is not set +CONFIG_SPI_BFIN=y # # SPI Protocol Masters # -# CONFIG_SPI_AT25 is not set # # Dallas's 1-wire bus @@ -829,7 +833,6 @@ CONFIG_HWMON=y # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ADM9240 is not set # CONFIG_SENSORS_ASB100 is not set @@ -854,7 +857,6 @@ CONFIG_HWMON=y # CONFIG_SENSORS_LM92 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_SMSC47M192 is not set # CONFIG_SENSORS_SMSC47B397 is not set @@ -862,17 +864,11 @@ CONFIG_HWMON=y # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83791D is not set # CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set # CONFIG_SENSORS_W83627EHF is not set # CONFIG_HWMON_DEBUG_CHIP is not set -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set - # # Multimedia devices # @@ -886,24 +882,15 @@ CONFIG_HWMON=y # # Graphics support # -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_LCD_CLASS_DEVICE=y -CONFIG_FB=y CONFIG_FIRMWARE_EDID=y -# CONFIG_FB_DDC is not set +CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y -# CONFIG_FB_SVGALIB is not set # CONFIG_FB_MACMODES is not set # CONFIG_FB_BACKLIGHT is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# # CONFIG_FB_BFIN_7171 is not set # CONFIG_FB_BFIN_7393 is not set CONFIG_FB_BF537_LQ035=y @@ -917,6 +904,11 @@ CONFIG_FB_BFIN_LANDSCAPE=y # Logo configuration # # CONFIG_LOGO is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_DEVICE=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_LCD_DEVICE=y # # Sound @@ -953,24 +945,14 @@ CONFIG_SND_PCM=m CONFIG_SND_BLACKFIN_AD1981B=m # CONFIG_SND_BFIN_AD73311 is not set -# -# SoC audio support -# -# CONFIG_SND_SOC is not set - # # Open Sound System # CONFIG_SOUND_PRIME=y -# CONFIG_OBSOLETE_OSS is not set +CONFIG_OSS_OBSOLETE_DRIVER=y # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set -# -# HID Devices -# -# CONFIG_HID is not set - # # USB support # @@ -1042,6 +1024,7 @@ CONFIG_RTC_INTF_DEV=y # CONFIG_RTC_DRV_DS1672 is not set # CONFIG_RTC_DRV_DS1742 is not set # CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set # CONFIG_RTC_DRV_RS5C348 is not set # CONFIG_RTC_DRV_RS5C372 is not set # CONFIG_RTC_DRV_M48T86 is not set @@ -1063,14 +1046,6 @@ CONFIG_RTC_DRV_BFIN=y # DMA Devices # -# -# Auxiliary Display support -# - -# -# Virtualization -# - # # PBX support # @@ -1146,6 +1121,7 @@ CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10 # CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set # CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y +# CONFIG_JFFS_FS is not set # CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set @@ -1227,11 +1203,6 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set -# -# Distributed Lock Manager -# -# CONFIG_DLM is not set - # # Profiling support # @@ -1244,16 +1215,19 @@ CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_ENABLE_MUST_CHECK=y # CONFIG_MAGIC_SYSRQ is not set # CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_UNWIND_INFO is not set +# CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_SERIAL_EARLY_INIT is not set # CONFIG_DEBUG_HUNT_FOR_ZERO is not set # CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set +# CONFIG_BOOTPARAM is not set +# CONFIG_NO_KERNEL_MSG is not set # CONFIG_CPLB_INFO is not set -# CONFIG_ACCESS_CHECK is not set +# CONFIG_NO_ACCESS_CHECK is not set # # Security options @@ -1271,12 +1245,9 @@ CONFIG_SECURITY_CAPABILITIES=y # # Library routines # -CONFIG_BITREVERSE=y CONFIG_CRC_CCITT=m # CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y diff --git a/trunk/arch/blackfin/defconfig b/trunk/arch/blackfin/defconfig new file mode 100644 index 000000000000..a513fbe39567 --- /dev/null +++ b/trunk/arch/blackfin/defconfig @@ -0,0 +1,1327 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.20.4 +# +# CONFIG_MMU is not set +# CONFIG_FPU is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_BLACKFIN=y +CONFIG_BFIN=y +CONFIG_SEMAPHORE_SLEEPERS=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +# CONFIG_GENERIC_TIME is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_FORCE_MAX_ZONEORDER=14 +CONFIG_IRQCHIP_DEMUX_GPIO=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SYSVIPC=y +# CONFIG_IPC_NS is not set +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_UTS_NS is not set +# CONFIG_AUDIT is not set +# CONFIG_IKCONFIG is not set +CONFIG_SYSFS_DEPRECATED=y +# CONFIG_RELAY is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 +# CONFIG_LIMIT_PAGECACHE is not set +CONFIG_BUDDY=y +# CONFIG_NP2 is not set +CONFIG_SLAB=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_RT_MUTEXES=y +CONFIG_TINY_SHMEM=y +CONFIG_BASE_SMALL=0 +# CONFIG_SLOB is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + +# +# Block layer +# +CONFIG_BLOCK=y +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_AS=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="anticipatory" +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +# CONFIG_PREEMPT is not set + +# +# Blackfin Processor Options +# + +# +# Processor and Board Settings +# +# CONFIG_BF531 is not set +# CONFIG_BF532 is not set +# CONFIG_BF533 is not set +# CONFIG_BF534 is not set +# CONFIG_BF536 is not set +CONFIG_BF537=y +# CONFIG_BF561 is not set +CONFIG_BF_REV_0_2=y +# CONFIG_BF_REV_0_3 is not set +# CONFIG_BF_REV_0_4 is not set +# CONFIG_BF_REV_0_5 is not set +CONFIG_BFIN_SINGLE_CORE=y +# CONFIG_BFIN533_EZKIT is not set +# CONFIG_BFIN533_STAMP is not set +CONFIG_BFIN537_STAMP=y +# CONFIG_BFIN533_BLUETECHNIX_CM is not set +# CONFIG_BFIN537_BLUETECHNIX_CM is not set +# CONFIG_BFIN561_BLUETECHNIX_CM is not set +# CONFIG_BFIN561_EZKIT is not set +# CONFIG_PNAV10 is not set +# CONFIG_GENERIC_BOARD is not set +CONFIG_MEM_MT48LC32M8A2_75=y +CONFIG_IRQ_PLL_WAKEUP=7 + +# +# BF537 Specific Configuration +# + +# +# PORT F/G Selection +# +CONFIG_BF537_PORT_F=y +# CONFIG_BF537_PORT_G is not set +# CONFIG_BF537_PORT_H is not set + +# +# Interrupt Priority Assignment +# + +# +# Priority +# +CONFIG_IRQ_DMA_ERROR=7 +CONFIG_IRQ_ERROR=7 +CONFIG_IRQ_RTC=8 +CONFIG_IRQ_PPI=8 +CONFIG_IRQ_SPORT0_RX=9 +CONFIG_IRQ_SPORT0_TX=9 +CONFIG_IRQ_SPORT1_RX=9 +CONFIG_IRQ_SPORT1_TX=9 +CONFIG_IRQ_TWI=10 +CONFIG_IRQ_SPI=10 +CONFIG_IRQ_UART0_RX=10 +CONFIG_IRQ_UART0_TX=10 +CONFIG_IRQ_UART1_RX=10 +CONFIG_IRQ_UART1_TX=10 +CONFIG_IRQ_CAN_RX=11 +CONFIG_IRQ_CAN_TX=11 +CONFIG_IRQ_MAC_RX=11 +CONFIG_IRQ_MAC_TX=11 +CONFIG_IRQ_TMR0=12 +CONFIG_IRQ_TMR1=12 +CONFIG_IRQ_TMR2=12 +CONFIG_IRQ_TMR3=12 +CONFIG_IRQ_TMR4=12 +CONFIG_IRQ_TMR5=12 +CONFIG_IRQ_TMR6=12 +CONFIG_IRQ_TMR7=12 +CONFIG_IRQ_PROG_INTA=12 +CONFIG_IRQ_PORTG_INTB=12 +CONFIG_IRQ_MEM_DMA0=13 +CONFIG_IRQ_MEM_DMA1=13 +CONFIG_IRQ_WATCH=13 + +# +# Board customizations +# +# CONFIG_CMDLINE_BOOL is not set + +# +# Board Setup +# +CONFIG_CLKIN_HZ=25000000 +CONFIG_MEM_SIZE=64 +CONFIG_MEM_ADD_WIDTH=10 +CONFIG_BOOT_LOAD=0x1000 + +# +# Console UART Setup +# +# CONFIG_BAUD_9600 is not set +# CONFIG_BAUD_19200 is not set +# CONFIG_BAUD_38400 is not set +CONFIG_BAUD_57600=y +# CONFIG_BAUD_115200 is not set +CONFIG_BAUD_NO_PARITY=y +# CONFIG_BAUD_PARITY is not set +CONFIG_BAUD_1_STOPBIT=y +# CONFIG_BAUD_2_STOPBIT is not set + +# +# Blackfin Kernel Optimizations +# + +# +# Timer Tick +# +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_300 is not set +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 + +# +# Memory Optimizations +# +CONFIG_I_ENTRY_L1=y +CONFIG_EXCPT_IRQ_SYSC_L1=y +CONFIG_DO_IRQ_L1=y +CONFIG_CORE_TIMER_IRQ_L1=y +CONFIG_IDLE_L1=y +CONFIG_SCHEDULE_L1=y +CONFIG_ARITHMETIC_OPS_L1=y +CONFIG_ACCESS_OK_L1=y +CONFIG_MEMSET_L1=y +CONFIG_MEMCPY_L1=y +CONFIG_SYS_BFIN_SPINLOCK_L1=y +# CONFIG_IP_CHECKSUM_L1 is not set +# CONFIG_SYSCALL_TAB_L1 is not set +# CONFIG_CPLB_SWITCH_TAB_L1 is not set +CONFIG_RAMKERNEL=y +# CONFIG_ROMKERNEL is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_RESOURCES_64BIT is not set +CONFIG_LARGE_ALLOCS=y +CONFIG_BFIN_DMA_5XX=y +# CONFIG_DMA_UNCACHED_2M is not set +CONFIG_DMA_UNCACHED_1M=y +# CONFIG_DMA_UNCACHED_NONE is not set + +# +# Cache Support +# +CONFIG_BLKFIN_CACHE=y +CONFIG_BLKFIN_DCACHE=y +# CONFIG_BLKFIN_DCACHE_BANKA is not set +# CONFIG_BLKFIN_CACHE_LOCK is not set +# CONFIG_BLKFIN_WB is not set +CONFIG_BLKFIN_WT=y +CONFIG_L1_MAX_PIECE=16 + +# +# Clock Settings +# +# CONFIG_BFIN_KERNEL_CLOCK is not set + +# +# Asynchonous Memory Configuration +# + +# +# EBIU_AMBCTL Global Control +# +CONFIG_C_AMCKEN=y +CONFIG_C_CDPRIO=y +# CONFIG_C_AMBEN is not set +# CONFIG_C_AMBEN_B0 is not set +# CONFIG_C_AMBEN_B0_B1 is not set +# CONFIG_C_AMBEN_B0_B1_B2 is not set +CONFIG_C_AMBEN_ALL=y + +# +# EBIU_AMBCTL Control +# +CONFIG_BANK_0=0x7BB0 +CONFIG_BANK_1=0x7BB0 +CONFIG_BANK_2=0x7BB0 +CONFIG_BANK_3=0x99B3 + +# +# Bus options (PCI, PCMCIA, EISA, MCA, ISA) +# +# CONFIG_PCI is not set + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PCI Hotplug Support +# + +# +# Executable file formats +# +CONFIG_BINFMT_ELF_FDPIC=y +CONFIG_BINFMT_FLAT=y +CONFIG_BINFMT_ZFLAT=y +# CONFIG_BINFMT_SHARED_FLAT is not set +# CONFIG_BINFMT_MISC is not set + +# +# Power management options +# +CONFIG_PM=y +CONFIG_PM_LEGACY=y +# CONFIG_PM_DEBUG is not set +# CONFIG_PM_SYSFS_DEPRECATED is not set +CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR=y +# CONFIG_PM_WAKEUP_BY_GPIO is not set +# CONFIG_PM_WAKEUP_GPIO_API is not set +CONFIG_PM_WAKEUP_SIC_IWR=0x80000000 + +# +# CPU Frequency scaling +# +# CONFIG_CPU_FREQ is not set + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +# CONFIG_NETDEBUG is not set +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_UNIX=y +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_NET_KEY is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_PNP=y +# CONFIG_IP_PNP_DHCP is not set +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_INET_XFRM_MODE_TRANSPORT=y +CONFIG_INET_XFRM_MODE_TUNNEL=y +CONFIG_INET_XFRM_MODE_BEET=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_IPV6 is not set +# CONFIG_INET6_XFRM_TUNNEL is not set +# CONFIG_INET6_TUNNEL is not set +# CONFIG_NETLABEL is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETFILTER is not set + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set + +# +# TIPC Configuration (EXPERIMENTAL) +# +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +CONFIG_IRDA=m + +# +# IrDA protocols +# +CONFIG_IRLAN=m +CONFIG_IRCOMM=m +# CONFIG_IRDA_ULTRA is not set + +# +# IrDA options +# +CONFIG_IRDA_CACHE_LAST_LSAP=y +# CONFIG_IRDA_FAST_RR is not set +# CONFIG_IRDA_DEBUG is not set + +# +# Infrared-port device drivers +# + +# +# SIR device drivers +# +CONFIG_IRTTY_SIR=m + +# +# Dongle support +# +# CONFIG_DONGLE is not set + +# +# Old SIR device drivers +# +# CONFIG_IRPORT_SIR is not set + +# +# Old Serial dongle support +# + +# +# FIR device drivers +# +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set +# CONFIG_SYS_HYPERVISOR is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=m +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +CONFIG_MTD_JEDECPROBE=m +CONFIG_MTD_GEN_PROBE=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_CFI_INTELEXT is not set +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_MW320D=m +CONFIG_MTD_RAM=y +CONFIG_MTD_ROM=m +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_OBSOLETE_CHIPS is not set + +# +# Mapping drivers for chip access +# +CONFIG_MTD_COMPLEX_MAPPINGS=y +# CONFIG_MTD_PHYSMAP is not set +CONFIG_MTD_BF5xx=m +CONFIG_BFIN_FLASH_SIZE=0x400000 +CONFIG_EBIU_FLASH_BASE=0x20000000 + +# +# FLASH_EBIU_AMBCTL Control +# +CONFIG_BFIN_FLASH_BANK_0=0x7BB0 +CONFIG_BFIN_FLASH_BANK_1=0x7BB0 +CONFIG_BFIN_FLASH_BANK_2=0x7BB0 +CONFIG_BFIN_FLASH_BANK_3=0x7BB0 +CONFIG_MTD_UCLINUX=y +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_DATAFLASH is not set +# CONFIG_MTD_M25P80 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set + +# +# NAND Flash Device Drivers +# +CONFIG_MTD_NAND=m +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND_BFIN=m +CONFIG_BFIN_NAND_BASE=0x20212000 +CONFIG_BFIN_NAND_CLE=2 +CONFIG_BFIN_NAND_ALE=1 +CONFIG_BFIN_NAND_READY=3 +CONFIG_MTD_NAND_IDS=m +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_NANDSIM is not set + +# +# OneNAND Flash Device Drivers +# +# CONFIG_MTD_ONENAND is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# Block devices +# +# CONFIG_BLK_DEV_COW_COMMON is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set + +# +# Misc devices +# +# CONFIG_TIFM_CORE is not set + +# +# ATA/ATAPI/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_NETLINK is not set + +# +# Serial ATA (prod) and Parallel ATA (experimental) drivers +# +# CONFIG_ATA is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# I2O device support +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_SMC91X is not set +CONFIG_BFIN_MAC=y +CONFIG_BFIN_MAC_USE_L1=y +CONFIG_BFIN_TX_DESC_NUM=10 +CONFIG_BFIN_RX_DESC_NUM=20 +# CONFIG_BFIN_MAC_RMII is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +CONFIG_INPUT_EVDEV=m +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_UINPUT is not set +# CONFIG_BF53X_PFBUTTONS is not set +CONFIG_TWI_KEYPAD=m +CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=72 + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +# CONFIG_AD9960 is not set +# CONFIG_SPI_ADC_BF533 is not set +# CONFIG_BF533_PFLAGS is not set +# CONFIG_BF5xx_PPIFCD is not set +# CONFIG_BF5xx_TIMERS is not set +# CONFIG_BF5xx_PPI is not set +CONFIG_BFIN_SPORT=y +# CONFIG_BFIN_TIMER_LATENCY is not set +CONFIG_TWI_LCD=m +CONFIG_TWI_LCD_SLAVE_ADDR=34 +# CONFIG_AD5304 is not set +# CONFIG_VT is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_BFIN=y +CONFIG_SERIAL_BFIN_CONSOLE=y +CONFIG_SERIAL_BFIN_DMA=y +# CONFIG_SERIAL_BFIN_PIO is not set +CONFIG_SERIAL_BFIN_UART0=y +# CONFIG_BFIN_UART0_CTSRTS is not set +# CONFIG_SERIAL_BFIN_UART1 is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_BFIN_SPORT is not set +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set + +# +# CAN, the car bus and industrial fieldbus +# +CONFIG_CAN4LINUX=y + +# +# linux embedded drivers +# +# CONFIG_CAN_MCF5282 is not set +# CONFIG_CAN_UNCTWINCAN is not set +CONFIG_CAN_BLACKFIN=m + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +CONFIG_HW_RANDOM=y +# CONFIG_GEN_RTC is not set +CONFIG_BLACKFIN_DPMC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_RAW_DRIVER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set + +# +# I2C support +# +CONFIG_I2C=m +CONFIG_I2C_CHARDEV=m + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_BLACKFIN_GPIO is not set +# CONFIG_I2C_BLACKFIN_TWI is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +CONFIG_SENSORS_AD5252=m +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8575 is not set +# CONFIG_SENSORS_PCA9543 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# SPI support +# +CONFIG_SPI=y +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +# CONFIG_SPI_BITBANG is not set + +# +# SPI Protocol Masters +# +CONFIG_SPI_BFIN=y + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Hardware Monitoring support +# +CONFIG_HWMON=y +# CONFIG_HWMON_VID is not set +# CONFIG_SENSORS_ABITUGURU is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_FSCPOS is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM70 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47M192 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83791D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +CONFIG_FIRMWARE_EDID=y +CONFIG_FB=m +CONFIG_FB_CFB_FILLRECT=m +CONFIG_FB_CFB_COPYAREA=m +CONFIG_FB_CFB_IMAGEBLIT=m +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set +CONFIG_FB_BFIN_7171=m +CONFIG_FB_BFIN_7393=m +CONFIG_NTSC=y +# CONFIG_PAL is not set +# CONFIG_NTSC_640x480 is not set +# CONFIG_PAL_640x480 is not set +# CONFIG_NTSC_YCBCR is not set +# CONFIG_PAL_YCBCR is not set +CONFIG_ADV7393_1XMEM=y +# CONFIG_ADV7393_2XMEM is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Logo configuration +# +# CONFIG_LOGO is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=m +CONFIG_BACKLIGHT_DEVICE=y +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_DEVICE=y + +# +# Sound +# +CONFIG_SOUND=m + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +# CONFIG_SND_SEQUENCER is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_VERBOSE_PROCFS=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +# CONFIG_SND_DUMMY is not set +# CONFIG_SND_MTPAV is not set +# CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_MPU401 is not set + +# +# Open Sound System +# +# CONFIG_SOUND_PRIME is not set + +# +# HID Devices +# +CONFIG_HID=y + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +# CONFIG_USB_ARCH_HAS_OHCI is not set +# CONFIG_USB_ARCH_HAS_EHCI is not set +# CONFIG_USB is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_SPI_MMC is not set +# CONFIG_MMC is not set + +# +# LED devices +# +# CONFIG_NEW_LEDS is not set + +# +# LED drivers +# + +# +# LED Triggers +# + +# +# InfiniBand support +# + +# +# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) +# + +# +# Real Time Clock +# +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +# CONFIG_RTC_DEBUG is not set + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set + +# +# RTC drivers +# +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set +# CONFIG_RTC_DRV_RS5C348 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_TEST is not set +# CONFIG_RTC_DRV_MAX6902 is not set +# CONFIG_RTC_DRV_V3020 is not set +CONFIG_RTC_DRV_BFIN=y + +# +# DMA Engine support +# +# CONFIG_DMA_ENGINE is not set + +# +# DMA Clients +# + +# +# DMA Devices +# + +# +# Virtualization +# + +# +# PBX support +# +# CONFIG_PBX is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_POSIX_ACL is not set +# CONFIG_EXT2_FS_SECURITY is not set +# CONFIG_EXT3_FS is not set +# CONFIG_EXT4DEV_FS is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +# CONFIG_TMPFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y +# CONFIG_CONFIGFS_FS is not set + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_YAFFS_FS=m +CONFIG_YAFFS_YAFFS1=y +# CONFIG_YAFFS_DOES_ECC is not set +CONFIG_YAFFS_YAFFS2=y +CONFIG_YAFFS_AUTO_YAFFS2=y +# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set +CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10 +# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set +# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set +CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFSD is not set +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=m +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_9P_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y + +# +# Native Language Support +# +CONFIG_NLS=m +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Distributed Lock Manager +# +# CONFIG_DLM is not set + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_MUST_CHECK=y +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_KERNEL is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set +CONFIG_DEBUG_HUNT_FOR_ZERO=y +# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set +CONFIG_CPLB_INFO=y +CONFIG_ACCESS_CHECK=y + +# +# Security options +# +# CONFIG_KEYS is not set +CONFIG_SECURITY=y +# CONFIG_SECURITY_NETWORK is not set +CONFIG_SECURITY_CAPABILITIES=y + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_PLIST=y +CONFIG_IOMAP_COPY=y diff --git a/trunk/arch/blackfin/kernel/bfin_dma_5xx.c b/trunk/arch/blackfin/kernel/bfin_dma_5xx.c index 069a896a8f26..0ccb0dc3f833 100644 --- a/trunk/arch/blackfin/kernel/bfin_dma_5xx.c +++ b/trunk/arch/blackfin/kernel/bfin_dma_5xx.c @@ -595,7 +595,7 @@ unsigned short get_dma_curr_ycount(unsigned int channel) } EXPORT_SYMBOL(get_dma_curr_ycount); -static void *__dma_memcpy(void *dest, const void *src, size_t size) +void *_dma_memcpy(void *dest, const void *src, size_t size) { int direction; /* 1 - address decrease, 0 - address increase */ int flag_align; /* 1 - address aligned, 0 - address unaligned */ @@ -744,8 +744,8 @@ void *dma_memcpy(void *dest, const void *src, size_t size) bulk = (size >> 16) << 16; rest = size - bulk; if (bulk) - __dma_memcpy(dest, src, bulk); - addr = __dma_memcpy(dest+bulk, src+bulk, rest); + _dma_memcpy(dest, src, bulk); + addr = _dma_memcpy(dest+bulk, src+bulk, rest); return addr; } diff --git a/trunk/arch/blackfin/kernel/bfin_gpio.c b/trunk/arch/blackfin/kernel/bfin_gpio.c index bb1f4fb2467c..3f49fae1cb1f 100644 --- a/trunk/arch/blackfin/kernel/bfin_gpio.c +++ b/trunk/arch/blackfin/kernel/bfin_gpio.c @@ -138,7 +138,7 @@ static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG0_INT inline int check_gpio(unsigned short gpio) { - if (gpio >= MAX_BLACKFIN_GPIOS) + if (gpio > MAX_BLACKFIN_GPIOS) return -EINVAL; return 0; } @@ -494,24 +494,19 @@ u32 gpio_pm_setup(void) gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir; gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge; gpio_bank_saved[bank].both = gpio_bankb[bank]->both; - gpio_bank_saved[bank].reserved = reserved_map[bank]; gpio = i; while (mask) { if (mask & 1) { - reserved_map[gpio_bank(gpio)] |= - gpio_bit(gpio); - bfin_gpio_wakeup_type(gpio, - wakeup_flags_map[gpio]); + bfin_gpio_wakeup_type(gpio, wakeup_flags_map[gpio]); set_gpio_data(gpio, 0); /*Clear*/ } gpio++; mask >>= 1; } - sic_iwr |= 1 << - (sic_iwr_irqs[bank] - (IRQ_CORETMR + 1)); + sic_iwr |= 1 << (sic_iwr_irqs[bank] - (IRQ_CORETMR + 1)); gpio_bankb[bank]->maskb_set = wakeup_map[gpio_bank(i)]; } } @@ -540,9 +535,6 @@ void gpio_pm_restore(void) gpio_bankb[bank]->polar = gpio_bank_saved[bank].polar; gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge; gpio_bankb[bank]->both = gpio_bank_saved[bank].both; - - reserved_map[bank] = gpio_bank_saved[bank].reserved; - } gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb; diff --git a/trunk/arch/blackfin/kernel/entry.S b/trunk/arch/blackfin/kernel/entry.S index 65c5ba4260b0..5880b270bd50 100644 --- a/trunk/arch/blackfin/kernel/entry.S +++ b/trunk/arch/blackfin/kernel/entry.S @@ -58,12 +58,10 @@ ENTRY(_ret_from_fork) RESTORE_ALL_SYS p0 = reti; jump (p0); -ENDPROC(_ret_from_fork) ENTRY(_sys_fork) r0 = -EINVAL; rts; -ENDPROC(_sys_fork) ENTRY(_sys_vfork) r0 = sp; @@ -74,7 +72,6 @@ ENTRY(_sys_vfork) SP += 12; rets = [sp++]; rts; -ENDPROC(_sys_vfork) ENTRY(_sys_clone) r0 = sp; @@ -85,7 +82,6 @@ ENTRY(_sys_clone) SP += 12; rets = [sp++]; rts; -ENDPROC(_sys_clone) ENTRY(_sys_rt_sigreturn) r0 = sp; @@ -96,4 +92,3 @@ ENTRY(_sys_rt_sigreturn) SP += 12; rets = [sp++]; rts; -ENDPROC(_sys_rt_sigreturn) diff --git a/trunk/arch/blackfin/kernel/irqchip.c b/trunk/arch/blackfin/kernel/irqchip.c index 80996a1a94ca..df5bf022cf79 100644 --- a/trunk/arch/blackfin/kernel/irqchip.c +++ b/trunk/arch/blackfin/kernel/irqchip.c @@ -91,7 +91,7 @@ int show_interrupts(struct seq_file *p, void *v) } /* - * do_IRQ handles all hardware IRQs. Decoded IRQs should not + * do_IRQ handles all hardware IRQ's. Decoded IRQs should not * come via this function. Instead, they should provide their * own 'handler' */ diff --git a/trunk/arch/blackfin/kernel/setup.c b/trunk/arch/blackfin/kernel/setup.c index a24fa1ab802b..02dc74301920 100644 --- a/trunk/arch/blackfin/kernel/setup.c +++ b/trunk/arch/blackfin/kernel/setup.c @@ -61,7 +61,7 @@ EXPORT_SYMBOL(memory_mtd_start); EXPORT_SYMBOL(mtd_size); #endif -char __initdata command_line[COMMAND_LINE_SIZE]; +char command_line[COMMAND_LINE_SIZE]; #if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE) static void generate_cpl_tables(void); @@ -90,7 +90,7 @@ void __init bf53x_cache_init(void) #endif } -void __init bf53x_relocate_l1_mem(void) +void bf53x_relocate_l1_mem(void) { unsigned long l1_code_length; unsigned long l1_data_a_length; @@ -205,6 +205,7 @@ void __init setup_arch(char **cmdline_p) #endif #if defined(CONFIG_CMDLINE_BOOL) + memset(command_line, 0, sizeof(command_line)); strncpy(&command_line[0], CONFIG_CMDLINE, sizeof(command_line)); command_line[sizeof(command_line) - 1] = 0; #endif @@ -212,7 +213,7 @@ void __init setup_arch(char **cmdline_p) /* Keep a copy of command line */ *cmdline_p = &command_line[0]; memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE - 1] = '\0'; + boot_command_line[COMMAND_LINE_SIZE - 1] = 0; /* setup memory defaults from the user config */ physical_mem_end = 0; @@ -410,7 +411,7 @@ static int __init topology_init(void) subsys_initcall(topology_init); #if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE) -static u16 __init lock_kernel_check(u32 start, u32 end) +u16 lock_kernel_check(u32 start, u32 end) { if ((start <= (u32) _stext && end >= (u32) _end) || (start >= (u32) _stext && end <= (u32) _end)) @@ -470,67 +471,6 @@ close_cplbtab(struct cplb_tab *table) return 0; } -/* helper function */ -static void __fill_code_cplbtab(struct cplb_tab *t, int i, - u32 a_start, u32 a_end) -{ - if (cplb_data[i].psize) { - fill_cplbtab(t, - cplb_data[i].start, - cplb_data[i].end, - cplb_data[i].psize, - cplb_data[i].i_conf); - } else { -#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263)) - if (i == SDRAM_KERN) { - fill_cplbtab(t, - cplb_data[i].start, - cplb_data[i].end, - SIZE_4M, - cplb_data[i].i_conf); - } else { -#endif - fill_cplbtab(t, - cplb_data[i].start, - a_start, - SIZE_1M, - cplb_data[i].i_conf); - fill_cplbtab(t, - a_start, - a_end, - SIZE_4M, - cplb_data[i].i_conf); - fill_cplbtab(t, a_end, - cplb_data[i].end, - SIZE_1M, - cplb_data[i].i_conf); - } - } -} - -static void __fill_data_cplbtab(struct cplb_tab *t, int i, - u32 a_start, u32 a_end) -{ - if (cplb_data[i].psize) { - fill_cplbtab(t, - cplb_data[i].start, - cplb_data[i].end, - cplb_data[i].psize, - cplb_data[i].d_conf); - } else { - fill_cplbtab(t, - cplb_data[i].start, - a_start, SIZE_1M, - cplb_data[i].d_conf); - fill_cplbtab(t, a_start, - a_end, SIZE_4M, - cplb_data[i].d_conf); - fill_cplbtab(t, a_end, - cplb_data[i].end, - SIZE_1M, - cplb_data[i].d_conf); - } -} static void __init generate_cpl_tables(void) { @@ -600,78 +540,130 @@ static void __init generate_cpl_tables(void) cplb_data[RES_MEM].i_conf = SDRAM_INON_CHBL; for (i = ZERO_P; i <= L2_MEM; i++) { - if (!cplb_data[i].valid) - continue; - as_1m = cplb_data[i].start % SIZE_1M; + if (cplb_data[i].valid) { - /* - * We need to make sure all sections are properly 1M aligned - * However between Kernel Memory and the Kernel mtd section, - * depending on the rootfs size, there can be overlapping - * memory areas. - */ + as_1m = cplb_data[i].start % SIZE_1M; - if (as_1m && i != L1I_MEM && i != L1D_MEM) { + /* We need to make sure all sections are properly 1M aligned + * However between Kernel Memory and the Kernel mtd section, depending on the + * rootfs size, there can be overlapping memory areas. + */ + + if (as_1m && i!=L1I_MEM && i!=L1D_MEM) { #ifdef CONFIG_MTD_UCLINUX - if (i == SDRAM_RAM_MTD) { - if ((cplb_data[SDRAM_KERN].end + 1) > - cplb_data[SDRAM_RAM_MTD].start) - cplb_data[SDRAM_RAM_MTD].start = - (cplb_data[i].start & - (-2*SIZE_1M)) + SIZE_1M; - else - cplb_data[SDRAM_RAM_MTD].start = - (cplb_data[i].start & - (-2*SIZE_1M)); - } else + if (i == SDRAM_RAM_MTD) { + if ((cplb_data[SDRAM_KERN].end + 1) > cplb_data[SDRAM_RAM_MTD].start) + cplb_data[SDRAM_RAM_MTD].start = (cplb_data[i].start & (-2*SIZE_1M)) + SIZE_1M; + else + cplb_data[SDRAM_RAM_MTD].start = (cplb_data[i].start & (-2*SIZE_1M)); + } else #endif - printk(KERN_WARNING - "Unaligned Start of %s at 0x%X\n", - cplb_data[i].name, cplb_data[i].start); - } + printk(KERN_WARNING "Unaligned Start of %s at 0x%X\n", + cplb_data[i].name, cplb_data[i].start); + } - as = cplb_data[i].start % SIZE_4M; - ae = cplb_data[i].end % SIZE_4M; + as = cplb_data[i].start % SIZE_4M; + ae = cplb_data[i].end % SIZE_4M; + + if (as) + a_start = cplb_data[i].start + (SIZE_4M - (as)); + else + a_start = cplb_data[i].start; + + a_end = cplb_data[i].end - ae; + + for (j = INITIAL_T; j <= SWITCH_T; j++) { + + switch (j) { + case INITIAL_T: + if (cplb_data[i].attr & INITIAL_T) { + t_i = &cplb.init_i; + t_d = &cplb.init_d; + process = 1; + } else + process = 0; + break; + case SWITCH_T: + if (cplb_data[i].attr & SWITCH_T) { + t_i = &cplb.switch_i; + t_d = &cplb.switch_d; + process = 1; + } else + process = 0; + break; + default: + process = 0; + break; + } - if (as) - a_start = cplb_data[i].start + (SIZE_4M - (as)); - else - a_start = cplb_data[i].start; + if (process) { + if (cplb_data[i].attr & I_CPLB) { + + if (cplb_data[i].psize) { + fill_cplbtab(t_i, + cplb_data[i].start, + cplb_data[i].end, + cplb_data[i].psize, + cplb_data[i].i_conf); + } else { + /*icplb_table */ +#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263)) + if (i == SDRAM_KERN) { + fill_cplbtab(t_i, + cplb_data[i].start, + cplb_data[i].end, + SIZE_4M, + cplb_data[i].i_conf); + } else +#endif + { + fill_cplbtab(t_i, + cplb_data[i].start, + a_start, + SIZE_1M, + cplb_data[i].i_conf); + fill_cplbtab(t_i, + a_start, + a_end, + SIZE_4M, + cplb_data[i].i_conf); + fill_cplbtab(t_i, a_end, + cplb_data[i].end, + SIZE_1M, + cplb_data[i].i_conf); + } + } - a_end = cplb_data[i].end - ae; + } + if (cplb_data[i].attr & D_CPLB) { + + if (cplb_data[i].psize) { + fill_cplbtab(t_d, + cplb_data[i].start, + cplb_data[i].end, + cplb_data[i].psize, + cplb_data[i].d_conf); + } else { +/*dcplb_table*/ + fill_cplbtab(t_d, + cplb_data[i].start, + a_start, SIZE_1M, + cplb_data[i].d_conf); + fill_cplbtab(t_d, a_start, + a_end, SIZE_4M, + cplb_data[i].d_conf); + fill_cplbtab(t_d, a_end, + cplb_data[i].end, + SIZE_1M, + cplb_data[i].d_conf); - for (j = INITIAL_T; j <= SWITCH_T; j++) { + } - switch (j) { - case INITIAL_T: - if (cplb_data[i].attr & INITIAL_T) { - t_i = &cplb.init_i; - t_d = &cplb.init_d; - process = 1; - } else - process = 0; - break; - case SWITCH_T: - if (cplb_data[i].attr & SWITCH_T) { - t_i = &cplb.switch_i; - t_d = &cplb.switch_d; - process = 1; - } else - process = 0; - break; - default: - process = 0; - break; + } + } } - if (!process) - continue; - if (cplb_data[i].attr & I_CPLB) - __fill_code_cplbtab(t_i, i, a_start, a_end); - - if (cplb_data[i].attr & D_CPLB) - __fill_data_cplbtab(t_d, i, a_start, a_end); } } @@ -689,7 +681,7 @@ static void __init generate_cpl_tables(void) #endif -static u_long get_vco(void) +static inline u_long get_vco(void) { u_long msel; u_long vco; @@ -897,8 +889,8 @@ struct seq_operations cpuinfo_op = { .show = show_cpuinfo, }; -void __init cmdline_init(const char *r0) +void cmdline_init(unsigned long r0) { if (r0) - strncpy(command_line, r0, COMMAND_LINE_SIZE); + strncpy(command_line, (char *)r0, COMMAND_LINE_SIZE); } diff --git a/trunk/arch/blackfin/kernel/traps.c b/trunk/arch/blackfin/kernel/traps.c index 5ab87b0b92dd..9932edee8cb4 100644 --- a/trunk/arch/blackfin/kernel/traps.c +++ b/trunk/arch/blackfin/kernel/traps.c @@ -557,7 +557,7 @@ void dump_bfin_regs(struct pt_regs *fp, void *retaddr) break; #ifndef CONFIG_DEBUG_HWERR /* If one of the last few instructions was a STI - * it is likely that the error occured awhile ago + * it is likily that the error occured awhile ago * and we just noticed */ if (x >= 0x0040 && x <= 0x0047 && i <= 0) diff --git a/trunk/arch/blackfin/kernel/vmlinux.lds.S b/trunk/arch/blackfin/kernel/vmlinux.lds.S index 1ef1e36b3957..86fe67995802 100644 --- a/trunk/arch/blackfin/kernel/vmlinux.lds.S +++ b/trunk/arch/blackfin/kernel/vmlinux.lds.S @@ -7,7 +7,7 @@ * Description: Master linker script for blackfin architecture * * Modified: - * Copyright 2004-2007 Analog Devices Inc. + * Copyright 2004-2006 Analog Devices Inc. * * Bugs: Enter bugs at http://blackfin.uclinux.org/ * @@ -32,54 +32,97 @@ #include #include + OUTPUT_FORMAT("elf32-bfin") ENTRY(__start) _jiffies = _jiffies_64; +MEMORY +{ + ram : ORIGIN = CONFIG_BOOT_LOAD, LENGTH = (CONFIG_MEM_SIZE * 1024 * 1024) - (CONFIG_BOOT_LOAD) + l1_data_a : ORIGIN = L1_DATA_A_START, LENGTH = L1_DATA_A_LENGTH + l1_data_b : ORIGIN = L1_DATA_B_START, LENGTH = L1_DATA_B_LENGTH + l1_code : ORIGIN = L1_CODE_START, LENGTH = L1_CODE_LENGTH + l1_scratch : ORIGIN = L1_SCRATCH_START, LENGTH = L1_SCRATCH_LENGTH +} + SECTIONS { . = CONFIG_BOOT_LOAD; + .text : { - __text = .; - _text = .; - __stext = .; + _text = .; + __stext = .; TEXT_TEXT SCHED_TEXT - LOCK_TEXT *(.text.lock) - *(.fixup) - . = ALIGN(16); - ___start___ex_table = .; + ___start___ex_table = .; *(__ex_table) - ___stop___ex_table = .; + ___stop___ex_table = .; + + *($code) + *(.rodata) + *(.rodata.*) + *(__vermagic) /* Kernel version magic */ + *(.rodata1) + *(.fixup) + *(.spinlock.text) + /* Kernel symbol table: Normal symbols */ . = ALIGN(4); + ___start___ksymtab = .; + *(__ksymtab) + ___stop___ksymtab = .; + + /* Kernel symbol table: GPL-only symbols */ + ___start___ksymtab_gpl = .; + *(__ksymtab_gpl) + ___stop___ksymtab_gpl = .; + + /* Kernel symbol table: Normal unused symbols */ \ + ___start___ksymtab_unused = .; + *(__ksymtab_unused) + ___stop___ksymtab_unused = .; + + /* Kernel symbol table: GPL-only unused symbols */ + ___start___ksymtab_unused_gpl = .; + *(__ksymtab_unused_gpl) + ___stop___ksymtab_unused_gpl = .; + + + /* Kernel symbol table: GPL-future symbols */ + ___start___ksymtab_gpl_future = .; + *(__ksymtab_gpl_future) + ___stop___ksymtab_gpl_future = .; + + /* Kernel symbol table: Normal symbols */ + ___start___kcrctab = .; + *(__kcrctab) + ___stop___kcrctab = .; + + /* Kernel symbol table: GPL-only symbols */ + ___start___kcrctab_gpl = .; + *(__kcrctab_gpl) + ___stop___kcrctab_gpl = .; + + /* Kernel symbol table: GPL-future symbols */ + ___start___kcrctab_gpl_future = .; + *(__kcrctab_gpl_future) + ___stop___kcrctab_gpl_future = .; + + /* Kernel symbol table: strings */ + *(__ksymtab_strings) + + . = ALIGN(4); __etext = .; - } - - RODATA - - .data : - { - __sdata = .; - . = ALIGN(0x2000); - *(.data.init_task) - DATA_DATA - CONSTRUCTORS - - . = ALIGN(32); - *(.data.cacheline_aligned) - - . = ALIGN(0x2000); - __edata = .; - } + } > ram - ___init_begin = .; .init : { . = ALIGN(4096); + ___init_begin = .; __sinittext = .; *(.init.text) __einittext = .; @@ -105,39 +148,39 @@ SECTIONS *(.init.ramfs) ___initramfs_end = .; . = ALIGN(4); - } + ___init_end = .; + } > ram - __l1_lma_start = .; + __l1_lma_start = .; - .text_l1 L1_CODE_START : AT(LOADADDR(.init) + SIZEOF(.init)) + .text_l1 : { . = ALIGN(4); - __stext_l1 = .; + __stext_l1 = .; *(.l1.text) . = ALIGN(4); - __etext_l1 = .; - } + __etext_l1 = .; + } > l1_code AT > ram - .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1)) + .data_l1 : { . = ALIGN(4); - __sdata_l1 = .; + __sdata_l1 = .; *(.l1.data) - __edata_l1 = .; + __edata_l1 = .; . = ALIGN(4); - __sbss_l1 = .; + __sbss_l1 = .; *(.l1.bss) . = ALIGN(32); *(.data_l1.cacheline_aligned) . = ALIGN(4); - __ebss_l1 = .; - } - - .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) + __ebss_l1 = .; + } > l1_data_a AT > ram + .data_b_l1 : { . = ALIGN(4); __sdata_b_l1 = .; @@ -150,25 +193,36 @@ SECTIONS . = ALIGN(4); __ebss_b_l1 = .; - } + } > l1_data_b AT > ram - ___init_end = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); + .data : + { + __sdata = .; + . = ALIGN(0x2000); + *(.data.init_task) + DATA_DATA - .bss LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1) : + . = ALIGN(32); + *(.data.cacheline_aligned) + + . = ALIGN(0x2000); + __edata = .; + } > ram + + /DISCARD/ : { /* Exit code and data*/ + *(.exit.text) + *(.exit.data) + *(.exitcall.exit) + } > ram + + .bss : { . = ALIGN(4); - ___bss_start = .; + ___bss_start = .; *(.bss) *(COMMON) . = ALIGN(4); - ___bss_stop = .; - __end = .; - } - - /DISCARD/ : - { - *(.exit.text) - *(.exit.data) - *(.exitcall.exit) - } + ___bss_stop = .; + __end = . ; + } > ram } diff --git a/trunk/arch/blackfin/lib/divsi3.S b/trunk/arch/blackfin/lib/divsi3.S index 2ac59c70dd94..3e29861852b2 100644 --- a/trunk/arch/blackfin/lib/divsi3.S +++ b/trunk/arch/blackfin/lib/divsi3.S @@ -44,7 +44,6 @@ */ .global ___divsi3; -.type ___divsi3, STT_FUNC; #ifdef CONFIG_ARITHMETIC_OPS_L1 .section .l1.text @@ -215,5 +214,3 @@ ___divsi3 : .Lret_zero: R0 = 0; RTS; - -.size ___divsi3, .-___divsi3 diff --git a/trunk/arch/blackfin/lib/ins.S b/trunk/arch/blackfin/lib/ins.S index a17cc77ac36f..7d5e9846311d 100644 --- a/trunk/arch/blackfin/lib/ins.S +++ b/trunk/arch/blackfin/lib/ins.S @@ -46,7 +46,7 @@ ENTRY(_insl) .Llong_loop_e: NOP; sti R3; RTS; -ENDPROC(_insl) + ENTRY(_insw) P0 = R0; /* P0 = port */ @@ -61,7 +61,6 @@ ENTRY(_insw) .Lword_loop_e: NOP; sti R3; RTS; -ENDPROC(_insw) ENTRY(_insb) P0 = R0; /* P0 = port */ @@ -76,4 +75,3 @@ ENTRY(_insb) .Lbyte_loop_e: NOP; sti R3; RTS; -ENDPROC(_insb) diff --git a/trunk/arch/blackfin/lib/memchr.S b/trunk/arch/blackfin/lib/memchr.S index 5da428134d32..498122250d07 100644 --- a/trunk/arch/blackfin/lib/memchr.S +++ b/trunk/arch/blackfin/lib/memchr.S @@ -67,4 +67,4 @@ ENTRY(_memchr) R0 += -1; RTS; -ENDPROC(_memchr) +.size _memchr,.-_memchr diff --git a/trunk/arch/blackfin/lib/memcmp.S b/trunk/arch/blackfin/lib/memcmp.S index a6b8ee6a6bf2..5b9502368fc6 100644 --- a/trunk/arch/blackfin/lib/memcmp.S +++ b/trunk/arch/blackfin/lib/memcmp.S @@ -107,4 +107,4 @@ ENTRY(_memcmp) P3 = I1; RTS; -ENDPROC(_memcmp) +.size _memcmp,.-_memcmp diff --git a/trunk/arch/blackfin/lib/memcpy.S b/trunk/arch/blackfin/lib/memcpy.S index 34b5a91c215c..c1e00eff541c 100644 --- a/trunk/arch/blackfin/lib/memcpy.S +++ b/trunk/arch/blackfin/lib/memcpy.S @@ -140,5 +140,3 @@ ENTRY(_memcpy) B[P0--] = R1; RTS; - -ENDPROC(_memcpy) diff --git a/trunk/arch/blackfin/lib/memmove.S b/trunk/arch/blackfin/lib/memmove.S index c371585e9dbd..2e5fb7f8df13 100644 --- a/trunk/arch/blackfin/lib/memmove.S +++ b/trunk/arch/blackfin/lib/memmove.S @@ -100,4 +100,4 @@ ENTRY(_memmove) P3 = I1; RTS; -ENDPROC(_memmove) +.size _memmove,.-_memmove diff --git a/trunk/arch/blackfin/lib/memset.S b/trunk/arch/blackfin/lib/memset.S index 8159136a29ea..ba6d047568dd 100644 --- a/trunk/arch/blackfin/lib/memset.S +++ b/trunk/arch/blackfin/lib/memset.S @@ -106,4 +106,4 @@ ENTRY(_memset) B[P0++] = R1; JUMP .Laligned; -ENDPROC(_memset) +.size _memset,.-_memset diff --git a/trunk/arch/blackfin/lib/modsi3.S b/trunk/arch/blackfin/lib/modsi3.S index ca1dd3973b39..528b8b1ccb34 100644 --- a/trunk/arch/blackfin/lib/modsi3.S +++ b/trunk/arch/blackfin/lib/modsi3.S @@ -77,5 +77,3 @@ ___modsi3: R0 = 0; .LRETURN_R0: RTS; - -.size ___modsi3, .-___modsi3 diff --git a/trunk/arch/blackfin/lib/outs.S b/trunk/arch/blackfin/lib/outs.S index 4c3da8ae094e..f8c876fe8930 100644 --- a/trunk/arch/blackfin/lib/outs.S +++ b/trunk/arch/blackfin/lib/outs.S @@ -40,7 +40,6 @@ ENTRY(_outsl) .Llong_loop_s: R0 = [P1++]; .Llong_loop_e: [P0] = R0; RTS; -ENDPROC(_outsl) ENTRY(_outsw) P0 = R0; /* P0 = port */ @@ -51,7 +50,6 @@ ENTRY(_outsw) .Lword_loop_s: R0 = W[P1++]; .Lword_loop_e: W[P0] = R0; RTS; -ENDPROC(_outsw) ENTRY(_outsb) P0 = R0; /* P0 = port */ @@ -62,4 +60,3 @@ ENTRY(_outsb) .Lbyte_loop_s: R0 = B[P1++]; .Lbyte_loop_e: B[P0] = R0; RTS; -ENDPROC(_outsb) diff --git a/trunk/arch/blackfin/lib/smulsi3_highpart.S b/trunk/arch/blackfin/lib/smulsi3_highpart.S index e383cd3eca5d..10b8f8da576f 100644 --- a/trunk/arch/blackfin/lib/smulsi3_highpart.S +++ b/trunk/arch/blackfin/lib/smulsi3_highpart.S @@ -28,5 +28,3 @@ ___smulsi3_highpart: R0 = R0 + R1; RTS; - -.size ___smulsi3_highpart, .-___smulsi3_highpart diff --git a/trunk/arch/blackfin/lib/udivsi3.S b/trunk/arch/blackfin/lib/udivsi3.S index 58fd96d74766..d39a12916259 100644 --- a/trunk/arch/blackfin/lib/udivsi3.S +++ b/trunk/arch/blackfin/lib/udivsi3.S @@ -296,5 +296,3 @@ ENTRY(___udivsi3) R1 = R0 - R3; IF CC R0 = R1; RTS; - -ENDPROC(___udivsi3) diff --git a/trunk/arch/blackfin/lib/umodsi3.S b/trunk/arch/blackfin/lib/umodsi3.S index 4f2b76ee7626..b55ce96ab89f 100644 --- a/trunk/arch/blackfin/lib/umodsi3.S +++ b/trunk/arch/blackfin/lib/umodsi3.S @@ -34,9 +34,7 @@ #endif .extern ___udivsi3; -.type ___udivsi3, STT_FUNC; .globl ___umodsi3 -.type ___umodsi3, STT_FUNC; ___umodsi3: CC=R0==0; @@ -66,5 +64,3 @@ ___umodsi3: R0 = 0; .LRETURN_R0: RTS; - -.size ___umodsi3, .-___umodsi3 diff --git a/trunk/arch/blackfin/lib/umulsi3_highpart.S b/trunk/arch/blackfin/lib/umulsi3_highpart.S index 67b799351e3e..aac8218fb258 100644 --- a/trunk/arch/blackfin/lib/umulsi3_highpart.S +++ b/trunk/arch/blackfin/lib/umulsi3_highpart.S @@ -21,5 +21,3 @@ ___umulsi3_highpart: R1 = PACK(R1.l,R0.h); R0 = R1 + R2; RTS; - -.size ___umulsi3_highpart, .-___umulsi3_highpart diff --git a/trunk/arch/blackfin/mach-bf533/boards/cm_bf533.c b/trunk/arch/blackfin/mach-bf533/boards/cm_bf533.c index edd31ce4f8d2..23a7f607df3f 100644 --- a/trunk/arch/blackfin/mach-bf533/boards/cm_bf533.c +++ b/trunk/arch/blackfin/mach-bf533/boards/cm_bf533.c @@ -1,7 +1,7 @@ /* * File: arch/blackfin/mach-bf533/boards/cm_bf533.c * Based on: arch/blackfin/mach-bf533/boards/ezkit.c - * Author: Aidan Williams Copyright 2005 + * Author: Aidan Williams Copright 2005 * * Created: 2005 * Description: Board description file diff --git a/trunk/arch/blackfin/mach-bf533/boards/ezkit.c b/trunk/arch/blackfin/mach-bf533/boards/ezkit.c index 0b522d95160d..747298ea907b 100644 --- a/trunk/arch/blackfin/mach-bf533/boards/ezkit.c +++ b/trunk/arch/blackfin/mach-bf533/boards/ezkit.c @@ -1,6 +1,6 @@ /* * File: arch/blackfin/mach-bf533/ezkit.c - * Based on: Original Work + * Based on: Orginal Work * Author: Aidan Williams * * Created: 2005 diff --git a/trunk/arch/blackfin/mach-bf533/head.S b/trunk/arch/blackfin/mach-bf533/head.S index 7e2aa8d0f44f..4db9e6240906 100644 --- a/trunk/arch/blackfin/mach-bf533/head.S +++ b/trunk/arch/blackfin/mach-bf533/head.S @@ -28,7 +28,6 @@ */ #include -#include #include #if CONFIG_BFIN_KERNEL_CLOCK #include @@ -46,19 +45,19 @@ #define INITIAL_STACK 0xFFB01000 -__INIT +.text ENTRY(__start) +ENTRY(__stext) /* R0: argument of command line string, passed from uboot, save it */ R7 = R0; - /* Set the SYSCFG register: - * Enable Cycle Counter and Nesting Of Interrupts (3rd Bit) - */ + /* Set the SYSCFG register */ R0 = 0x36; + /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/ SYSCFG = R0; R0 = 0; - /* Clear Out All the data and pointer Registers */ + /*Clear Out All the data and pointer Registers*/ R1 = R0; R2 = R0; R3 = R0; @@ -80,7 +79,7 @@ ENTRY(__start) L2 = r0; L3 = r0; - /* Clear Out All the DAG Registers */ + /* Clear Out All the DAG Registers*/ B0 = r0; B1 = r0; B2 = r0; @@ -266,7 +265,6 @@ ENTRY(__start) .LWAIT_HERE: jump .LWAIT_HERE; -ENDPROC(__start) ENTRY(_real_start) [ -- sp ] = reti; @@ -305,7 +303,7 @@ ENTRY(_real_start) .L_clear_zero: W[p1++] = r0; - /* pass the uboot arguments to the global value command line */ +/* pass the uboot arguments to the global value command line */ R0 = R7; call _cmdline_init; @@ -324,7 +322,7 @@ ENTRY(_real_start) [p1] = r1; /* - * load the current thread pointer and stack + * load the current thread pointer and stack */ r1.l = _init_thread_union; r1.h = _init_thread_union; @@ -335,10 +333,9 @@ ENTRY(_real_start) sp = r1; usp = sp; fp = sp; - jump.l _start_kernel; -ENDPROC(_real_start) - -__FINIT + call _start_kernel; +.L_exit: + jump.s .L_exit; .section .l1.text #if CONFIG_BFIN_KERNEL_CLOCK @@ -442,13 +439,12 @@ ENTRY(_start_dma_code) p0.h = hi(SIC_IWR); p0.l = lo(SIC_IWR); - r0.l = lo(IWR_ENABLE_ALL); - r0.h = hi(IWR_ENABLE_ALL); + r0.l = lo(IWR_ENABLE_ALL) + r0.h = hi(IWR_ENABLE_ALL) [p0] = r0; SSYNC; RTS; -ENDPROC(_start_dma_code) #endif /* CONFIG_BFIN_KERNEL_CLOCK */ ENTRY(_bfin_reset) diff --git a/trunk/arch/blackfin/mach-bf533/ints-priority.c b/trunk/arch/blackfin/mach-bf533/ints-priority.c index a3e1789167be..36a693345204 100644 --- a/trunk/arch/blackfin/mach-bf533/ints-priority.c +++ b/trunk/arch/blackfin/mach-bf533/ints-priority.c @@ -4,7 +4,7 @@ * Author: Michael Hennerich * * Created: ? - * Description: Set up the interrupt priorities + * Description: Set up the interupt priorities * * Modified: * Copyright 2004-2006 Analog Devices Inc. diff --git a/trunk/arch/blackfin/mach-bf537/boards/generic_board.c b/trunk/arch/blackfin/mach-bf537/boards/generic_board.c index fd57e7439e0f..9019c0edbe7c 100644 --- a/trunk/arch/blackfin/mach-bf537/boards/generic_board.c +++ b/trunk/arch/blackfin/mach-bf537/boards/generic_board.c @@ -55,7 +55,7 @@ static struct resource bfin_pcmcia_cf_resources[] = { .end = 0x20312000, .flags = IORESOURCE_MEM, },{ - .start = 0x20311000, /* Attribute Memory */ + .start = 0x20311000, /* Attribute Memeory */ .end = 0x20311FFF, .flags = IORESOURCE_MEM, },{ diff --git a/trunk/arch/blackfin/mach-bf537/boards/pnav10.c b/trunk/arch/blackfin/mach-bf537/boards/pnav10.c index 8aaf76dfce80..40d3a1b70ee7 100644 --- a/trunk/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/trunk/arch/blackfin/mach-bf537/boards/pnav10.c @@ -59,7 +59,7 @@ static struct resource bfin_pcmcia_cf_resources[] = { .end = 0x20312000, .flags = IORESOURCE_MEM, },{ - .start = 0x20311000, /* Attribute Memory */ + .start = 0x20311000, /* Attribute Memeory */ .end = 0x20311FFF, .flags = IORESOURCE_MEM, },{ diff --git a/trunk/arch/blackfin/mach-bf537/boards/stamp.c b/trunk/arch/blackfin/mach-bf537/boards/stamp.c index 3a29b4d15f25..ba2f875a7f7d 100644 --- a/trunk/arch/blackfin/mach-bf537/boards/stamp.c +++ b/trunk/arch/blackfin/mach-bf537/boards/stamp.c @@ -108,7 +108,7 @@ static struct resource bfin_pcmcia_cf_resources[] = { .end = 0x20312000, .flags = IORESOURCE_MEM, },{ - .start = 0x20311000, /* Attribute Memory */ + .start = 0x20311000, /* Attribute Memeory */ .end = 0x20311FFF, .flags = IORESOURCE_MEM, },{ diff --git a/trunk/arch/blackfin/mach-bf537/head.S b/trunk/arch/blackfin/mach-bf537/head.S index 7d902bbd860f..2c2652bee7e5 100644 --- a/trunk/arch/blackfin/mach-bf537/head.S +++ b/trunk/arch/blackfin/mach-bf537/head.S @@ -28,7 +28,6 @@ */ #include -#include #include #if CONFIG_BFIN_KERNEL_CLOCK #include @@ -41,21 +40,20 @@ .extern ___bss_start .extern _bf53x_relocate_l1_mem -#define INITIAL_STACK 0xFFB01000 +#define INITIAL_STACK 0xFFB01000 -__INIT +.text ENTRY(__start) +ENTRY(__stext) /* R0: argument of command line string, passed from uboot, save it */ R7 = R0; - /* Set the SYSCFG register: - * Enable Cycle Counter and Nesting Of Interrupts (3rd Bit) - */ + /* Set the SYSCFG register */ R0 = 0x36; - SYSCFG = R0; + SYSCFG = R0; /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/ R0 = 0; - /* Clear Out All the data and pointer Registers */ + /* Clear Out All the data and pointer Registers*/ R1 = R0; R2 = R0; R3 = R0; @@ -77,7 +75,7 @@ ENTRY(__start) L2 = r0; L3 = r0; - /* Clear Out All the DAG Registers */ + /* Clear Out All the DAG Registers*/ B0 = r0; B1 = r0; B2 = r0; @@ -193,7 +191,7 @@ ENTRY(__start) p0.h = hi(UART_DLL); p0.l = lo(UART_DLL); - r0 = 0x0(Z); + r0 = 0x00(Z); w[p0] = r0.L; ssync; @@ -220,7 +218,6 @@ ENTRY(__start) #if CONFIG_BFIN_KERNEL_CLOCK call _start_dma_code; #endif - /* Code for initializing Async memory banks */ p2.h = hi(EBIU_AMBCTL1); @@ -275,7 +272,6 @@ ENTRY(__start) .LWAIT_HERE: jump .LWAIT_HERE; -ENDPROC(__start) ENTRY(_real_start) [ -- sp ] = reti; @@ -295,7 +291,7 @@ ENTRY(_real_start) p2.h = ___bss_stop; r0 = 0; p2 -= p1; - lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2; + lsetup (.L_clear_bss, .L_clear_bss ) lc0 = p2; .L_clear_bss: B[p1++] = r0; @@ -310,7 +306,7 @@ ENTRY(_real_start) r0 = r0 >> 1; p2 = r0; r0 = 0; - lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2; + lsetup (.L_clear_zero, .L_clear_zero ) lc0 = p2; .L_clear_zero: W[p1++] = r0; @@ -332,8 +328,9 @@ ENTRY(_real_start) r1 = p3; [p1] = r1; + /* - * load the current thread pointer and stack + * load the current thread pointer and stack */ r1.l = _init_thread_union; r1.h = _init_thread_union; @@ -344,10 +341,9 @@ ENTRY(_real_start) sp = r1; usp = sp; fp = sp; - jump.l _start_kernel; -ENDPROC(_real_start) - -__FINIT + call _start_kernel; +.L_exit: + jump.s .L_exit; .section .l1.text #if CONFIG_BFIN_KERNEL_CLOCK @@ -466,7 +462,6 @@ ENTRY(_start_dma_code) SSYNC; RTS; -ENDPROC(_start_dma_code) #endif /* CONFIG_BFIN_KERNEL_CLOCK */ ENTRY(_bfin_reset) diff --git a/trunk/arch/blackfin/mach-bf537/ints-priority.c b/trunk/arch/blackfin/mach-bf537/ints-priority.c index 2dbf3df465d1..fd6308eccbe6 100644 --- a/trunk/arch/blackfin/mach-bf537/ints-priority.c +++ b/trunk/arch/blackfin/mach-bf537/ints-priority.c @@ -4,7 +4,7 @@ * Author: Michael Hennerich * * Created: - * Description: Set up the interrupt priorities + * Description: Set up the interupt priorities * * Modified: * Copyright 2004-2006 Analog Devices Inc. diff --git a/trunk/arch/blackfin/mach-bf561/boards/cm_bf561.c b/trunk/arch/blackfin/mach-bf561/boards/cm_bf561.c index 3dc5c042048c..6824e956d153 100644 --- a/trunk/arch/blackfin/mach-bf561/boards/cm_bf561.c +++ b/trunk/arch/blackfin/mach-bf561/boards/cm_bf561.c @@ -1,7 +1,7 @@ /* * File: arch/blackfin/mach-bf533/boards/cm_bf561.c * Based on: arch/blackfin/mach-bf533/boards/ezkit.c - * Author: Aidan Williams Copyright 2005 + * Author: Aidan Williams Copright 2005 * * Created: 2006 * Description: Board description file @@ -43,7 +43,7 @@ char *bfin_board_name = "Bluetechnix CM BF561"; #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) -/* all SPI peripherals info goes here */ +/* all SPI perpherals info goes here */ #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) static struct mtd_partition bfin_spi_flash_partitions[] = { diff --git a/trunk/arch/blackfin/mach-bf561/head.S b/trunk/arch/blackfin/mach-bf561/head.S index 31cbc75c85cf..ad9187a866a5 100644 --- a/trunk/arch/blackfin/mach-bf561/head.S +++ b/trunk/arch/blackfin/mach-bf561/head.S @@ -28,7 +28,6 @@ */ #include -#include #include #if CONFIG_BFIN_KERNEL_CLOCK #include @@ -43,19 +42,18 @@ #define INITIAL_STACK 0xFFB01000 -__INIT +.text ENTRY(__start) - /* R0: argument of command line string, passed from uboot, save it */ +ENTRY(__stext) + /* R0: argument of command line string, passed from uboot, save it */ R7 = R0; - /* Set the SYSCFG register: - * Enable Cycle Counter and Nesting Of Interrupts (3rd Bit) - */ + /* Set the SYSCFG register */ R0 = 0x36; - SYSCFG = R0; + SYSCFG = R0; /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/ R0 = 0; - /* Clear Out All the data and pointer Registers */ + /*Clear Out All the data and pointer Registers*/ R1 = R0; R2 = R0; R3 = R0; @@ -77,7 +75,7 @@ ENTRY(__start) L2 = r0; L3 = r0; - /* Clear Out All the DAG Registers */ + /* Clear Out All the DAG Registers*/ B0 = r0; B1 = r0; B2 = r0; @@ -221,7 +219,6 @@ ENTRY(__start) .LWAIT_HERE: jump .LWAIT_HERE; -ENDPROC(__start) ENTRY(_real_start) [ -- sp ] = reti; @@ -241,7 +238,7 @@ ENTRY(_real_start) p2.h = ___bss_stop; r0 = 0; p2 -= p1; - lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2; + lsetup (.L_clear_bss, .L_clear_bss ) lc0 = p2; .L_clear_bss: B[p1++] = r0; @@ -256,11 +253,11 @@ ENTRY(_real_start) r0 = r0 >> 1; p2 = r0; r0 = 0; - lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2; + lsetup (.L_clear_zero, .L_clear_zero ) lc0 = p2; .L_clear_zero: W[p1++] = r0; - /* pass the uboot arguments to the global value command line */ +/* pass the uboot arguments to the global value command line */ R0 = R7; call _cmdline_init; @@ -290,10 +287,9 @@ ENTRY(_real_start) sp = r1; usp = sp; fp = sp; - jump.l _start_kernel; -ENDPROC(_real_start) - -__FINIT + call _start_kernel; +.L_exit: + jump.s .L_exit; .section .l1.text #if CONFIG_BFIN_KERNEL_CLOCK @@ -354,7 +350,7 @@ ENTRY(_start_dma_code) if ! CC jump .Lcheck_again; /* Configure SCLK & CCLK Dividers */ - r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV); + r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV); p0.h = hi(PLL_DIV); p0.l = lo(PLL_DIV); w[p0] = r0.l; @@ -395,7 +391,6 @@ ENTRY(_start_dma_code) SSYNC; RTS; -ENDPROC(_start_dma_code) #endif /* CONFIG_BFIN_KERNEL_CLOCK */ ENTRY(_bfin_reset) diff --git a/trunk/arch/blackfin/mach-bf561/ints-priority.c b/trunk/arch/blackfin/mach-bf561/ints-priority.c index 86e3b0ee93f4..89c52ff95b27 100644 --- a/trunk/arch/blackfin/mach-bf561/ints-priority.c +++ b/trunk/arch/blackfin/mach-bf561/ints-priority.c @@ -4,7 +4,7 @@ * Author: Michael Hennerich * * Created: - * Description: Set up the interrupt priorities + * Description: Set up the interupt priorities * * Modified: * Copyright 2004-2006 Analog Devices Inc. diff --git a/trunk/arch/blackfin/mach-common/cache.S b/trunk/arch/blackfin/mach-common/cache.S index 8bd2af1935bd..bb9446ef66ef 100644 --- a/trunk/arch/blackfin/mach-common/cache.S +++ b/trunk/arch/blackfin/mach-common/cache.S @@ -70,7 +70,6 @@ ENTRY(_cache_invalidate) .Lno_dcache_b: R7 = [SP++]; RTS; -ENDPROC(_cache_invalidate) /* Invalidate the Entire Instruction cache by * disabling IMC bit @@ -107,8 +106,6 @@ ENTRY(_invalidate_entire_icache) ( R7:5) = [SP++]; RTS; -ENDPROC(_invalidate_entire_icache) -ENDPROC(_icache_invalidate) /* * blackfin_cache_flush_range(start, end) @@ -132,7 +129,6 @@ ENTRY(_blackfin_icache_flush_range) IFLUSH [P0]; SSYNC; RTS; -ENDPROC(_blackfin_icache_flush_range) /* * blackfin_icache_dcache_flush_range(start, end) @@ -159,7 +155,6 @@ ENTRY(_blackfin_icache_dcache_flush_range) FLUSH [P0]; SSYNC; RTS; -ENDPROC(_blackfin_icache_dcache_flush_range) /* Throw away all D-cached data in specified region without any obligation to * write them back. However, we must clean the D-cached entries around the @@ -188,7 +183,6 @@ ENTRY(_blackfin_dcache_invalidate_range) FLUSHINV[P0]; SSYNC; RTS; -ENDPROC(_blackfin_dcache_invalidate_range) /* Invalidate the Entire Data cache by * clearing DMC[1:0] bits @@ -227,8 +221,6 @@ ENTRY(_dcache_invalidate) ( R7:6) = [SP++]; RTS; -ENDPROC(_dcache_invalidate) -ENDPROC(_invalidate_entire_dcache) ENTRY(_blackfin_dcache_flush_range) R2 = -L1_CACHE_BYTES; @@ -249,7 +241,6 @@ ENTRY(_blackfin_dcache_flush_range) FLUSH[P0]; SSYNC; RTS; -ENDPROC(_blackfin_dcache_flush_range) ENTRY(_blackfin_dflush_page) P1 = 1 << (PAGE_SHIFT - L1_CACHE_SHIFT); @@ -260,4 +251,3 @@ ENTRY(_blackfin_dflush_page) .Lfl1: FLUSH [P0++]; SSYNC; RTS; -ENDPROC(_blackfin_dflush_page) diff --git a/trunk/arch/blackfin/mach-common/cacheinit.S b/trunk/arch/blackfin/mach-common/cacheinit.S index 7924a90d9658..8c17f099e5eb 100644 --- a/trunk/arch/blackfin/mach-common/cacheinit.S +++ b/trunk/arch/blackfin/mach-common/cacheinit.S @@ -86,8 +86,6 @@ ENTRY(_bfin_icache_init) SSYNC; STI R2; RTS; - -ENDPROC(_bfin_icache_init) #endif #if defined(CONFIG_BLKFIN_DCACHE) @@ -136,6 +134,4 @@ ENTRY(_bfin_dcache_init) SSYNC; STI R2; RTS; - -ENDPROC(_bfin_dcache_init) #endif diff --git a/trunk/arch/blackfin/mach-common/cplbhdlr.S b/trunk/arch/blackfin/mach-common/cplbhdlr.S index 2f3c72c23997..b979067c49ef 100644 --- a/trunk/arch/blackfin/mach-common/cplbhdlr.S +++ b/trunk/arch/blackfin/mach-common/cplbhdlr.S @@ -42,6 +42,8 @@ .align 2 +.global __cplb_hdr; +.type __cplb_hdr, STT_FUNC; ENTRY(__cplb_hdr) R2 = SEQSTAT; @@ -126,5 +128,3 @@ ENTRY(__cplb_hdr) call _panic_cplb_error; SP += 12; JUMP _handle_bad_cplb; - -ENDPROC(__cplb_hdr) diff --git a/trunk/arch/blackfin/mach-common/cplbinfo.c b/trunk/arch/blackfin/mach-common/cplbinfo.c index caa9623e6bd6..d65fac39d1bf 100644 --- a/trunk/arch/blackfin/mach-common/cplbinfo.c +++ b/trunk/arch/blackfin/mach-common/cplbinfo.c @@ -82,7 +82,7 @@ static char *cplb_print_entry(char *buf, int type) int entry = 0, used_cplb = 0; if (type == CPLB_I) { - buf += sprintf(buf, "Instruction CPLB entry:\n"); + buf += sprintf(buf, "Instrction CPLB entry:\n"); p_addr = ipdt_table; p_data = ipdt_table + 1; p_icount = ipdt_swapcount_table; diff --git a/trunk/arch/blackfin/mach-common/cplbmgr.S b/trunk/arch/blackfin/mach-common/cplbmgr.S index e4b47e09cf13..f5efc4bc65e6 100644 --- a/trunk/arch/blackfin/mach-common/cplbmgr.S +++ b/trunk/arch/blackfin/mach-common/cplbmgr.S @@ -592,7 +592,6 @@ ENTRY(_cplb_mgr) ( R7:4,P5:3 ) = [SP++]; R0 = CPLB_RELOADED; RTS; -ENDPROC(_cplb_mgr) .data .align 4; diff --git a/trunk/arch/blackfin/mach-common/entry.S b/trunk/arch/blackfin/mach-common/entry.S index 40045b1386ad..7d0368772cda 100644 --- a/trunk/arch/blackfin/mach-common/entry.S +++ b/trunk/arch/blackfin/mach-common/entry.S @@ -103,7 +103,6 @@ ENTRY(_ex_dcplb) if !cc jump _return_from_exception; /* fall through */ #endif -ENDPROC(_ex_dcplb) ENTRY(_ex_icplb) (R7:6,P5:4) = [sp++]; @@ -114,7 +113,6 @@ ENTRY(_ex_icplb) RESTORE_ALL_SYS SP = RETN; rtx; -ENDPROC(_ex_icplb) ENTRY(_ex_spinlock) /* Transform this into a syscall - twiddle the syscall vector. */ @@ -125,7 +123,6 @@ ENTRY(_ex_spinlock) [p5] = r7; csync; /* Fall through. */ -ENDPROC(_ex_spinlock) ENTRY(_ex_syscall) DEBUG_START_HWTRACE @@ -134,7 +131,6 @@ ENTRY(_ex_syscall) raise 15; /* invoked by TRAP #0, for sys call */ sp = retn; rtx -ENDPROC(_ex_syscall) ENTRY(_spinlock_bh) SAVE_ALL_SYS @@ -154,14 +150,12 @@ ENTRY(_spinlock_bh) [SP + PT_R0] = R0; RESTORE_ALL_SYS rti; -ENDPROC(_spinlock_bh) ENTRY(_ex_soft_bp) r7 = retx; r7 += -2; retx = r7; jump.s _ex_trap_c; -ENDPROC(_ex_soft_bp) ENTRY(_ex_single_step) r7 = retx; @@ -197,7 +191,6 @@ _return_from_exception: ASTAT = [sp++]; sp = retn; rtx; -ENDPROC(_ex_soft_bp) ENTRY(_handle_bad_cplb) /* To get here, we just tried and failed to change a CPLB @@ -257,7 +250,6 @@ ENTRY(_ex_trap_c) SP = RETN; raise 5; rtx; -ENDPROC(_ex_trap_c) ENTRY(_exception_to_level5) SAVE_ALL_SYS @@ -322,7 +314,6 @@ ENTRY(_exception_to_level5) call _ret_from_exception; RESTORE_ALL_SYS rti; -ENDPROC(_exception_to_level5) ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/ /* Since the kernel stack can be anywhere, it's not guaranteed to be @@ -351,7 +342,6 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/ r7 = -ENOSYS; /* signextending enough */ [sp + PT_R0] = r7; /* return value from system call */ jump .Lsyscall_really_exit; -ENDPROC(_trap) ENTRY(_kernel_execve) link SIZEOF_PTREGS; @@ -406,7 +396,6 @@ ENTRY(_kernel_execve) 1: unlink; rts; -ENDPROC(_kernel_execve) ENTRY(_system_call) /* Store IPEND */ @@ -514,7 +503,6 @@ ENTRY(_system_call) r5 = [sp + PT_RESERVED]; rets = r5; rts; -ENDPROC(_system_call) _sys_trace: call _syscall_trace; @@ -543,7 +531,6 @@ _sys_trace: call _syscall_trace; jump .Lresume_userspace; -ENDPROC(_sys_trace) ENTRY(_resume) /* @@ -593,7 +580,6 @@ _new_old_task: * in "new" task. */ rts; -ENDPROC(_resume) ENTRY(_ret_from_exception) p2.l = lo(IPEND); @@ -652,7 +638,6 @@ ENTRY(_ret_from_exception) syscfg = r0; 5: rts; -ENDPROC(_ret_from_exception) ENTRY(_return_from_int) /* If someone else already raised IRQ 15, do nothing. */ @@ -695,7 +680,6 @@ ENTRY(_return_from_int) rti; 2: rts; -ENDPROC(_return_from_int) ENTRY(_lower_to_irq14) #if defined(ANOMALY_05000281) @@ -761,7 +745,6 @@ _schedule_and_signal: 1: RESTORE_CONTEXT rti; -ENDPROC(_lower_to_irq14) /* Make sure when we start, that the circular buffer is initialized properly * R0 and P0 are call clobbered, so we can use them here. @@ -775,7 +758,6 @@ ENTRY(_init_exception_buff) p0.l = _out_ptr_excause; [p0] = r0; rts; -ENDPROC(_init_exception_buff) /* * Put these in the kernel data section - that should always be covered by diff --git a/trunk/arch/blackfin/mach-common/interrupt.S b/trunk/arch/blackfin/mach-common/interrupt.S index b69f517a650b..dd45664f0d02 100644 --- a/trunk/arch/blackfin/mach-common/interrupt.S +++ b/trunk/arch/blackfin/mach-common/interrupt.S @@ -66,7 +66,6 @@ ENTRY(_evt_emulation) SP += 12; /* - GDB stub fills this in by itself (if defined) */ rte; -ENDPROC(_evt_emulation) #endif /* Common interrupt entry code. First we do CLI, then push @@ -252,4 +251,3 @@ ENTRY(_evt_system_call) #endif call _system_call; jump .Lcommon_restore_context; -ENDPROC(_evt_system_call) diff --git a/trunk/arch/blackfin/mach-common/ints-priority-dc.c b/trunk/arch/blackfin/mach-common/ints-priority-dc.c index 80943bbd37c2..f3cf07036c2a 100644 --- a/trunk/arch/blackfin/mach-common/ints-priority-dc.c +++ b/trunk/arch/blackfin/mach-common/ints-priority-dc.c @@ -4,7 +4,7 @@ * Author: * * Created: ? - * Description: Set up the interrupt priorities + * Description: Set up the interupt priorities * * Modified: * 1996 Roman Zippel diff --git a/trunk/arch/blackfin/mach-common/ints-priority-sc.c b/trunk/arch/blackfin/mach-common/ints-priority-sc.c index 2cfc7d5aec5c..34b62288ec3c 100644 --- a/trunk/arch/blackfin/mach-common/ints-priority-sc.c +++ b/trunk/arch/blackfin/mach-common/ints-priority-sc.c @@ -4,7 +4,7 @@ * Author: * * Created: ? - * Description: Set up the interrupt priorities + * Description: Set up the interupt priorities * * Modified: * 1996 Roman Zippel diff --git a/trunk/arch/blackfin/mach-common/lock.S b/trunk/arch/blackfin/mach-common/lock.S index 386ac8dda076..2cbb15b33925 100644 --- a/trunk/arch/blackfin/mach-common/lock.S +++ b/trunk/arch/blackfin/mach-common/lock.S @@ -155,7 +155,6 @@ ENTRY(_cache_grab_lock) ( R7:0,P5:0 ) = [SP++]; RTS; -ENDPROC(_cache_grab_lock) /* After the execution of critical code, the code is now locked into * the cache way. Now we need to set ILOC. @@ -187,7 +186,6 @@ ENTRY(_cache_lock) ( R7:0,P5:0 ) = [SP++]; RTS; -ENDPROC(_cache_lock) #endif /* BLKFIN_CACHE_LOCK */ @@ -195,6 +193,7 @@ ENDPROC(_cache_lock) */ ENTRY(_read_iloc) + P1.H = (IMEM_CONTROL >> 16); P1.L = (IMEM_CONTROL & 0xFFFF); R1 = 0xF; @@ -203,4 +202,3 @@ ENTRY(_read_iloc) R0 = R0 & R1; RTS; -ENDPROC(_read_iloc) diff --git a/trunk/arch/blackfin/mach-common/pm.c b/trunk/arch/blackfin/mach-common/pm.c index 150ef5d088dc..afed5246dd9e 100644 --- a/trunk/arch/blackfin/mach-common/pm.c +++ b/trunk/arch/blackfin/mach-common/pm.c @@ -39,7 +39,7 @@ #include #include #include -#include + #ifdef CONFIG_PM_WAKEUP_GPIO_POLAR_H #define WAKEUP_TYPE PM_WAKE_HIGH diff --git a/trunk/arch/blackfin/mm/blackfin_sram.c b/trunk/arch/blackfin/mm/blackfin_sram.c index 68107924639e..dd0c6501c424 100644 --- a/trunk/arch/blackfin/mm/blackfin_sram.c +++ b/trunk/arch/blackfin/mm/blackfin_sram.c @@ -7,7 +7,7 @@ * Description: SRAM driver for Blackfin ADSP-BF5xx * * Modified: - * Copyright 2004-2007 Analog Devices Inc. + * Copyright 2004-2006 Analog Devices Inc. * * Bugs: Enter bugs at http://blackfin.uclinux.org/ * @@ -63,7 +63,6 @@ struct l1_sram_piece { void *paddr; int size; int flag; - pid_t pid; }; static struct l1_sram_piece l1_ssram[CONFIG_L1_MAX_PIECE]; @@ -81,7 +80,7 @@ static struct l1_sram_piece l1_inst_sram[CONFIG_L1_MAX_PIECE]; #endif /* L1 Scratchpad SRAM initialization function */ -void __init l1sram_init(void) +void l1sram_init(void) { printk(KERN_INFO "Blackfin Scratchpad data SRAM: %d KB\n", L1_SCRATCH_LENGTH >> 10); @@ -95,43 +94,42 @@ void __init l1sram_init(void) spin_lock_init(&l1sram_lock); } -void __init l1_data_sram_init(void) +void l1_data_sram_init(void) { #if L1_DATA_A_LENGTH != 0 + printk(KERN_INFO "Blackfin DATA_A SRAM: %d KB\n", + L1_DATA_A_LENGTH >> 10); + memset(&l1_data_A_sram, 0x00, sizeof(l1_data_A_sram)); - l1_data_A_sram[0].paddr = (void *)L1_DATA_A_START + - (_ebss_l1 - _sdata_l1); + l1_data_A_sram[0].paddr = (void*)L1_DATA_A_START + + (_ebss_l1 - _sdata_l1); l1_data_A_sram[0].size = L1_DATA_A_LENGTH - (_ebss_l1 - _sdata_l1); l1_data_A_sram[0].flag = SRAM_SLT_FREE; - - printk(KERN_INFO "Blackfin Data A SRAM: %d KB (%d KB free)\n", - L1_DATA_A_LENGTH >> 10, l1_data_A_sram[0].size >> 10); #endif #if L1_DATA_B_LENGTH != 0 + printk(KERN_INFO "Blackfin DATA_B SRAM: %d KB\n", + L1_DATA_B_LENGTH >> 10); + memset(&l1_data_B_sram, 0x00, sizeof(l1_data_B_sram)); - l1_data_B_sram[0].paddr = (void *)L1_DATA_B_START + - (_ebss_b_l1 - _sdata_b_l1); - l1_data_B_sram[0].size = L1_DATA_B_LENGTH - (_ebss_b_l1 - _sdata_b_l1); + l1_data_B_sram[0].paddr = (void*)L1_DATA_B_START; + l1_data_B_sram[0].size = L1_DATA_B_LENGTH; l1_data_B_sram[0].flag = SRAM_SLT_FREE; - - printk(KERN_INFO "Blackfin Data B SRAM: %d KB (%d KB free)\n", - L1_DATA_B_LENGTH >> 10, l1_data_B_sram[0].size >> 10); #endif /* mutex initialize */ spin_lock_init(&l1_data_sram_lock); } -void __init l1_inst_sram_init(void) +void l1_inst_sram_init(void) { #if L1_CODE_LENGTH != 0 + printk(KERN_INFO "Blackfin Instruction SRAM: %d KB\n", + L1_CODE_LENGTH >> 10); + memset(&l1_inst_sram, 0x00, sizeof(l1_inst_sram)); l1_inst_sram[0].paddr = (void*)L1_CODE_START + (_etext_l1 - _stext_l1); l1_inst_sram[0].size = L1_CODE_LENGTH - (_etext_l1 - _stext_l1); l1_inst_sram[0].flag = SRAM_SLT_FREE; - - printk(KERN_INFO "Blackfin Instruction SRAM: %d KB (%d KB free)\n", - L1_CODE_LENGTH >> 10, l1_inst_sram[0].size >> 10); #endif /* mutex initialize */ @@ -151,13 +149,12 @@ static void *_l1_sram_alloc(size_t size, struct l1_sram_piece *pfree, int count) size = (size + 3) & ~3; /* not use the good method to match the best slot !!! */ - /* search an available memory slot */ + /* search an available memeory slot */ for (i = 0; i < count; i++) { if ((pfree[i].flag == SRAM_SLT_FREE) && (pfree[i].size >= size)) { addr = pfree[i].paddr; pfree[i].flag = SRAM_SLT_ALLOCATED; - pfree[i].pid = current->pid; index = i; break; } @@ -165,11 +162,10 @@ static void *_l1_sram_alloc(size_t size, struct l1_sram_piece *pfree, int count) if (i >= count) return NULL; - /* updated the NULL memory slot !!! */ + /* updated the NULL memeory slot !!! */ if (pfree[i].size > size) { for (i = 0; i < count; i++) { if (pfree[i].flag == SRAM_SLT_NULL) { - pfree[i].pid = 0; pfree[i].flag = SRAM_SLT_FREE; pfree[i].paddr = addr + size; pfree[i].size = pfree[index].size - size; @@ -190,7 +186,7 @@ static void *_l1_sram_alloc_max(struct l1_sram_piece *pfree, int count, int i, index = -1; void *addr = NULL; - /* search an available memory slot */ + /* search an available memeory slot */ for (i = 0; i < count; i++) { if (pfree[i].flag == SRAM_SLT_FREE && pfree[i].size > best) { addr = pfree[i].paddr; @@ -202,15 +198,13 @@ static void *_l1_sram_alloc_max(struct l1_sram_piece *pfree, int count, return NULL; *psize = best; - pfree[index].pid = current->pid; pfree[index].flag = SRAM_SLT_ALLOCATED; return addr; } /* L1 memory free function */ static int _l1_sram_free(const void *addr, - struct l1_sram_piece *pfree, - int count) + struct l1_sram_piece *pfree, int count) { int i, index = 0; @@ -228,14 +222,12 @@ static int _l1_sram_free(const void *addr, if (i >= count) return -1; - pfree[index].pid = 0; pfree[index].flag = SRAM_SLT_FREE; /* link the next address slot */ for (i = 0; i < count; i++) { if (((pfree[index].paddr + pfree[index].size) == pfree[i].paddr) && (pfree[i].flag == SRAM_SLT_FREE)) { - pfree[i].pid = 0; pfree[i].flag = SRAM_SLT_NULL; pfree[index].size += pfree[i].size; pfree[index].flag = SRAM_SLT_FREE; @@ -546,64 +538,3 @@ void *sram_alloc_with_lsl(size_t size, unsigned long flags) return addr; } EXPORT_SYMBOL(sram_alloc_with_lsl); - -#ifdef CONFIG_PROC_FS -/* Once we get a real allocator, we'll throw all of this away. - * Until then, we need some sort of visibility into the L1 alloc. - */ -static void _l1sram_proc_read(char *buf, int *len, const char *desc, - struct l1_sram_piece *pfree, const int array_size) -{ - int i; - - *len += sprintf(&buf[*len], "--- L1 %-14s Size PID State\n", desc); - for (i = 0; i < array_size; ++i) { - const char *alloc_type; - switch (pfree[i].flag) { - case SRAM_SLT_NULL: alloc_type = "NULL"; break; - case SRAM_SLT_FREE: alloc_type = "FREE"; break; - case SRAM_SLT_ALLOCATED: alloc_type = "ALLOCATED"; break; - default: alloc_type = "????"; break; - } - *len += sprintf(&buf[*len], "%p-%p %8i %4i %s\n", - pfree[i].paddr, pfree[i].paddr + pfree[i].size, - pfree[i].size, pfree[i].pid, alloc_type); - } -} -static int l1sram_proc_read(char *buf, char **start, off_t offset, int count, - int *eof, void *data) -{ - int len = 0; - - _l1sram_proc_read(buf, &len, "Scratchpad", - l1_ssram, ARRAY_SIZE(l1_ssram)); -#if L1_DATA_A_LENGTH != 0 - _l1sram_proc_read(buf, &len, "Data A", - l1_data_A_sram, ARRAY_SIZE(l1_data_A_sram)); -#endif -#if L1_DATA_B_LENGTH != 0 - _l1sram_proc_read(buf, &len, "Data B", - l1_data_B_sram, ARRAY_SIZE(l1_data_B_sram)); -#endif -#if L1_CODE_LENGTH != 0 - _l1sram_proc_read(buf, &len, "Instruction", - l1_inst_sram, ARRAY_SIZE(l1_inst_sram)); -#endif - - return len; -} - -static int __init l1sram_proc_init(void) -{ - struct proc_dir_entry *ptr; - ptr = create_proc_entry("sram", S_IFREG | S_IRUGO, NULL); - if (!ptr) { - printk(KERN_WARNING "unable to create /proc/sram\n"); - return -1; - } - ptr->owner = THIS_MODULE; - ptr->read_proc = l1sram_proc_read; - return 0; -} -late_initcall(l1sram_proc_init); -#endif diff --git a/trunk/arch/blackfin/mm/init.c b/trunk/arch/blackfin/mm/init.c index 570356dbe028..d6cf1059560d 100644 --- a/trunk/arch/blackfin/mm/init.c +++ b/trunk/arch/blackfin/mm/init.c @@ -7,7 +7,7 @@ * Description: * * Modified: - * Copyright 2004-2007 Analog Devices Inc. + * Copyright 2004-2006 Analog Devices Inc. * * Bugs: Enter bugs at http://blackfin.uclinux.org/ * @@ -53,7 +53,7 @@ static unsigned long empty_bad_page; unsigned long empty_zero_page; -void __init show_mem(void) +void show_mem(void) { unsigned long i; int free = 0, total = 0, reserved = 0, shared = 0; @@ -86,7 +86,7 @@ void __init show_mem(void) * The parameters are pointers to where to stick the starting and ending * addresses of available kernel virtual memory. */ -void __init paging_init(void) +void paging_init(void) { /* * make sure start_mem is page aligned, otherwise bootmem and @@ -125,7 +125,7 @@ void __init paging_init(void) } } -void __init mem_init(void) +void mem_init(void) { unsigned int codek = 0, datak = 0, initk = 0; unsigned long tmp; @@ -169,7 +169,7 @@ void __init mem_init(void) } #ifdef CONFIG_BLK_DEV_INITRD -void __init free_initrd_mem(unsigned long start, unsigned long end) +void free_initrd_mem(unsigned long start, unsigned long end) { int pages = 0; for (; start < end; start += PAGE_SIZE) { @@ -183,14 +183,14 @@ void __init free_initrd_mem(unsigned long start, unsigned long end) } #endif -void __init free_initmem(void) +void free_initmem(void) { #ifdef CONFIG_RAMKERNEL unsigned long addr; - /* - * the following code should be cool even if these sections - * are not page aligned. - */ +/* + * the following code should be cool even if these sections + * are not page aligned. + */ addr = PAGE_ALIGN((unsigned long)(__init_begin)); /* next to check that the page we free is not a partial page */ for (; addr + PAGE_SIZE < (unsigned long)(__init_end); diff --git a/trunk/arch/i386/kernel/cpu/perfctr-watchdog.c b/trunk/arch/i386/kernel/cpu/perfctr-watchdog.c index f0b67630b90d..2b04c8f1db62 100644 --- a/trunk/arch/i386/kernel/cpu/perfctr-watchdog.c +++ b/trunk/arch/i386/kernel/cpu/perfctr-watchdog.c @@ -28,7 +28,7 @@ struct wd_ops { void (*unreserve)(void); int (*setup)(unsigned nmi_hz); void (*rearm)(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz); - void (*stop)(void); + void (*stop)(void *); unsigned perfctr; unsigned evntsel; u64 checkbit; @@ -142,7 +142,7 @@ void disable_lapic_nmi_watchdog(void) if (atomic_read(&nmi_active) <= 0) return; - on_each_cpu(stop_apic_nmi_watchdog, NULL, 0, 1); + on_each_cpu(wd_ops->stop, NULL, 0, 1); wd_ops->unreserve(); BUG_ON(atomic_read(&nmi_active) != 0); @@ -255,7 +255,7 @@ static int setup_k7_watchdog(unsigned nmi_hz) return 1; } -static void single_msr_stop_watchdog(void) +static void single_msr_stop_watchdog(void *arg) { struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk); @@ -276,8 +276,8 @@ static int single_msr_reserve(void) static void single_msr_unreserve(void) { - release_evntsel_nmi(wd_ops->evntsel); - release_perfctr_nmi(wd_ops->perfctr); + release_evntsel_nmi(wd_ops->perfctr); + release_perfctr_nmi(wd_ops->evntsel); } static void single_msr_rearm(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz) @@ -442,7 +442,7 @@ static int setup_p4_watchdog(unsigned nmi_hz) return 1; } -static void stop_p4_watchdog(void) +static void stop_p4_watchdog(void *arg) { struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk); wrmsr(wd->cccr_msr, 0, 0); @@ -475,10 +475,10 @@ static void p4_unreserve(void) { #ifdef CONFIG_SMP if (smp_num_siblings > 1) - release_perfctr_nmi(MSR_P4_IQ_PERFCTR1); + release_evntsel_nmi(MSR_P4_IQ_PERFCTR1); #endif - release_evntsel_nmi(MSR_P4_CRU_ESCR0); - release_perfctr_nmi(MSR_P4_IQ_PERFCTR0); + release_evntsel_nmi(MSR_P4_IQ_PERFCTR0); + release_perfctr_nmi(MSR_P4_CRU_ESCR0); } static void p4_rearm(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz) @@ -614,12 +614,6 @@ int lapic_watchdog_init(unsigned nmi_hz) probe_nmi_watchdog(); if (!wd_ops) return -1; - - if (!wd_ops->reserve()) { - printk(KERN_ERR - "NMI watchdog: cannot reserve perfctrs\n"); - return -1; - } } if (!(wd_ops->setup(nmi_hz))) { @@ -634,7 +628,7 @@ int lapic_watchdog_init(unsigned nmi_hz) void lapic_watchdog_stop(void) { if (wd_ops) - wd_ops->stop(); + wd_ops->stop(NULL); } unsigned lapic_adjust_nmi_hz(unsigned hz) diff --git a/trunk/arch/mips/kernel/smp-mt.c b/trunk/arch/mips/kernel/smp-mt.c index b8fa7ddd78f6..64b62bdfb4f6 100644 --- a/trunk/arch/mips/kernel/smp-mt.c +++ b/trunk/arch/mips/kernel/smp-mt.c @@ -129,13 +129,13 @@ static irqreturn_t ipi_call_interrupt(int irq, void *dev_id) static struct irqaction irq_resched = { .handler = ipi_resched_interrupt, - .flags = IRQF_DISABLED|IRQF_PERCPU, + .flags = IRQF_DISABLED, .name = "IPI_resched" }; static struct irqaction irq_call = { .handler = ipi_call_interrupt, - .flags = IRQF_DISABLED|IRQF_PERCPU, + .flags = IRQF_DISABLED, .name = "IPI_call" }; @@ -275,7 +275,10 @@ void __init plat_prepare_cpus(unsigned int max_cpus) setup_irq(cpu_ipi_resched_irq, &irq_resched); setup_irq(cpu_ipi_call_irq, &irq_call); + /* need to mark IPI's as IRQ_PER_CPU */ + irq_desc[cpu_ipi_resched_irq].status |= IRQ_PER_CPU; set_irq_handler(cpu_ipi_resched_irq, handle_percpu_irq); + irq_desc[cpu_ipi_call_irq].status |= IRQ_PER_CPU; set_irq_handler(cpu_ipi_call_irq, handle_percpu_irq); } @@ -323,11 +326,8 @@ void prom_boot_secondary(int cpu, struct task_struct *idle) void prom_init_secondary(void) { - /* Enable per-cpu interrupts */ - - /* This is Malta specific: IPI,performance and timer inetrrupts */ write_c0_status((read_c0_status() & ~ST0_IM ) | - (STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP6 | STATUSF_IP7)); + (STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP7)); } void prom_smp_finish(void) diff --git a/trunk/arch/mips/kernel/time.c b/trunk/arch/mips/kernel/time.c index 7def1ff3da94..751b4a18b133 100644 --- a/trunk/arch/mips/kernel/time.c +++ b/trunk/arch/mips/kernel/time.c @@ -199,30 +199,6 @@ int (*perf_irq)(void) = null_perf_irq; EXPORT_SYMBOL(null_perf_irq); EXPORT_SYMBOL(perf_irq); -/* - * Performance counter IRQ or -1 if shared with timer - */ -int mipsxx_perfcount_irq; -EXPORT_SYMBOL(mipsxx_perfcount_irq); - -/* - * Possibly handle a performance counter interrupt. - * Return true if the timer interrupt should not be checked - */ -static inline int handle_perf_irq (int r2) -{ - /* - * The performance counter overflow interrupt may be shared with the - * timer interrupt (mipsxx_perfcount_irq < 0). If it is and a - * performance counter has overflowed (perf_irq() == IRQ_HANDLED) - * and we can't reliably determine if a counter interrupt has also - * happened (!r2) then don't check for a timer interrupt. - */ - return (mipsxx_perfcount_irq < 0) && - perf_irq() == IRQ_HANDLED && - !r2; -} - asmlinkage void ll_timer_interrupt(int irq) { int r2 = cpu_has_mips_r2; @@ -230,13 +206,19 @@ asmlinkage void ll_timer_interrupt(int irq) irq_enter(); kstat_this_cpu.irqs[irq]++; - if (handle_perf_irq(r2)) - goto out; - - if (r2 && ((read_c0_cause() & (1 << 30)) == 0)) - goto out; + /* + * Suckage alert: + * Before R2 of the architecture there was no way to see if a + * performance counter interrupt was pending, so we have to run the + * performance counter interrupt handler anyway. + */ + if (!r2 || (read_c0_cause() & (1 << 26))) + if (perf_irq()) + goto out; - timer_interrupt(irq, NULL); + /* we keep interrupt disabled all the time */ + if (!r2 || (read_c0_cause() & (1 << 30))) + timer_interrupt(irq, NULL); out: irq_exit(); @@ -276,7 +258,7 @@ unsigned int mips_hpt_frequency; static struct irqaction timer_irqaction = { .handler = timer_interrupt, - .flags = IRQF_DISABLED | IRQF_PERCPU, + .flags = IRQF_DISABLED, .name = "timer", }; diff --git a/trunk/arch/mips/mips-boards/generic/init.c b/trunk/arch/mips/mips-boards/generic/init.c index 4eabc1eadd23..88e9c2a7a2f9 100644 --- a/trunk/arch/mips/mips-boards/generic/init.c +++ b/trunk/arch/mips/mips-boards/generic/init.c @@ -57,8 +57,7 @@ int *_prom_argv, *_prom_envp; int init_debug = 0; -int mips_revision_corid; -int mips_revision_sconid; +unsigned int mips_revision_corid; /* Bonito64 system controller register base. */ unsigned long _pcictrl_bonito; @@ -276,38 +275,13 @@ void __init prom_init(void) else mips_revision_corid = MIPS_REVISION_CORID_CORE_EMUL_MSC; } - - mips_revision_sconid = MIPS_REVISION_SCONID; - if (mips_revision_sconid == MIPS_REVISION_SCON_OTHER) { - switch (mips_revision_corid) { - case MIPS_REVISION_CORID_QED_RM5261: - case MIPS_REVISION_CORID_CORE_LV: - case MIPS_REVISION_CORID_CORE_FPGA: - case MIPS_REVISION_CORID_CORE_FPGAR2: - mips_revision_sconid = MIPS_REVISION_SCON_GT64120; - break; - case MIPS_REVISION_CORID_CORE_EMUL_BON: - case MIPS_REVISION_CORID_BONITO64: - case MIPS_REVISION_CORID_CORE_20K: - mips_revision_sconid = MIPS_REVISION_SCON_BONITO; - break; - case MIPS_REVISION_CORID_CORE_MSC: - case MIPS_REVISION_CORID_CORE_FPGA2: - case MIPS_REVISION_CORID_CORE_FPGA3: - case MIPS_REVISION_CORID_CORE_24K: - case MIPS_REVISION_CORID_CORE_EMUL_MSC: - mips_revision_sconid = MIPS_REVISION_SCON_SOCIT; - break; - default: - mips_display_message("CC Error"); - while (1); /* We die here... */ - } - } - - switch (mips_revision_sconid) { + switch(mips_revision_corid) { u32 start, map, mask, data; - case MIPS_REVISION_SCON_GT64120: + case MIPS_REVISION_CORID_QED_RM5261: + case MIPS_REVISION_CORID_CORE_LV: + case MIPS_REVISION_CORID_CORE_FPGA: + case MIPS_REVISION_CORID_CORE_FPGAR2: /* * Setup the North bridge to do Master byte-lane swapping * when running in bigendian. @@ -331,7 +305,9 @@ void __init prom_init(void) set_io_port_base(MALTA_GT_PORT_BASE); break; - case MIPS_REVISION_SCON_BONITO: + case MIPS_REVISION_CORID_CORE_EMUL_BON: + case MIPS_REVISION_CORID_BONITO64: + case MIPS_REVISION_CORID_CORE_20K: _pcictrl_bonito_pcicfg = (unsigned long)ioremap(BONITO_PCICFG_BASE, BONITO_PCICFG_SIZE); /* @@ -358,10 +334,13 @@ void __init prom_init(void) set_io_port_base(MALTA_BONITO_PORT_BASE); break; - case MIPS_REVISION_SCON_SOCIT: - case MIPS_REVISION_SCON_ROCIT: + case MIPS_REVISION_CORID_CORE_MSC: + case MIPS_REVISION_CORID_CORE_FPGA2: + case MIPS_REVISION_CORID_CORE_FPGA3: + case MIPS_REVISION_CORID_CORE_24K: + case MIPS_REVISION_CORID_CORE_EMUL_MSC: _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000); - mips_pci_controller: + mb(); MSC_READ(MSC01_PCI_CFG, data); MSC_WRITE(MSC01_PCI_CFG, data & ~MSC01_PCI_CFG_EN_BIT); @@ -395,15 +374,10 @@ void __init prom_init(void) set_io_port_base(MALTA_MSC_PORT_BASE); break; - case MIPS_REVISION_SCON_SOCITSC: - case MIPS_REVISION_SCON_SOCITSCP: - _pcictrl_msc = (unsigned long)ioremap(MIPS_SOCITSC_PCI_REG_BASE, 0x2000); - goto mips_pci_controller; - default: - /* Unknown system controller */ - mips_display_message("SC Error"); - while (1); /* We die here... */ + /* Unknown Core card */ + mips_display_message("CC Error"); + while(1); /* We die here... */ } #endif board_nmi_handler_setup = mips_nmi_setup; diff --git a/trunk/arch/mips/mips-boards/generic/pci.c b/trunk/arch/mips/mips-boards/generic/pci.c index c9852206890a..f98d60f78658 100644 --- a/trunk/arch/mips/mips-boards/generic/pci.c +++ b/trunk/arch/mips/mips-boards/generic/pci.c @@ -92,8 +92,11 @@ void __init mips_pcibios_init(void) struct pci_controller *controller; resource_size_t start, end, map, start1, end1, map1, map2, map3, mask; - switch (mips_revision_sconid) { - case MIPS_REVISION_SCON_GT64120: + switch (mips_revision_corid) { + case MIPS_REVISION_CORID_QED_RM5261: + case MIPS_REVISION_CORID_CORE_LV: + case MIPS_REVISION_CORID_CORE_FPGA: + case MIPS_REVISION_CORID_CORE_FPGAR2: /* * Due to a bug in the Galileo system controller, we need * to setup the PCI BAR for the Galileo internal registers. @@ -158,7 +161,9 @@ void __init mips_pcibios_init(void) controller = >64120_controller; break; - case MIPS_REVISION_SCON_BONITO: + case MIPS_REVISION_CORID_BONITO64: + case MIPS_REVISION_CORID_CORE_20K: + case MIPS_REVISION_CORID_CORE_EMUL_BON: /* Set up resource ranges from the controller's registers. */ map = BONITO_PCIMAP; map1 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO0) >> @@ -190,10 +195,11 @@ void __init mips_pcibios_init(void) controller = &bonito64_controller; break; - case MIPS_REVISION_SCON_SOCIT: - case MIPS_REVISION_SCON_ROCIT: - case MIPS_REVISION_SCON_SOCITSC: - case MIPS_REVISION_SCON_SOCITSCP: + case MIPS_REVISION_CORID_CORE_MSC: + case MIPS_REVISION_CORID_CORE_FPGA2: + case MIPS_REVISION_CORID_CORE_FPGA3: + case MIPS_REVISION_CORID_CORE_24K: + case MIPS_REVISION_CORID_CORE_EMUL_MSC: /* Set up resource ranges from the controller's registers. */ MSC_READ(MSC01_PCI_SC2PMBASL, start); MSC_READ(MSC01_PCI_SC2PMMSKL, mask); diff --git a/trunk/arch/mips/mips-boards/generic/time.c b/trunk/arch/mips/mips-boards/generic/time.c index 8f1000f51b3d..b41db9e7ab1f 100644 --- a/trunk/arch/mips/mips-boards/generic/time.c +++ b/trunk/arch/mips/mips-boards/generic/time.c @@ -53,8 +53,9 @@ unsigned long cpu_khz; +#define CPUCTR_IMASKBIT (0x100 << MIPSCPU_INT_CPUCTR) + static int mips_cpu_timer_irq; -extern int mipsxx_perfcount_irq; extern void smtc_timer_broadcast(int); static void mips_timer_dispatch(void) @@ -62,11 +63,6 @@ static void mips_timer_dispatch(void) do_IRQ(mips_cpu_timer_irq); } -static void mips_perf_dispatch(void) -{ - do_IRQ(mipsxx_perfcount_irq); -} - /* * Redeclare until I get around mopping the timer code insanity on MIPS. */ @@ -74,24 +70,6 @@ extern int null_perf_irq(void); extern int (*perf_irq)(void); -/* - * Possibly handle a performance counter interrupt. - * Return true if the timer interrupt should not be checked - */ -static inline int handle_perf_irq (int r2) -{ - /* - * The performance counter overflow interrupt may be shared with the - * timer interrupt (mipsxx_perfcount_irq < 0). If it is and a - * performance counter has overflowed (perf_irq() == IRQ_HANDLED) - * and we can't reliably determine if a counter interrupt has also - * happened (!r2) then don't check for a timer interrupt. - */ - return (mipsxx_perfcount_irq < 0) && - perf_irq() == IRQ_HANDLED && - !r2; -} - irqreturn_t mips_timer_interrupt(int irq, void *dev_id) { int cpu = smp_processor_id(); @@ -114,7 +92,8 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id) * We could be here due to timer interrupt, * perf counter overflow, or both. */ - (void) handle_perf_irq(1); + if (read_c0_cause() & (1 << 26)) + perf_irq(); if (read_c0_cause() & (1 << 30)) { /* @@ -136,19 +115,19 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id) #else /* CONFIG_MIPS_MT_SMTC */ int r2 = cpu_has_mips_r2; - if (handle_perf_irq(r2)) - goto out; - - if (r2 && ((read_c0_cause() & (1 << 30)) == 0)) - goto out; - if (cpu == 0) { /* * CPU 0 handles the global timer interrupt job and process * accounting resets count/compare registers to trigger next * timer int. */ - timer_interrupt(irq, NULL); + if (!r2 || (read_c0_cause() & (1 << 26))) + if (perf_irq()) + goto out; + + /* we keep interrupt disabled all the time */ + if (!r2 || (read_c0_cause() & (1 << 30))) + timer_interrupt(irq, NULL); } else { /* Everyone else needs to reset the timer int here as ll_local_timer_interrupt doesn't */ @@ -246,85 +225,35 @@ void __init mips_time_init(void) mips_scroll_message(); } -irqreturn_t mips_perf_interrupt(int irq, void *dev_id) -{ - return perf_irq(); -} - -static struct irqaction perf_irqaction = { - .handler = mips_perf_interrupt, - .flags = IRQF_DISABLED | IRQF_PERCPU, - .name = "performance", -}; - -void __init plat_perf_setup(struct irqaction *irq) -{ - int hwint = 0; - mipsxx_perfcount_irq = -1; - -#ifdef MSC01E_INT_BASE - if (cpu_has_veic) { - set_vi_handler (MSC01E_INT_PERFCTR, mips_perf_dispatch); - mipsxx_perfcount_irq = MSC01E_INT_BASE + MSC01E_INT_PERFCTR; - } else -#endif - if (cpu_has_mips_r2) { - /* - * Read IntCtl.IPPCI to determine the performance - * counter interrupt - */ - hwint = (read_c0_intctl () >> 26) & 7; - if (hwint != MIPSCPU_INT_CPUCTR) { - if (cpu_has_vint) - set_vi_handler (hwint, mips_perf_dispatch); - mipsxx_perfcount_irq = MIPSCPU_INT_BASE + hwint; - } - } - if (mipsxx_perfcount_irq >= 0) { -#ifdef CONFIG_MIPS_MT_SMTC - setup_irq_smtc(mipsxx_perfcount_irq, irq, 0x100 << hwint); -#else - setup_irq(mipsxx_perfcount_irq, irq); -#endif /* CONFIG_MIPS_MT_SMTC */ -#ifdef CONFIG_SMP - set_irq_handler(mipsxx_perfcount_irq, handle_percpu_irq); -#endif - } -} - void __init plat_timer_setup(struct irqaction *irq) { - int hwint = 0; #ifdef MSC01E_INT_BASE if (cpu_has_veic) { set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch); mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR; - } - else + } else #endif { - if (cpu_has_mips_r2) - /* - * Read IntCtl.IPTI to determine the timer interrupt - */ - hwint = (read_c0_intctl () >> 29) & 7; - else - hwint = MIPSCPU_INT_CPUCTR; if (cpu_has_vint) - set_vi_handler (hwint, mips_timer_dispatch); - mips_cpu_timer_irq = MIPSCPU_INT_BASE + hwint; + set_vi_handler (MIPSCPU_INT_CPUCTR, mips_timer_dispatch); + mips_cpu_timer_irq = MIPSCPU_INT_BASE + MIPSCPU_INT_CPUCTR; } + /* we are using the cpu counter for timer interrupts */ irq->handler = mips_timer_interrupt; /* we use our own handler */ #ifdef CONFIG_MIPS_MT_SMTC - setup_irq_smtc(mips_cpu_timer_irq, irq, 0x100 << hwint); + setup_irq_smtc(mips_cpu_timer_irq, irq, CPUCTR_IMASKBIT); #else setup_irq(mips_cpu_timer_irq, irq); #endif /* CONFIG_MIPS_MT_SMTC */ + #ifdef CONFIG_SMP + /* irq_desc(riptor) is a global resource, when the interrupt overlaps + on seperate cpu's the first one tries to handle the second interrupt. + The effect is that the int remains disabled on the second cpu. + Mark the interrupt with IRQ_PER_CPU to avoid any confusion */ + irq_desc[mips_cpu_timer_irq].status |= IRQ_PER_CPU; set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq); #endif - - plat_perf_setup(&perf_irqaction); } diff --git a/trunk/arch/mips/mips-boards/malta/malta_int.c b/trunk/arch/mips/mips-boards/malta/malta_int.c index 1668cc21d5b5..1cd830e3d933 100644 --- a/trunk/arch/mips/mips-boards/malta/malta_int.c +++ b/trunk/arch/mips/mips-boards/malta/malta_int.c @@ -53,19 +53,25 @@ static inline int mips_pcibios_iack(void) * Determine highest priority pending interrupt by performing * a PCI Interrupt Acknowledge cycle. */ - switch (mips_revision_sconid) { - case MIPS_REVISION_SCON_SOCIT: - case MIPS_REVISION_SCON_ROCIT: - case MIPS_REVISION_SCON_SOCITSC: - case MIPS_REVISION_SCON_SOCITSCP: + switch(mips_revision_corid) { + case MIPS_REVISION_CORID_CORE_MSC: + case MIPS_REVISION_CORID_CORE_FPGA2: + case MIPS_REVISION_CORID_CORE_FPGA3: + case MIPS_REVISION_CORID_CORE_24K: + case MIPS_REVISION_CORID_CORE_EMUL_MSC: MSC_READ(MSC01_PCI_IACK, irq); irq &= 0xff; break; - case MIPS_REVISION_SCON_GT64120: + case MIPS_REVISION_CORID_QED_RM5261: + case MIPS_REVISION_CORID_CORE_LV: + case MIPS_REVISION_CORID_CORE_FPGA: + case MIPS_REVISION_CORID_CORE_FPGAR2: irq = GT_READ(GT_PCI0_IACK_OFS); irq &= 0xff; break; - case MIPS_REVISION_SCON_BONITO: + case MIPS_REVISION_CORID_BONITO64: + case MIPS_REVISION_CORID_CORE_20K: + case MIPS_REVISION_CORID_CORE_EMUL_BON: /* The following will generate a PCI IACK cycle on the * Bonito controller. It's a little bit kludgy, but it * was the easiest way to implement it in hardware at @@ -83,7 +89,7 @@ static inline int mips_pcibios_iack(void) BONITO_PCIMAP_CFG = 0; break; default: - printk("Unknown system controller.\n"); + printk("Unknown Core card, don't know the system controller.\n"); return -1; } return irq; @@ -138,21 +144,27 @@ static void corehi_irqdispatch(void) Do it for the others too. */ - switch (mips_revision_sconid) { - case MIPS_REVISION_SCON_SOCIT: - case MIPS_REVISION_SCON_ROCIT: - case MIPS_REVISION_SCON_SOCITSC: - case MIPS_REVISION_SCON_SOCITSCP: + switch(mips_revision_corid) { + case MIPS_REVISION_CORID_CORE_MSC: + case MIPS_REVISION_CORID_CORE_FPGA2: + case MIPS_REVISION_CORID_CORE_FPGA3: + case MIPS_REVISION_CORID_CORE_24K: + case MIPS_REVISION_CORID_CORE_EMUL_MSC: ll_msc_irq(); break; - case MIPS_REVISION_SCON_GT64120: + case MIPS_REVISION_CORID_QED_RM5261: + case MIPS_REVISION_CORID_CORE_LV: + case MIPS_REVISION_CORID_CORE_FPGA: + case MIPS_REVISION_CORID_CORE_FPGAR2: intrcause = GT_READ(GT_INTRCAUSE_OFS); datalo = GT_READ(GT_CPUERR_ADDRLO_OFS); datahi = GT_READ(GT_CPUERR_ADDRHI_OFS); printk("GT_INTRCAUSE = %08x\n", intrcause); printk("GT_CPUERR_ADDR = %02x%08x\n", datahi, datalo); break; - case MIPS_REVISION_SCON_BONITO: + case MIPS_REVISION_CORID_BONITO64: + case MIPS_REVISION_CORID_CORE_20K: + case MIPS_REVISION_CORID_CORE_EMUL_BON: pcibadaddr = BONITO_PCIBADADDR; pcimstat = BONITO_PCIMSTAT; intisr = BONITO_INTISR; diff --git a/trunk/arch/mips/mips-boards/malta/malta_setup.c b/trunk/arch/mips/mips-boards/malta/malta_setup.c index 8f1b78dfd89f..c14b7bf89950 100644 --- a/trunk/arch/mips/mips-boards/malta/malta_setup.c +++ b/trunk/arch/mips/mips-boards/malta/malta_setup.c @@ -103,7 +103,9 @@ void __init plat_mem_setup(void) kgdb_config (); #endif - if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO) { + if ((mips_revision_corid == MIPS_REVISION_CORID_BONITO64) || + (mips_revision_corid == MIPS_REVISION_CORID_CORE_20K) || + (mips_revision_corid == MIPS_REVISION_CORID_CORE_EMUL_BON)) { char *argptr; argptr = prom_getcmdline(); diff --git a/trunk/arch/mips/oprofile/op_model_mipsxx.c b/trunk/arch/mips/oprofile/op_model_mipsxx.c index 1ea5c9c1010b..4f94fa261aae 100644 --- a/trunk/arch/mips/oprofile/op_model_mipsxx.c +++ b/trunk/arch/mips/oprofile/op_model_mipsxx.c @@ -177,10 +177,7 @@ static int mipsxx_perfcount_handler(void) unsigned int counters = op_model_mipsxx_ops.num_counters; unsigned int control; unsigned int counter; - int handled = IRQ_NONE; - - if (cpu_has_mips_r2 && !(read_c0_cause() & (1 << 26))) - return handled; + int handled = 0; switch (counters) { #define HANDLE_COUNTER(n) \ @@ -191,7 +188,7 @@ static int mipsxx_perfcount_handler(void) (counter & M_COUNTER_OVERFLOW)) { \ oprofile_add_sample(get_irq_regs(), n); \ w_c0_perfcntr ## n(reg.counter[n]); \ - handled = IRQ_HANDLED; \ + handled = 1; \ } HANDLE_COUNTER(3) HANDLE_COUNTER(2) diff --git a/trunk/arch/parisc/hpux/fs.c b/trunk/arch/parisc/hpux/fs.c index f2042e6466a4..d86e15776779 100644 --- a/trunk/arch/parisc/hpux/fs.c +++ b/trunk/arch/parisc/hpux/fs.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include @@ -70,6 +69,7 @@ struct getdents_callback { }; #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) +#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) static int filldir(void * __buf, const char * name, int namlen, loff_t offset, u64 ino, unsigned d_type) @@ -77,7 +77,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, struct hpux_dirent __user * dirent; struct getdents_callback * buf = (struct getdents_callback *) __buf; ino_t d_ino; - int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, sizeof(long)); + int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); buf->error = -EINVAL; /* only used if we fail.. */ if (reclen > buf->count) @@ -102,6 +102,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, } #undef NAME_OFFSET +#undef ROUND_UP int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned int count) { diff --git a/trunk/arch/parisc/kernel/entry.S b/trunk/arch/parisc/kernel/entry.S index 42598abf4576..8474f9e5ca10 100644 --- a/trunk/arch/parisc/kernel/entry.S +++ b/trunk/arch/parisc/kernel/entry.S @@ -954,6 +954,21 @@ intr_return: /* NOTE: Need to enable interrupts incase we schedule. */ ssm PSW_SM_I, %r0 + /* Check for software interrupts */ + + .import irq_stat,data + + load32 irq_stat,%r19 +#ifdef CONFIG_SMP + mfctl %cr30,%r1 + ldw TI_CPU(%r1),%r1 /* get cpu # - int */ + /* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) amount + ** irq_stat[] is defined using ____cacheline_aligned. + */ + SHLREG %r1,L1_CACHE_SHIFT,%r20 + add %r19,%r20,%r19 /* now have &irq_stat[smp_processor_id()] */ +#endif /* CONFIG_SMP */ + intr_check_resched: /* check for reschedule */ @@ -2019,9 +2034,10 @@ ENTRY(syscall_exit) STREG %r28,TASK_PT_GR28(%r1) #ifdef CONFIG_HPUX + /* cannot be easily included */ #define PER_HPUX 0x10 - ldw TASK_PERSONALITY(%r1),%r19 + LDREG TASK_PERSONALITY(%r1),%r19 /* We can't use "CMPIB<> PER_HPUX" since "im5" field is sign extended */ ldo -PER_HPUX(%r19), %r19 @@ -2039,6 +2055,24 @@ ENTRY(syscall_exit) */ loadgp +syscall_check_bh: + + /* Check for software interrupts */ + + .import irq_stat,data + + load32 irq_stat,%r19 + +#ifdef CONFIG_SMP + /* sched.h: int processor */ + /* %r26 is used as scratch register to index into irq_stat[] */ + ldw TI_CPU-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 /* cpu # */ + + /* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) bits */ + SHLREG %r26,L1_CACHE_SHIFT,%r20 + add %r19,%r20,%r19 /* now have &irq_stat[smp_processor_id()] */ +#endif /* CONFIG_SMP */ + syscall_check_resched: /* check for reschedule */ @@ -2080,7 +2114,7 @@ syscall_restore: /* Are we being ptraced? */ LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 - ldw TASK_PTRACE(%r1), %r19 + LDREG TASK_PTRACE(%r1), %r19 bb,< %r19,31,syscall_restore_rfi nop @@ -2210,7 +2244,7 @@ syscall_do_resched: #else nop #endif - b syscall_check_resched /* if resched, we start over again */ + b syscall_check_bh /* if resched, we start over again */ nop ENDPROC(syscall_exit) diff --git a/trunk/arch/parisc/kernel/firmware.c b/trunk/arch/parisc/kernel/firmware.c index fd6552c4c08c..39dc835bf89e 100644 --- a/trunk/arch/parisc/kernel/firmware.c +++ b/trunk/arch/parisc/kernel/firmware.c @@ -634,7 +634,7 @@ EXPORT_SYMBOL(pdc_lan_station_id); * pdc_stable_read - Read data from Stable Storage. * @staddr: Stable Storage address to access. * @memaddr: The memory address where Stable Storage data shall be copied. - * @count: number of bytes to transfer. count is multiple of 4. + * @count: number of bytes to transfert. count is multiple of 4. * * This PDC call reads from the Stable Storage address supplied in staddr * and copies count bytes to the memory address memaddr. @@ -660,7 +660,7 @@ EXPORT_SYMBOL(pdc_stable_read); * pdc_stable_write - Write data to Stable Storage. * @staddr: Stable Storage address to access. * @memaddr: The memory address where Stable Storage data shall be read from. - * @count: number of bytes to transfer. count is multiple of 4. + * @count: number of bytes to transfert. count is multiple of 4. * * This PDC call reads count bytes from the supplied memaddr address, * and copies count bytes to the Stable Storage address staddr. diff --git a/trunk/arch/parisc/kernel/hardware.c b/trunk/arch/parisc/kernel/hardware.c index 04848b2b381c..18ba4cb9159b 100644 --- a/trunk/arch/parisc/kernel/hardware.c +++ b/trunk/arch/parisc/kernel/hardware.c @@ -38,7 +38,7 @@ * so don't reference this table after starting the init process */ -static struct hp_hardware hp_hardware_list[] __devinitdata = { +static struct hp_hardware hp_hardware_list[] __initdata = { {HPHW_NPROC,0x01,0x4,0x0,"Indigo (840, 930)"}, {HPHW_NPROC,0x8,0x4,0x01,"Firefox(825,925)"}, {HPHW_NPROC,0xA,0x4,0x01,"Top Gun (835,834,935,635)"}, @@ -1219,7 +1219,7 @@ static struct hp_cpu_type_mask { unsigned short model; unsigned short mask; enum cpu_type cpu; -} hp_cpu_type_mask_list[] __devinitdata = { +} hp_cpu_type_mask_list[] __initdata = { { 0x0000, 0x0ff0, pcx }, /* 0x0000 - 0x000f */ { 0x0048, 0x0ff0, pcxl }, /* 0x0040 - 0x004f */ @@ -1296,11 +1296,10 @@ static struct hp_cpu_type_mask { { 0x05f0, 0x0ff0, pcxw2 }, /* 0x05f0 - 0x05ff */ { 0x0600, 0x0fe0, pcxl }, /* 0x0600 - 0x061f */ { 0x0880, 0x0ff0, mako }, /* 0x0880 - 0x088f */ - { 0x0890, 0x0ff0, mako2 }, /* 0x0890 - 0x089f */ { 0x0000, 0x0000, pcx } /* terminate table */ }; -const char * const cpu_name_version[][2] = { +char *cpu_name_version[][2] = { [pcx] = { "PA7000 (PCX)", "1.0" }, [pcxs] = { "PA7000 (PCX-S)", "1.1a" }, [pcxt] = { "PA7100 (PCX-T)", "1.1b" }, @@ -1312,11 +1311,10 @@ const char * const cpu_name_version[][2] = { [pcxw] = { "PA8500 (PCX-W)", "2.0" }, [pcxw_] = { "PA8600 (PCX-W+)", "2.0" }, [pcxw2] = { "PA8700 (PCX-W2)", "2.0" }, - [mako] = { "PA8800 (Mako)", "2.0" }, - [mako2] = { "PA8900 (Shortfin)", "2.0" } + [mako] = { "PA8800 (Mako)", "2.0" } }; -const char * __devinit +const char * __init parisc_hardware_description(struct parisc_device_id *id) { struct hp_hardware *listptr; @@ -1355,7 +1353,7 @@ parisc_hardware_description(struct parisc_device_id *id) /* Interpret hversion (ret[0]) from PDC_MODEL(4)/PDC_MODEL_INFO(0) */ -enum cpu_type __cpuinit +enum cpu_type __init parisc_get_cpu_type(unsigned long hversion) { struct hp_cpu_type_mask *ptr; diff --git a/trunk/arch/parisc/kernel/hpmc.S b/trunk/arch/parisc/kernel/hpmc.S index 43b41df0b541..d8baa158d8a0 100644 --- a/trunk/arch/parisc/kernel/hpmc.S +++ b/trunk/arch/parisc/kernel/hpmc.S @@ -295,5 +295,8 @@ os_hpmc_6: b . nop ENDPROC(os_hpmc) -ENTRY(os_hpmc_end) /* this label used to compute os_hpmc checksum */ + + /* this label used to compute os_hpmc checksum */ +ENTRY(os_hpmc_end) + nop diff --git a/trunk/arch/parisc/kernel/irq.c b/trunk/arch/parisc/kernel/irq.c index 76ce5e3b0050..c5c9125dacec 100644 --- a/trunk/arch/parisc/kernel/irq.c +++ b/trunk/arch/parisc/kernel/irq.c @@ -46,10 +46,14 @@ extern irqreturn_t ipi_interrupt(int, void *); static volatile unsigned long cpu_eiem = 0; /* -** local ACK bitmap ... habitually set to 1, but reset to zero +** ack bitmap ... habitually set to 1, but reset to zero ** between ->ack() and ->end() of the interrupt to prevent ** re-interruption of a processing interrupt. */ +static volatile unsigned long global_ack_eiem = ~0UL; +/* +** Local bitmap, same as above but for per-cpu interrupts +*/ static DEFINE_PER_CPU(unsigned long, local_ack_eiem) = ~0UL; static void cpu_disable_irq(unsigned int irq) @@ -90,11 +94,13 @@ void cpu_ack_irq(unsigned int irq) int cpu = smp_processor_id(); /* Clear in EIEM so we can no longer process */ - per_cpu(local_ack_eiem, cpu) &= ~mask; + if (CHECK_IRQ_PER_CPU(irq_desc[irq].status)) + per_cpu(local_ack_eiem, cpu) &= ~mask; + else + global_ack_eiem &= ~mask; /* disable the interrupt */ - set_eiem(cpu_eiem & per_cpu(local_ack_eiem, cpu)); - + set_eiem(cpu_eiem & global_ack_eiem & per_cpu(local_ack_eiem, cpu)); /* and now ack it */ mtctl(mask, 23); } @@ -105,10 +111,13 @@ void cpu_end_irq(unsigned int irq) int cpu = smp_processor_id(); /* set it in the eiems---it's no longer in process */ - per_cpu(local_ack_eiem, cpu) |= mask; + if (CHECK_IRQ_PER_CPU(irq_desc[irq].status)) + per_cpu(local_ack_eiem, cpu) |= mask; + else + global_ack_eiem |= mask; /* enable the interrupt */ - set_eiem(cpu_eiem & per_cpu(local_ack_eiem, cpu)); + set_eiem(cpu_eiem & global_ack_eiem & per_cpu(local_ack_eiem, cpu)); } #ifdef CONFIG_SMP @@ -345,7 +354,8 @@ void do_cpu_irq_mask(struct pt_regs *regs) local_irq_disable(); irq_enter(); - eirr_val = mfctl(23) & cpu_eiem & per_cpu(local_ack_eiem, cpu); + eirr_val = mfctl(23) & cpu_eiem & global_ack_eiem & + per_cpu(local_ack_eiem, cpu); if (!eirr_val) goto set_out; irq = eirr_to_irq(eirr_val); @@ -371,7 +381,7 @@ void do_cpu_irq_mask(struct pt_regs *regs) return; set_out: - set_eiem(cpu_eiem & per_cpu(local_ack_eiem, cpu)); + set_eiem(cpu_eiem & global_ack_eiem & per_cpu(local_ack_eiem, cpu)); goto out; } diff --git a/trunk/arch/parisc/kernel/pci-dma.c b/trunk/arch/parisc/kernel/pci-dma.c index 23c1388df1f5..0c3aecb85a5c 100644 --- a/trunk/arch/parisc/kernel/pci-dma.c +++ b/trunk/arch/parisc/kernel/pci-dma.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -35,6 +34,7 @@ #include /* for purge_tlb_*() macros */ static struct proc_dir_entry * proc_gsc_root __read_mostly = NULL; +static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length); static unsigned long pcxl_used_bytes __read_mostly = 0; static unsigned long pcxl_used_pages __read_mostly = 0; @@ -330,54 +330,6 @@ pcxl_free_range(unsigned long vaddr, size_t size) dump_resmap(); } -static int proc_pcxl_dma_show(struct seq_file *m, void *v) -{ -#if 0 - u_long i = 0; - unsigned long *res_ptr = (u_long *)pcxl_res_map; -#endif - unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */ - - seq_printf(m, "\nDMA Mapping Area size : %d bytes (%ld pages)\n", - PCXL_DMA_MAP_SIZE, total_pages); - - seq_printf(m, "Resource bitmap : %d bytes\n", pcxl_res_size); - - seq_puts(m, " total: free: used: % used:\n"); - seq_printf(m, "blocks %8d %8ld %8ld %8ld%%\n", pcxl_res_size, - pcxl_res_size - pcxl_used_bytes, pcxl_used_bytes, - (pcxl_used_bytes * 100) / pcxl_res_size); - - seq_printf(m, "pages %8ld %8ld %8ld %8ld%%\n", total_pages, - total_pages - pcxl_used_pages, pcxl_used_pages, - (pcxl_used_pages * 100 / total_pages)); - -#if 0 - seq_puts(m, "\nResource bitmap:"); - - for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) { - if ((i & 7) == 0) - seq_puts(m,"\n "); - seq_printf(m, "%s %08lx", buf, *res_ptr); - } -#endif - seq_putc(m, '\n'); - return 0; -} - -static int proc_pcxl_dma_open(struct inode *inode, struct file *file) -{ - return single_open(file, proc_pcxl_dma_show, NULL); -} - -static const struct file_operations proc_pcxl_dma_ops = { - .owner = THIS_MODULE, - .open = proc_pcxl_dma_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - static int __init pcxl_dma_init(void) { @@ -396,10 +348,9 @@ pcxl_dma_init(void) "pcxl_dma_init: Unable to create gsc /proc dir entry\n"); else { struct proc_dir_entry* ent; - ent = create_proc_entry("pcxl_dma", 0, proc_gsc_root); - if (ent) - ent->proc_fops = &proc_pcxl_dma_ops; - else + ent = create_proc_info_entry("pcxl_dma", 0, + proc_gsc_root, pcxl_proc_info); + if (!ent) printk(KERN_WARNING "pci-dma.c: Unable to create pcxl_dma /proc entry.\n"); } @@ -600,3 +551,40 @@ struct hppa_dma_ops pcx_dma_ops = { .dma_sync_sg_for_cpu = pa11_dma_sync_sg_for_cpu, .dma_sync_sg_for_device = pa11_dma_sync_sg_for_device, }; + + +static int pcxl_proc_info(char *buf, char **start, off_t offset, int len) +{ +#if 0 + u_long i = 0; + unsigned long *res_ptr = (u_long *)pcxl_res_map; +#endif + unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */ + + sprintf(buf, "\nDMA Mapping Area size : %d bytes (%ld pages)\n", + PCXL_DMA_MAP_SIZE, total_pages); + + sprintf(buf, "%sResource bitmap : %d bytes\n", buf, pcxl_res_size); + + strcat(buf, " total: free: used: % used:\n"); + sprintf(buf, "%sblocks %8d %8ld %8ld %8ld%%\n", buf, pcxl_res_size, + pcxl_res_size - pcxl_used_bytes, pcxl_used_bytes, + (pcxl_used_bytes * 100) / pcxl_res_size); + + sprintf(buf, "%spages %8ld %8ld %8ld %8ld%%\n", buf, total_pages, + total_pages - pcxl_used_pages, pcxl_used_pages, + (pcxl_used_pages * 100 / total_pages)); + +#if 0 + strcat(buf, "\nResource bitmap:"); + + for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) { + if ((i & 7) == 0) + strcat(buf,"\n "); + sprintf(buf, "%s %08lx", buf, *res_ptr); + } +#endif + strcat(buf, "\n"); + return strlen(buf); +} + diff --git a/trunk/arch/parisc/kernel/perf.c b/trunk/arch/parisc/kernel/perf.c index 89d6d5ad44b5..a46bc62b643e 100644 --- a/trunk/arch/parisc/kernel/perf.c +++ b/trunk/arch/parisc/kernel/perf.c @@ -171,7 +171,7 @@ static const uint64_t perf_bitmasks[] = { /* * Write control bitmasks for Pa-8700 processor given - * some things have changed slightly. + * somethings have changed slightly. */ static const uint64_t perf_bitmasks_piranha[] = { 0x0000000000000000ul, /* first dbl word must be zero */ @@ -511,12 +511,10 @@ static int __init perf_init(void) } else if (boot_cpu_data.cpu_type == pcxw || boot_cpu_data.cpu_type == pcxw_ || boot_cpu_data.cpu_type == pcxw2 || - boot_cpu_data.cpu_type == mako || - boot_cpu_data.cpu_type == mako2) { + boot_cpu_data.cpu_type == mako) { perf_processor_interface = CUDA_INTF; if (boot_cpu_data.cpu_type == pcxw2 || - boot_cpu_data.cpu_type == mako || - boot_cpu_data.cpu_type == mako2) + boot_cpu_data.cpu_type == mako) bitmask_array = perf_bitmasks_piranha; } else { perf_processor_interface = UNKNOWN_INTF; @@ -576,27 +574,27 @@ static int perf_stop_counters(uint32_t *raddr) if (!perf_rdr_read_ubuf(16, userbuf)) return -13; - /* Counter0 is bits 1398 to 1429 */ + /* Counter0 is bits 1398 thru 1429 */ tmp64 = (userbuf[21] << 22) & 0x00000000ffc00000; tmp64 |= (userbuf[22] >> 42) & 0x00000000003fffff; /* OR sticky0 (bit 1430) to counter0 bit 32 */ tmp64 |= (userbuf[22] >> 10) & 0x0000000080000000; raddr[0] = (uint32_t)tmp64; - /* Counter1 is bits 1431 to 1462 */ + /* Counter1 is bits 1431 thru 1462 */ tmp64 = (userbuf[22] >> 9) & 0x00000000ffffffff; /* OR sticky1 (bit 1463) to counter1 bit 32 */ tmp64 |= (userbuf[22] << 23) & 0x0000000080000000; raddr[1] = (uint32_t)tmp64; - /* Counter2 is bits 1464 to 1495 */ + /* Counter2 is bits 1464 thru 1495 */ tmp64 = (userbuf[22] << 24) & 0x00000000ff000000; tmp64 |= (userbuf[23] >> 40) & 0x0000000000ffffff; /* OR sticky2 (bit 1496) to counter2 bit 32 */ tmp64 |= (userbuf[23] >> 8) & 0x0000000080000000; raddr[2] = (uint32_t)tmp64; - /* Counter3 is bits 1497 to 1528 */ + /* Counter3 is bits 1497 thru 1528 */ tmp64 = (userbuf[23] >> 7) & 0x00000000ffffffff; /* OR sticky3 (bit 1529) to counter3 bit 32 */ tmp64 |= (userbuf[23] << 25) & 0x0000000080000000; @@ -618,7 +616,7 @@ static int perf_stop_counters(uint32_t *raddr) userbuf[23] = 0; /* - * Write back the zeroed bytes + the image given + * Write back the zero'ed bytes + the image given * the read was destructive. */ perf_rdr_write(16, userbuf); diff --git a/trunk/arch/parisc/kernel/process.c b/trunk/arch/parisc/kernel/process.c index 355664812b83..0dd3847f494c 100644 --- a/trunk/arch/parisc/kernel/process.c +++ b/trunk/arch/parisc/kernel/process.c @@ -381,10 +381,6 @@ get_wchan(struct task_struct *p) struct unwind_frame_info info; unsigned long ip; int count = 0; - - if (!p || p == current || p->state == TASK_RUNNING) - return 0; - /* * These bracket the sleeping functions.. */ diff --git a/trunk/arch/parisc/kernel/processor.c b/trunk/arch/parisc/kernel/processor.c index 549f5484342c..566226d78bc9 100644 --- a/trunk/arch/parisc/kernel/processor.c +++ b/trunk/arch/parisc/kernel/processor.c @@ -63,7 +63,7 @@ extern int update_cr16_clocksource(void); /* from time.c */ ** will call register_parisc_driver(&cpu_driver) before calling do_inventory(). ** ** The goal of consolidating CPU initialization into one place is -** to make sure all CPUs get initialized the same way. +** to make sure all CPU's get initialized the same way. ** The code path not shared is how PDC hands control of the CPU to the OS. ** The initialization of OS data structures is the same (done below). */ @@ -76,7 +76,7 @@ extern int update_cr16_clocksource(void); /* from time.c */ * (return 1). If so, initialize the chip and tell other partners in crime * they have work to do. */ -static int __cpuinit processor_probe(struct parisc_device *dev) +static int __init processor_probe(struct parisc_device *dev) { unsigned long txn_addr; unsigned long cpuid; @@ -166,7 +166,7 @@ static int __cpuinit processor_probe(struct parisc_device *dev) #endif /* - ** CONFIG_SMP: init_smp_config() will attempt to get CPUs into + ** CONFIG_SMP: init_smp_config() will attempt to get CPU's into ** OS control. RENDEZVOUS is the default state - see mem_set above. ** p->state = STATE_RENDEZVOUS; */ @@ -334,7 +334,7 @@ int __init init_per_cpu(int cpunum) } /* - * Display CPU info for all CPUs. + * Display cpu info for all cpu's. */ int show_cpuinfo (struct seq_file *m, void *v) @@ -381,19 +381,19 @@ show_cpuinfo (struct seq_file *m, void *v) return 0; } -static const struct parisc_device_id processor_tbl[] = { +static struct parisc_device_id processor_tbl[] __read_mostly = { { HPHW_NPROC, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, SVERSION_ANY_ID }, { 0, } }; -static struct parisc_driver cpu_driver = { +static struct parisc_driver cpu_driver __read_mostly = { .name = "CPU", .id_table = processor_tbl, .probe = processor_probe }; /** - * processor_init - Processor initialization procedure. + * processor_init - Processor initalization procedure. * * Register this driver. */ diff --git a/trunk/arch/parisc/kernel/setup.c b/trunk/arch/parisc/kernel/setup.c index c44b8c51f5d1..9818919571fd 100644 --- a/trunk/arch/parisc/kernel/setup.c +++ b/trunk/arch/parisc/kernel/setup.c @@ -45,7 +45,7 @@ #include #include -static char __initdata command_line[COMMAND_LINE_SIZE]; +char __initdata command_line[COMMAND_LINE_SIZE]; /* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */ struct proc_dir_entry * proc_runway_root __read_mostly = NULL; @@ -162,7 +162,7 @@ void __init setup_arch(char **cmdline_p) } /* - * Display CPU info for all CPUs. + * Display cpu info for all cpu's. * for parisc this is in processor.c */ extern int show_cpuinfo (struct seq_file *m, void *v); @@ -225,7 +225,6 @@ static void __init parisc_proc_mkdir(void) } break; case mako: - case mako2: if (NULL == proc_mckinley_root) { proc_mckinley_root = proc_mkdir("bus/mckinley", NULL); diff --git a/trunk/arch/parisc/kernel/signal32.h b/trunk/arch/parisc/kernel/signal32.h index c7800846422c..e39b38a67a87 100644 --- a/trunk/arch/parisc/kernel/signal32.h +++ b/trunk/arch/parisc/kernel/signal32.h @@ -113,7 +113,7 @@ int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); /* In a deft move of uber-hackery, we decide to carry the top half of all * 64-bit registers in a non-portable, non-ABI, hidden structure. * Userspace can read the hidden structure if it *wants* but is never - * guaranteed to be in the same place. In fact the uc_sigmask from the + * guaranteed to be in the same place. Infact the uc_sigmask from the * ucontext_t structure may push the hidden register file downards */ struct compat_regfile { diff --git a/trunk/arch/parisc/kernel/smp.c b/trunk/arch/parisc/kernel/smp.c index 04c7e1d36cea..6ba9257fdb7f 100644 --- a/trunk/arch/parisc/kernel/smp.c +++ b/trunk/arch/parisc/kernel/smp.c @@ -8,7 +8,7 @@ ** Lots of stuff stolen from arch/alpha/kernel/smp.c ** ...and then parisc stole from arch/ia64/kernel/smp.c. Thanks David! :^) ** -** Thanks to John Curry and Ullas Ponnadi. I learned a lot from their work. +** Thanks to John Curry and Ullas Ponnadi. I learned alot from their work. ** -grant (1/12/2001) ** ** This program is free software; you can redistribute it and/or modify @@ -419,7 +419,7 @@ smp_cpu_init(int cpunum) BUG(); enter_lazy_tlb(&init_mm, current); - init_IRQ(); /* make sure no IRQs are enabled or pending */ + init_IRQ(); /* make sure no IRQ's are enabled or pending */ start_cpu_itimer(); } @@ -461,7 +461,7 @@ void __init smp_callin(void) /* * Bring one cpu online. */ -int __cpuinit smp_boot_one_cpu(int cpuid) +int __init smp_boot_one_cpu(int cpuid) { struct task_struct *idle; long timeout; @@ -552,7 +552,7 @@ void __devinit smp_prepare_boot_cpu(void) /* ** inventory.c:do_inventory() hasn't yet been run and thus we -** don't 'discover' the additional CPUs until later. +** don't 'discover' the additional CPU's until later. */ void __init smp_prepare_cpus(unsigned int max_cpus) { diff --git a/trunk/arch/parisc/kernel/sys_parisc32.c b/trunk/arch/parisc/kernel/sys_parisc32.c index bb23ff71c28e..ce3245f87fdd 100644 --- a/trunk/arch/parisc/kernel/sys_parisc32.c +++ b/trunk/arch/parisc/kernel/sys_parisc32.c @@ -311,13 +311,14 @@ struct readdir32_callback { int count; }; +#define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) static int filldir32 (void *__buf, const char *name, int namlen, loff_t offset, u64 ino, unsigned int d_type) { struct linux32_dirent __user * dirent; struct getdents32_callback * buf = (struct getdents32_callback *) __buf; - int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4); + int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1, 4); u32 d_ino; buf->error = -EINVAL; /* only used if we fail.. */ @@ -349,10 +350,6 @@ sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count) struct getdents32_callback buf; int error; - error = -EFAULT; - if (!access_ok(VERIFY_WRITE, dirent, count)) - goto out; - error = -EBADF; file = fget(fd); if (!file) @@ -369,10 +366,8 @@ sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count) error = buf.error; lastdirent = buf.previous; if (lastdirent) { - if (put_user(file->f_pos, &lastdirent->d_off)) - error = -EFAULT; - else - error = count - buf.count; + put_user(file->f_pos, &lastdirent->d_off); + error = count - buf.count; } out_putf: diff --git a/trunk/arch/parisc/kernel/syscall.S b/trunk/arch/parisc/kernel/syscall.S index 56f6231cb863..10859f53e94f 100644 --- a/trunk/arch/parisc/kernel/syscall.S +++ b/trunk/arch/parisc/kernel/syscall.S @@ -181,7 +181,7 @@ linux_gateway_entry: /* Are we being ptraced? */ mfctl %cr30, %r1 LDREG TI_TASK(%r1),%r1 - ldw TASK_PTRACE(%r1), %r1 + LDREG TASK_PTRACE(%r1), %r1 bb,<,n %r1,31,.Ltracesys /* Note! We cannot use the syscall table that is mapped @@ -198,7 +198,7 @@ linux_gateway_entry: ldil L%sys_call_table, %r1 ldo R%sys_call_table(%r1), %r19 #endif - comiclr,>> __NR_Linux_syscalls, %r20, %r0 + comiclr,>>= __NR_Linux_syscalls, %r20, %r0 b,n .Lsyscall_nosys LDREGX %r20(%r19), %r19 @@ -501,7 +501,7 @@ lws_compare_and_swap: shlw %r20, 4, %r20 add %r20, %r28, %r20 -# if ENABLE_LWS_DEBUG +# ifdef ENABLE_LWS_DEBUG /* DEBUG, check for deadlock! If the thread register values are the same @@ -550,7 +550,7 @@ cas_wouldblock: perspective */ cas_action: -#if defined CONFIG_SMP && ENABLE_LWS_DEBUG +#if defined CONFIG_SMP && defined ENABLE_LWS_DEBUG /* DEBUG */ mfctl %cr27, %r1 stw %r1, 4(%sr2,%r20) @@ -562,7 +562,7 @@ cas_action: #ifdef CONFIG_SMP /* Free lock */ stw %r20, 0(%sr2,%r20) -# if ENABLE_LWS_DEBUG +# ifdef ENABLE_LWS_DEBUG /* Clear thread register indicator */ stw %r0, 4(%sr2,%r20) # endif @@ -576,7 +576,7 @@ cas_action: #ifdef CONFIG_SMP /* Free lock */ stw %r20, 0(%sr2,%r20) -# if ENABLE_LWS_DEBUG +# ifdef ENABLE_LWS_DEBUG stw %r0, 4(%sr2,%r20) # endif #endif diff --git a/trunk/arch/parisc/kernel/syscall_table.S b/trunk/arch/parisc/kernel/syscall_table.S index 627f3c28ad8c..8bf87e5d9c37 100644 --- a/trunk/arch/parisc/kernel/syscall_table.S +++ b/trunk/arch/parisc/kernel/syscall_table.S @@ -30,6 +30,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#undef ENTRY_SAME +#undef ENTRY_DIFF +#undef ENTRY_UHOH +#undef ENTRY_COMP +#undef ENTRY_OURS #if defined(CONFIG_64BIT) && !defined(SYSCALL_TABLE_64BIT) /* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific @@ -400,16 +405,5 @@ ENTRY_SAME(epoll_pwait) ENTRY_COMP(statfs64) ENTRY_COMP(fstatfs64) - ENTRY_COMP(kexec_load) /* 300 */ - ENTRY_COMP(utimensat) - ENTRY_COMP(signalfd) - ENTRY_COMP(timerfd) - ENTRY_SAME(eventfd) - /* Nothing yet */ -#undef ENTRY_SAME -#undef ENTRY_DIFF -#undef ENTRY_UHOH -#undef ENTRY_COMP -#undef ENTRY_OURS diff --git a/trunk/arch/parisc/kernel/time.c b/trunk/arch/parisc/kernel/time.c index 8b3062a5c812..07a991aa9b0c 100644 --- a/trunk/arch/parisc/kernel/time.c +++ b/trunk/arch/parisc/kernel/time.c @@ -191,7 +191,7 @@ int update_cr16_clocksource(void) { int change = 0; - /* since the cr16 cycle counters are not synchronized across CPUs, + /* since the cr16 cycle counters are not syncronized across CPUs, we'll check if we should switch to a safe clocksource: */ if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) { clocksource_change_rating(&clocksource_cr16, 0); diff --git a/trunk/arch/parisc/kernel/traps.c b/trunk/arch/parisc/kernel/traps.c index c3ec9f1ec0f3..745ff741490a 100644 --- a/trunk/arch/parisc/kernel/traps.c +++ b/trunk/arch/parisc/kernel/traps.c @@ -615,7 +615,7 @@ void handle_interruption(int code, struct pt_regs *regs) case 13: /* Conditional Trap - The condition succeeds in an instruction which traps + The condition succees in an instruction which traps on condition */ if(user_mode(regs)){ si.si_signo = SIGFPE; @@ -802,14 +802,13 @@ void handle_interruption(int code, struct pt_regs *regs) int __init check_ivt(void *iva) { - extern const u32 os_hpmc[]; - extern const u32 os_hpmc_end[]; - int i; u32 check = 0; u32 *ivap; u32 *hpmcp; u32 length; + extern void os_hpmc(void); + extern void os_hpmc_end(void); if (strcmp((char *)iva, "cows can fly")) return -1; @@ -821,7 +820,7 @@ int __init check_ivt(void *iva) /* Compute Checksum for HPMC handler */ - length = os_hpmc_end - os_hpmc; + length = (u32)((unsigned long)os_hpmc_end - (unsigned long)os_hpmc); ivap[7] = length; hpmcp = (u32 *)os_hpmc; diff --git a/trunk/arch/parisc/kernel/unwind.c b/trunk/arch/parisc/kernel/unwind.c index e70f57e27643..89c03707eccc 100644 --- a/trunk/arch/parisc/kernel/unwind.c +++ b/trunk/arch/parisc/kernel/unwind.c @@ -216,10 +216,8 @@ static void unwind_frame_regs(struct unwind_frame_info *info) /* Handle some frequent special cases.... */ { char symname[KSYM_NAME_LEN+1]; - char *modname; - kallsyms_lookup(info->ip, NULL, NULL, &modname, - symname); + kallsyms_lookup(info->ip, NULL, NULL, NULL, symname); dbg("info->ip = 0x%lx, name = %s\n", info->ip, symname); diff --git a/trunk/arch/parisc/math-emu/dbl_float.h b/trunk/arch/parisc/math-emu/dbl_float.h index 0c2fa9a951b3..1570e2e0a327 100644 --- a/trunk/arch/parisc/math-emu/dbl_float.h +++ b/trunk/arch/parisc/math-emu/dbl_float.h @@ -22,7 +22,7 @@ PA header file -- do not include this header file for non-PA builds. #endif -/* 32-bit word grabbing functions */ +/* 32-bit word grabing functions */ #define Dbl_firstword(value) Dallp1(value) #define Dbl_secondword(value) Dallp2(value) #define Dbl_thirdword(value) dummy_location @@ -37,7 +37,7 @@ #define Dbl_allp1(object) Dallp1(object) #define Dbl_allp2(object) Dallp2(object) -/* dbl_and_signs ANDs the sign bits of each argument and puts the result +/* dbl_and_signs ands the sign bits of each argument and puts the result * into the first argument. dbl_or_signs ors those same sign bits */ #define Dbl_and_signs( src1dst, src2) \ Dallp1(src1dst) = (Dallp1(src2)|~((unsigned int)1<<31)) & Dallp1(src1dst) diff --git a/trunk/arch/parisc/math-emu/dfsqrt.c b/trunk/arch/parisc/math-emu/dfsqrt.c index 9542c6d281a5..b6ed1066f1e4 100644 --- a/trunk/arch/parisc/math-emu/dfsqrt.c +++ b/trunk/arch/parisc/math-emu/dfsqrt.c @@ -76,7 +76,7 @@ dbl_fsqrt( } /* * Return quiet NaN or positive infinity. - * Fall through to negative test if negative infinity. + * Fall thru to negative test if negative infinity. */ if (Dbl_iszero_sign(srcp1) || Dbl_isnotzero_mantissa(srcp1,srcp2)) { diff --git a/trunk/arch/parisc/math-emu/sfsqrt.c b/trunk/arch/parisc/math-emu/sfsqrt.c index 4657a12c9107..cd3f6db1f6fb 100644 --- a/trunk/arch/parisc/math-emu/sfsqrt.c +++ b/trunk/arch/parisc/math-emu/sfsqrt.c @@ -76,7 +76,7 @@ sgl_fsqrt( } /* * Return quiet NaN or positive infinity. - * Fall through to negative test if negative infinity. + * Fall thru to negative test if negative infinity. */ if (Sgl_iszero_sign(src) || Sgl_isnotzero_mantissa(src)) { *dstptr = src; diff --git a/trunk/arch/parisc/math-emu/sgl_float.h b/trunk/arch/parisc/math-emu/sgl_float.h index 4ee4cc95e4bf..82519a5c2ba5 100644 --- a/trunk/arch/parisc/math-emu/sgl_float.h +++ b/trunk/arch/parisc/math-emu/sgl_float.h @@ -23,7 +23,7 @@ PA header file -- do not include this header file for non-PA builds. #endif -/* 32-bit word grabbing functions */ +/* 32-bit word grabing functions */ #define Sgl_firstword(value) Sall(value) #define Sgl_secondword(value) dummy_location #define Sgl_thirdword(value) dummy_location @@ -36,7 +36,7 @@ #define Sgl_exponentmantissa(object) Sexponentmantissa(object) #define Sgl_all(object) Sall(object) -/* sgl_and_signs ANDs the sign bits of each argument and puts the result +/* sgl_and_signs ands the sign bits of each argument and puts the result * into the first argument. sgl_or_signs ors those same sign bits */ #define Sgl_and_signs( src1dst, src2) \ Sall(src1dst) = (Sall(src2)|~((unsigned int)1<<31)) & Sall(src1dst) diff --git a/trunk/arch/parisc/mm/init.c b/trunk/arch/parisc/mm/init.c index e724b362c49a..75ea9f2a8a41 100644 --- a/trunk/arch/parisc/mm/init.c +++ b/trunk/arch/parisc/mm/init.c @@ -890,7 +890,7 @@ void __init paging_init(void) #ifdef CONFIG_PA20 /* - * Currently, all PA20 chips have 18 bit protection IDs, which is the + * Currently, all PA20 chips have 18 bit protection id's, which is the * limiting factor (space ids are 32 bits). */ @@ -899,10 +899,10 @@ void __init paging_init(void) #else /* - * Currently we have a one-to-one relationship between space IDs and - * protection IDs. Older parisc chips (PCXS, PCXT, PCXL, PCXL2) only - * support 15 bit protection IDs, so that is the limiting factor. - * PCXT' has 18 bit protection IDs, but only 16 bit spaceids, so it's + * Currently we have a one-to-one relationship between space id's and + * protection id's. Older parisc chips (PCXS, PCXT, PCXL, PCXL2) only + * support 15 bit protection id's, so that is the limiting factor. + * PCXT' has 18 bit protection id's, but only 16 bit spaceids, so it's * probably not worth the effort for a special case here. */ diff --git a/trunk/arch/powerpc/kernel/udbg.c b/trunk/arch/powerpc/kernel/udbg.c index cbca1df8bc60..87703df87509 100644 --- a/trunk/arch/powerpc/kernel/udbg.c +++ b/trunk/arch/powerpc/kernel/udbg.c @@ -151,18 +151,12 @@ static struct console udbg_console = { static int early_console_initialized; -/* - * Called by setup_system after ppc_md->probe and ppc_md->early_init. - * Call it again after setting udbg_putc in ppc_md->setup_arch. - */ +/* called by setup_system */ void register_early_udbg_console(void) { if (early_console_initialized) return; - if (!udbg_putc) - return; - if (strstr(boot_command_line, "udbg-immortal")) { printk(KERN_INFO "early console immortal !\n"); udbg_console.flags &= ~CON_BOOT; diff --git a/trunk/arch/powerpc/platforms/powermac/setup.c b/trunk/arch/powerpc/platforms/powermac/setup.c index 956571526a57..07b1c4ec428d 100644 --- a/trunk/arch/powerpc/platforms/powermac/setup.c +++ b/trunk/arch/powerpc/platforms/powermac/setup.c @@ -363,19 +363,8 @@ static void __init pmac_setup_arch(void) smp_ops = &core99_smp_ops; } #ifdef CONFIG_PPC32 - else { - /* - * We have to set bits in cpu_possible_map here since the - * secondary CPU(s) aren't in the device tree, and - * setup_per_cpu_areas only allocates per-cpu data for - * CPUs in the cpu_possible_map. - */ - int cpu; - - for (cpu = 1; cpu < 4 && cpu < NR_CPUS; ++cpu) - cpu_set(cpu, cpu_possible_map); + else smp_ops = &psurge_smp_ops; - } #endif #endif /* CONFIG_SMP */ diff --git a/trunk/arch/powerpc/platforms/powermac/smp.c b/trunk/arch/powerpc/platforms/powermac/smp.c index cb2d894541c6..686ed82bde79 100644 --- a/trunk/arch/powerpc/platforms/powermac/smp.c +++ b/trunk/arch/powerpc/platforms/powermac/smp.c @@ -317,6 +317,7 @@ static int __init smp_psurge_probe(void) ncpus = NR_CPUS; for (i = 1; i < ncpus ; ++i) { cpu_set(i, cpu_present_map); + cpu_set(i, cpu_possible_map); set_hard_smp_processor_id(i, i); } diff --git a/trunk/arch/sparc64/kernel/entry.S b/trunk/arch/sparc64/kernel/entry.S index 8059531bf0ac..7d1a11822a1e 100644 --- a/trunk/arch/sparc64/kernel/entry.S +++ b/trunk/arch/sparc64/kernel/entry.S @@ -2357,9 +2357,8 @@ sun4v_ldc_unmap: nop .size sun4v_ldc_unmap, .-sun4v_ldc_unmap - /* %o0: channel - * %o1: cookie - * %o2: mte_cookie + /* %o0: cookie + * %o1: mte_cookie * * returns %o0: status */ diff --git a/trunk/arch/sparc64/kernel/irq.c b/trunk/arch/sparc64/kernel/irq.c index e60d283f60bc..a36f8dd0c021 100644 --- a/trunk/arch/sparc64/kernel/irq.c +++ b/trunk/arch/sparc64/kernel/irq.c @@ -1,6 +1,7 @@ -/* irq.c: UltraSparc IRQ handling/init/registry. +/* $Id: irq.c,v 1.114 2002/01/11 08:45:38 davem Exp $ + * irq.c: UltraSparc IRQ handling/init/registry. * - * Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net) + * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ @@ -42,7 +43,6 @@ #include #include #include -#include /* UPA nodes send interrupt packet to UltraSparc with first data reg * value low 5 (7 on Starfire) bits holding the IRQ identifier being @@ -380,76 +380,6 @@ static void sun4v_irq_end(unsigned int virt_irq) } } -static void sun4v_virq_enable(unsigned int virt_irq) -{ - struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq); - unsigned int ino = bucket - &ivector_table[0]; - - if (likely(bucket)) { - unsigned long cpuid, dev_handle, dev_ino; - int err; - - cpuid = irq_choose_cpu(virt_irq); - - dev_handle = ino & IMAP_IGN; - dev_ino = ino & IMAP_INO; - - err = sun4v_vintr_set_target(dev_handle, dev_ino, cpuid); - if (err != HV_EOK) - printk("sun4v_vintr_set_target(%lx,%lx,%lu): " - "err(%d)\n", - dev_handle, dev_ino, cpuid, err); - err = sun4v_vintr_set_state(dev_handle, dev_ino, - HV_INTR_ENABLED); - if (err != HV_EOK) - printk("sun4v_vintr_set_state(%lx,%lx," - "HV_INTR_ENABLED): err(%d)\n", - dev_handle, dev_ino, err); - } -} - -static void sun4v_virq_disable(unsigned int virt_irq) -{ - struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq); - unsigned int ino = bucket - &ivector_table[0]; - - if (likely(bucket)) { - unsigned long dev_handle, dev_ino; - int err; - - dev_handle = ino & IMAP_IGN; - dev_ino = ino & IMAP_INO; - - err = sun4v_vintr_set_state(dev_handle, dev_ino, - HV_INTR_DISABLED); - if (err != HV_EOK) - printk("sun4v_vintr_set_state(%lx,%lx," - "HV_INTR_DISABLED): err(%d)\n", - dev_handle, dev_ino, err); - } -} - -static void sun4v_virq_end(unsigned int virt_irq) -{ - struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq); - unsigned int ino = bucket - &ivector_table[0]; - - if (likely(bucket)) { - unsigned long dev_handle, dev_ino; - int err; - - dev_handle = ino & IMAP_IGN; - dev_ino = ino & IMAP_INO; - - err = sun4v_vintr_set_state(dev_handle, dev_ino, - HV_INTR_STATE_IDLE); - if (err != HV_EOK) - printk("sun4v_vintr_set_state(%lx,%lx," - "HV_INTR_STATE_IDLE): err(%d)\n", - dev_handle, dev_ino, err); - } -} - static void run_pre_handler(unsigned int virt_irq) { struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq); @@ -504,21 +434,6 @@ static struct irq_chip sun4v_msi = { }; #endif -static struct irq_chip sun4v_virq = { - .typename = "vsun4v", - .enable = sun4v_virq_enable, - .disable = sun4v_virq_disable, - .end = sun4v_virq_end, -}; - -static struct irq_chip sun4v_virq_ack = { - .typename = "vsun4v+ack", - .enable = sun4v_virq_enable, - .disable = sun4v_virq_disable, - .ack = run_pre_handler, - .end = sun4v_virq_end, -}; - void irq_install_pre_handler(int virt_irq, void (*func)(unsigned int, void *, void *), void *arg1, void *arg2) @@ -532,8 +447,7 @@ void irq_install_pre_handler(int virt_irq, chip = get_irq_chip(virt_irq); if (chip == &sun4u_irq_ack || - chip == &sun4v_irq_ack || - chip == &sun4v_virq_ack + chip == &sun4v_irq_ack #ifdef CONFIG_PCI_MSI || chip == &sun4v_msi #endif @@ -541,9 +455,7 @@ void irq_install_pre_handler(int virt_irq, return; chip = (chip == &sun4u_irq ? - &sun4u_irq_ack : - (chip == &sun4v_irq ? - &sun4v_irq_ack : &sun4v_virq_ack)); + &sun4u_irq_ack : &sun4v_irq_ack); set_irq_chip(virt_irq, chip); } @@ -580,18 +492,19 @@ unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap) return bucket->virt_irq; } -static unsigned int sun4v_build_common(unsigned long sysino, - struct irq_chip *chip) +unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino) { struct ino_bucket *bucket; struct irq_handler_data *data; + unsigned long sysino; BUG_ON(tlb_type != hypervisor); + sysino = sun4v_devino_to_sysino(devhandle, devino); bucket = &ivector_table[sysino]; if (!bucket->virt_irq) { bucket->virt_irq = virt_irq_alloc(__irq(bucket)); - set_irq_chip(bucket->virt_irq, chip); + set_irq_chip(bucket->virt_irq, &sun4v_irq); } data = get_irq_chip_data(bucket->virt_irq); @@ -616,32 +529,6 @@ static unsigned int sun4v_build_common(unsigned long sysino, return bucket->virt_irq; } -unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino) -{ - unsigned long sysino = sun4v_devino_to_sysino(devhandle, devino); - - return sun4v_build_common(sysino, &sun4v_irq); -} - -unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino) -{ - unsigned long sysino, hv_err; - - BUG_ON(devhandle & ~IMAP_IGN); - BUG_ON(devino & ~IMAP_INO); - - sysino = devhandle | devino; - - hv_err = sun4v_vintr_set_cookie(devhandle, devino, sysino); - if (hv_err) { - prom_printf("IRQ: Fatal, cannot set cookie for [%x:%x] " - "err=%lu\n", devhandle, devino, hv_err); - prom_halt(); - } - - return sun4v_build_common(sysino, &sun4v_virq); -} - #ifdef CONFIG_PCI_MSI unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, unsigned int msi_start, unsigned int msi_end) diff --git a/trunk/arch/sparc64/kernel/pci_common.c b/trunk/arch/sparc64/kernel/pci_common.c index 4249214608af..f974fefc3ebc 100644 --- a/trunk/arch/sparc64/kernel/pci_common.c +++ b/trunk/arch/sparc64/kernel/pci_common.c @@ -291,9 +291,8 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) for (i = 0; i < num_pbm_ranges; i++) { const struct linux_prom_pci_ranges *pr = &pbm_ranges[i]; - unsigned long a, size; + unsigned long a; u32 parent_phys_hi, parent_phys_lo; - u32 size_hi, size_lo; int type; parent_phys_hi = pr->parent_phys_hi; @@ -301,14 +300,9 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) if (tlb_type == hypervisor) parent_phys_hi &= 0x0fffffff; - size_hi = pr->size_hi; - size_lo = pr->size_lo; - type = (pr->child_phys_hi >> 24) & 0x3; a = (((unsigned long)parent_phys_hi << 32UL) | ((unsigned long)parent_phys_lo << 0UL)); - size = (((unsigned long)size_hi << 32UL) | - ((unsigned long)size_lo << 0UL)); switch (type) { case 0: @@ -319,7 +313,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) case 1: /* 16-bit IO space, 16MB */ pbm->io_space.start = a; - pbm->io_space.end = a + size - 1UL; + pbm->io_space.end = a + ((16UL*1024UL*1024UL) - 1UL); pbm->io_space.flags = IORESOURCE_IO; saw_io = 1; break; @@ -327,7 +321,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) case 2: /* 32-bit MEM space, 2GB */ pbm->mem_space.start = a; - pbm->mem_space.end = a + size - 1UL; + pbm->mem_space.end = a + (0x80000000UL - 1UL); pbm->mem_space.flags = IORESOURCE_MEM; saw_mem = 1; break; diff --git a/trunk/arch/um/include/common-offsets.h b/trunk/arch/um/include/common-offsets.h index 7376ee44e330..541f4a8ca512 100644 --- a/trunk/arch/um/include/common-offsets.h +++ b/trunk/arch/um/include/common-offsets.h @@ -9,7 +9,6 @@ OFFSET(HOST_TASK_REGS, task_struct, thread.regs); OFFSET(HOST_TASK_PID, task_struct, pid); DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE); -DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK); DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC); DEFINE_STR(UM_KERN_EMERG, KERN_EMERG); diff --git a/trunk/arch/um/os-Linux/main.c b/trunk/arch/um/os-Linux/main.c index fb510d40480c..ea9a23696f36 100644 --- a/trunk/arch/um/os-Linux/main.c +++ b/trunk/arch/um/os-Linux/main.c @@ -24,7 +24,6 @@ #include "uml-config.h" #include "os.h" #include "um_malloc.h" -#include "kern_constants.h" /* Set in main, unchanged thereafter */ char *linux_prog; @@ -233,8 +232,7 @@ void *__wrap_malloc(int size) if(!CAN_KMALLOC()) return __real_malloc(size); - else if(size <= UM_KERN_PAGE_SIZE) - /* finding contiguous pages can be hard*/ + else if(size <= PAGE_SIZE) /* finding contiguos pages can be hard*/ ret = um_kmalloc(size); else ret = um_vmalloc(size); diff --git a/trunk/arch/um/os-Linux/skas/mem.c b/trunk/arch/um/os-Linux/skas/mem.c index 0f7df4eb903f..5c8946320799 100644 --- a/trunk/arch/um/os-Linux/skas/mem.c +++ b/trunk/arch/um/os-Linux/skas/mem.c @@ -25,7 +25,6 @@ #include "sysdep/ptrace.h" #include "sysdep/stub.h" #include "init.h" -#include "kern_constants.h" extern unsigned long batch_syscall_stub, __syscall_stub_start; @@ -150,8 +149,8 @@ long run_syscall_stub(struct mm_id * mm_idp, int syscall, *stack = 0; multi_op_count++; - if(!done && ((((unsigned long) stack) & ~UM_KERN_PAGE_MASK) < - UM_KERN_PAGE_SIZE - 10 * sizeof(long))){ + if(!done && ((((unsigned long) stack) & ~PAGE_MASK) < + PAGE_SIZE - 10 * sizeof(long))){ *addr = stack; return 0; } @@ -169,8 +168,8 @@ long syscall_stub_data(struct mm_id * mm_idp, /* If *addr still is uninitialized, it *must* contain NULL. * Thus in this case do_syscall_stub correctly won't be called. */ - if((((unsigned long) *addr) & ~UM_KERN_PAGE_MASK) >= - UM_KERN_PAGE_SIZE - (10 + data_count) * sizeof(long)) { + if((((unsigned long) *addr) & ~PAGE_MASK) >= + PAGE_SIZE - (10 + data_count) * sizeof(long)) { ret = do_syscall_stub(mm_idp, addr); /* in case of error, don't overwrite data on stack */ if(ret) @@ -184,8 +183,8 @@ long syscall_stub_data(struct mm_id * mm_idp, memcpy(stack + 1, data, data_count * sizeof(long)); - *stub_addr = (void *)(((unsigned long)(stack + 1) & - ~UM_KERN_PAGE_MASK) + UML_CONFIG_STUB_DATA); + *stub_addr = (void *)(((unsigned long)(stack + 1) & ~PAGE_MASK) + + UML_CONFIG_STUB_DATA); return 0; } diff --git a/trunk/arch/um/os-Linux/skas/process.c b/trunk/arch/um/os-Linux/skas/process.c index 46c00cc429bc..f9d2f8545afe 100644 --- a/trunk/arch/um/os-Linux/skas/process.c +++ b/trunk/arch/um/os-Linux/skas/process.c @@ -252,12 +252,11 @@ int start_userspace(unsigned long stub_stack) unsigned long sp; int pid, status, n, flags; - stack = mmap(NULL, UM_KERN_PAGE_SIZE, - PROT_READ | PROT_WRITE | PROT_EXEC, + stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if(stack == MAP_FAILED) panic("start_userspace : mmap failed, errno = %d", errno); - sp = (unsigned long) stack + UM_KERN_PAGE_SIZE - sizeof(void *); + sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *); flags = CLONE_FILES | SIGCHLD; if(proc_mm) flags |= CLONE_VM; @@ -280,7 +279,7 @@ int start_userspace(unsigned long stub_stack) panic("start_userspace : PTRACE_OLDSETOPTIONS failed, errno=%d\n", errno); - if(munmap(stack, UM_KERN_PAGE_SIZE) < 0) + if(munmap(stack, PAGE_SIZE) < 0) panic("start_userspace : munmap failed, errno = %d\n", errno); return(pid); @@ -366,7 +365,7 @@ static int __init init_thread_regs(void) thread_regs[REGS_IP_INDEX] = UML_CONFIG_STUB_CODE + (unsigned long) stub_clone_handler - (unsigned long) &__syscall_stub_start; - thread_regs[REGS_SP_INDEX] = UML_CONFIG_STUB_DATA + UM_KERN_PAGE_SIZE - + thread_regs[REGS_SP_INDEX] = UML_CONFIG_STUB_DATA + PAGE_SIZE - sizeof(void *); #ifdef __SIGNAL_FRAMESIZE thread_regs[REGS_SP_INDEX] -= __SIGNAL_FRAMESIZE; @@ -454,7 +453,7 @@ void map_stub_pages(int fd, unsigned long code, .u = { .mmap = { .addr = code, - .len = UM_KERN_PAGE_SIZE, + .len = PAGE_SIZE, .prot = PROT_EXEC, .flags = MAP_FIXED | MAP_PRIVATE, .fd = code_fd, @@ -477,7 +476,7 @@ void map_stub_pages(int fd, unsigned long code, .u = { .mmap = { .addr = data, - .len = UM_KERN_PAGE_SIZE, + .len = PAGE_SIZE, .prot = PROT_READ | PROT_WRITE, .flags = MAP_FIXED | MAP_SHARED, .fd = map_fd, diff --git a/trunk/arch/um/os-Linux/start_up.c b/trunk/arch/um/os-Linux/start_up.c index 46f613975c19..3fc13fa8729d 100644 --- a/trunk/arch/um/os-Linux/start_up.c +++ b/trunk/arch/um/os-Linux/start_up.c @@ -107,12 +107,11 @@ static int start_ptraced_child(void **stack_out) unsigned long sp; int pid, n, status; - stack = mmap(NULL, UM_KERN_PAGE_SIZE, - PROT_READ | PROT_WRITE | PROT_EXEC, + stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if(stack == MAP_FAILED) fatal_perror("check_ptrace : mmap failed"); - sp = (unsigned long) stack + UM_KERN_PAGE_SIZE - sizeof(void *); + sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *); pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL); if(pid < 0) fatal_perror("start_ptraced_child : clone failed"); @@ -154,7 +153,7 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode, ret = -1; } - if(munmap(stack, UM_KERN_PAGE_SIZE) < 0) + if(munmap(stack, PAGE_SIZE) < 0) fatal_perror("check_ptrace : munmap failed"); return ret; } diff --git a/trunk/block/ll_rw_blk.c b/trunk/block/ll_rw_blk.c index c99b46354859..6b5173ac8131 100644 --- a/trunk/block/ll_rw_blk.c +++ b/trunk/block/ll_rw_blk.c @@ -340,15 +340,6 @@ unsigned blk_ordered_req_seq(struct request *rq) if (rq == &q->post_flush_rq) return QUEUE_ORDSEQ_POSTFLUSH; - /* - * !fs requests don't need to follow barrier ordering. Always - * put them at the front. This fixes the following deadlock. - * - * http://thread.gmane.org/gmane.linux.kernel/537473 - */ - if (!blk_fs_request(rq)) - return QUEUE_ORDSEQ_DRAIN; - if ((rq->cmd_flags & REQ_ORDERED_COLOR) == (q->orig_bar_rq->cmd_flags & REQ_ORDERED_COLOR)) return QUEUE_ORDSEQ_DRAIN; diff --git a/trunk/drivers/acpi/toshiba_acpi.c b/trunk/drivers/acpi/toshiba_acpi.c index 13369b45563f..1cfbecb0ac10 100644 --- a/trunk/drivers/acpi/toshiba_acpi.c +++ b/trunk/drivers/acpi/toshiba_acpi.c @@ -524,7 +524,7 @@ static acpi_status __init add_device(void) return AE_OK; } -static acpi_status remove_device(void) +static acpi_status __exit remove_device(void) { ProcItem *item; diff --git a/trunk/drivers/char/agp/intel-agp.c b/trunk/drivers/char/agp/intel-agp.c index 0439ee951a11..d383168b75fa 100644 --- a/trunk/drivers/char/agp/intel-agp.c +++ b/trunk/drivers/char/agp/intel-agp.c @@ -1810,69 +1810,68 @@ static int find_gmch(u16 device) static const struct intel_driver_description { unsigned int chip_id; unsigned int gmch_chip_id; - unsigned int multi_gmch_chip; /* if we have more gfx chip type on this HB. */ char *name; const struct agp_bridge_driver *driver; const struct agp_bridge_driver *gmch_driver; } intel_agp_chipsets[] = { - { PCI_DEVICE_ID_INTEL_82443LX_0, 0, 0, "440LX", &intel_generic_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82443BX_0, 0, 0, "440BX", &intel_generic_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82443GX_0, 0, 0, "440GX", &intel_generic_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82810_MC1, PCI_DEVICE_ID_INTEL_82810_IG1, 0, "i810", + { PCI_DEVICE_ID_INTEL_82443LX_0, 0, "440LX", &intel_generic_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82443BX_0, 0, "440BX", &intel_generic_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82443GX_0, 0, "440GX", &intel_generic_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82810_MC1, PCI_DEVICE_ID_INTEL_82810_IG1, "i810", NULL, &intel_810_driver }, - { PCI_DEVICE_ID_INTEL_82810_MC3, PCI_DEVICE_ID_INTEL_82810_IG3, 0, "i810", + { PCI_DEVICE_ID_INTEL_82810_MC3, PCI_DEVICE_ID_INTEL_82810_IG3, "i810", NULL, &intel_810_driver }, - { PCI_DEVICE_ID_INTEL_82810E_MC, PCI_DEVICE_ID_INTEL_82810E_IG, 0, "i810", + { PCI_DEVICE_ID_INTEL_82810E_MC, PCI_DEVICE_ID_INTEL_82810E_IG, "i810", NULL, &intel_810_driver }, - { PCI_DEVICE_ID_INTEL_82815_MC, PCI_DEVICE_ID_INTEL_82815_CGC, 0, "i815", - &intel_815_driver, &intel_810_driver }, - { PCI_DEVICE_ID_INTEL_82820_HB, 0, 0, "i820", &intel_820_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82820_UP_HB, 0, 0, "i820", &intel_820_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82830_HB, PCI_DEVICE_ID_INTEL_82830_CGC, 0, "830M", + { PCI_DEVICE_ID_INTEL_82815_MC, PCI_DEVICE_ID_INTEL_82815_CGC, "i815", + &intel_810_driver, &intel_815_driver }, + { PCI_DEVICE_ID_INTEL_82820_HB, 0, "i820", &intel_820_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82820_UP_HB, 0, "i820", &intel_820_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82830_HB, PCI_DEVICE_ID_INTEL_82830_CGC, "830M", &intel_830mp_driver, &intel_830_driver }, - { PCI_DEVICE_ID_INTEL_82840_HB, 0, 0, "i840", &intel_840_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82845_HB, 0, 0, "845G", &intel_845_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, 0, "830M", + { PCI_DEVICE_ID_INTEL_82840_HB, 0, "i840", &intel_840_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82845_HB, 0, "845G", &intel_845_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, "830M", &intel_845_driver, &intel_830_driver }, - { PCI_DEVICE_ID_INTEL_82850_HB, 0, 0, "i850", &intel_850_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, 0, "855PM", &intel_845_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, 0, "855GM", + { PCI_DEVICE_ID_INTEL_82850_HB, 0, "i850", &intel_850_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, "855PM", &intel_845_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, "855GM", &intel_845_driver, &intel_830_driver }, - { PCI_DEVICE_ID_INTEL_82860_HB, 0, 0, "i860", &intel_860_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82865_HB, PCI_DEVICE_ID_INTEL_82865_IG, 0, "865", + { PCI_DEVICE_ID_INTEL_82860_HB, 0, "i860", &intel_860_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82865_HB, PCI_DEVICE_ID_INTEL_82865_IG, "865", &intel_845_driver, &intel_830_driver }, - { PCI_DEVICE_ID_INTEL_82875_HB, 0, 0, "i875", &intel_845_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82915G_HB, PCI_DEVICE_ID_INTEL_82915G_IG, 0, "915G", + { PCI_DEVICE_ID_INTEL_82875_HB, 0, "i875", &intel_845_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82915G_HB, PCI_DEVICE_ID_INTEL_82915G_IG, "915G", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82915GM_HB, PCI_DEVICE_ID_INTEL_82915GM_IG, 0, "915GM", + { PCI_DEVICE_ID_INTEL_82915GM_HB, PCI_DEVICE_ID_INTEL_82915GM_IG, "915GM", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, 0, "945G", + { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, "945G", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, 1, "945GM", + { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, "945GM", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, 0, "945GME", + { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, "945GME", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, 0, "946GZ", + { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, "946GZ", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965G_1_HB, PCI_DEVICE_ID_INTEL_82965G_1_IG, 0, "965G", + { PCI_DEVICE_ID_INTEL_82965G_1_HB, PCI_DEVICE_ID_INTEL_82965G_1_IG, "965G", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965Q_HB, PCI_DEVICE_ID_INTEL_82965Q_IG, 0, "965Q", + { PCI_DEVICE_ID_INTEL_82965Q_HB, PCI_DEVICE_ID_INTEL_82965Q_IG, "965Q", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, 0, "965G", + { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, "965G", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, 1, "965GM", + { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, "965GM", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, 0, "965GME/GLE", + { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, "965GME/GLE", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_7505_0, 0, 0, "E7505", &intel_7505_driver, NULL }, - { PCI_DEVICE_ID_INTEL_7205_0, 0, 0, "E7205", &intel_7505_driver, NULL }, - { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, 0, "G33", + { PCI_DEVICE_ID_INTEL_7505_0, 0, "E7505", &intel_7505_driver, NULL }, + { PCI_DEVICE_ID_INTEL_7205_0, 0, "E7205", &intel_7505_driver, NULL }, + { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, "G33", &intel_845_driver, &intel_g33_driver }, - { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, 0, "Q35", + { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, "Q35", &intel_845_driver, &intel_g33_driver }, - { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33", + { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, "Q33", &intel_845_driver, &intel_g33_driver }, - { 0, 0, 0, NULL, NULL, NULL } + { 0, 0, NULL, NULL, NULL } }; static int __devinit agp_intel_probe(struct pci_dev *pdev, @@ -1893,19 +1892,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, /* In case that multiple models of gfx chip may stand on same host bridge type, this can be sure we detect the right IGD. */ - if (pdev->device == intel_agp_chipsets[i].chip_id) { - if ((intel_agp_chipsets[i].gmch_chip_id != 0) && - find_gmch(intel_agp_chipsets[i].gmch_chip_id)) { - bridge->driver = - intel_agp_chipsets[i].gmch_driver; - break; - } else if (intel_agp_chipsets[i].multi_gmch_chip) { - continue; - } else { - bridge->driver = intel_agp_chipsets[i].driver; - break; - } - } + if ((pdev->device == intel_agp_chipsets[i].chip_id) && + ((intel_agp_chipsets[i].gmch_chip_id == 0) || + find_gmch(intel_agp_chipsets[i].gmch_chip_id))) + break; } if (intel_agp_chipsets[i].name == NULL) { @@ -1916,6 +1906,11 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, return -ENODEV; } + if (intel_agp_chipsets[i].gmch_chip_id != 0) + bridge->driver = intel_agp_chipsets[i].gmch_driver; + else + bridge->driver = intel_agp_chipsets[i].driver; + if (bridge->driver == NULL) { printk(KERN_WARNING PFX "Failed to find bridge device " "(chip_id: %04x)\n", intel_agp_chipsets[i].gmch_chip_id); diff --git a/trunk/drivers/char/drm/drm_pciids.h b/trunk/drivers/char/drm/drm_pciids.h index aa6335032d1e..177ccc07f968 100644 --- a/trunk/drivers/char/drm/drm_pciids.h +++ b/trunk/drivers/char/drm/drm_pciids.h @@ -300,15 +300,10 @@ {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x27a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x8086, 0x27ae, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2972, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2982, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x29a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x8086, 0x29b2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x8086, 0x29c2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x8086, 0x29d2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x8086, 0x2a12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0, 0, 0} diff --git a/trunk/drivers/char/drm/i915_dma.c b/trunk/drivers/char/drm/i915_dma.c index ea52740af4f6..1ba15d9a171a 100644 --- a/trunk/drivers/char/drm/i915_dma.c +++ b/trunk/drivers/char/drm/i915_dma.c @@ -35,12 +35,7 @@ dev->pci_device == 0x2982 || \ dev->pci_device == 0x2992 || \ dev->pci_device == 0x29A2 || \ - dev->pci_device == 0x2A02 || \ - dev->pci_device == 0x2A12) - -#define IS_G33(dev) (dev->pci_device == 0x29b2 || \ - dev->pci_device == 0x29c2 || \ - dev->pci_device == 0x29d2) + dev->pci_device == 0x2A02) /* Really want an OS-independent resettable timer. Would like to have * this loop run for (eg) 3 sec, but have the timer reset every time @@ -111,12 +106,6 @@ static int i915_dma_cleanup(drm_device_t * dev) I915_WRITE(0x02080, 0x1ffff000); } - if (dev_priv->status_gfx_addr) { - dev_priv->status_gfx_addr = 0; - drm_core_ioremapfree(&dev_priv->hws_map, dev); - I915_WRITE(0x2080, 0x1ffff000); - } - drm_free(dev->dev_private, sizeof(drm_i915_private_t), DRM_MEM_DRIVER); @@ -190,24 +179,26 @@ static int i915_initialize(drm_device_t * dev, dev_priv->allow_batchbuffer = 1; /* Program Hardware Status Page */ - if (!IS_G33(dev)) { - dev_priv->status_page_dmah = - drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff); - - if (!dev_priv->status_page_dmah) { - dev->dev_private = (void *)dev_priv; - i915_dma_cleanup(dev); - DRM_ERROR("Can not allocate hardware status page\n"); - return DRM_ERR(ENOMEM); - } - dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; - dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; + dev_priv->status_page_dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, + 0xffffffff); - memset(dev_priv->hw_status_page, 0, PAGE_SIZE); - I915_WRITE(0x02080, dev_priv->dma_status_page); + if (!dev_priv->status_page_dmah) { + dev->dev_private = (void *)dev_priv; + i915_dma_cleanup(dev); + DRM_ERROR("Can not allocate hardware status page\n"); + return DRM_ERR(ENOMEM); } + dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; + dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; + + memset(dev_priv->hw_status_page, 0, PAGE_SIZE); + DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page); + + I915_WRITE(0x02080, dev_priv->dma_status_page); DRM_DEBUG("Enabled hardware status page\n"); + dev->dev_private = (void *)dev_priv; + return 0; } @@ -240,10 +231,7 @@ static int i915_dma_resume(drm_device_t * dev) } DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page); - if (dev_priv->status_gfx_addr != 0) - I915_WRITE(0x02080, dev_priv->status_gfx_addr); - else - I915_WRITE(0x02080, dev_priv->dma_status_page); + I915_WRITE(0x02080, dev_priv->dma_status_page); DRM_DEBUG("Enabled hardware status page\n"); return 0; @@ -751,47 +739,6 @@ static int i915_setparam(DRM_IOCTL_ARGS) return 0; } -static int i915_set_status_page(DRM_IOCTL_ARGS) -{ - DRM_DEVICE; - drm_i915_private_t *dev_priv = dev->dev_private; - drm_i915_hws_addr_t hws; - - if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __FUNCTION__); - return DRM_ERR(EINVAL); - } - DRM_COPY_FROM_USER_IOCTL(hws, (drm_i915_hws_addr_t __user *) data, - sizeof(hws)); - printk(KERN_DEBUG "set status page addr 0x%08x\n", (u32)hws.addr); - - dev_priv->status_gfx_addr = hws.addr & (0x1ffff<<12); - - dev_priv->hws_map.offset = dev->agp->agp_info.aper_base + hws.addr; - dev_priv->hws_map.size = 4*1024; - dev_priv->hws_map.type = 0; - dev_priv->hws_map.flags = 0; - dev_priv->hws_map.mtrr = 0; - - drm_core_ioremap(&dev_priv->hws_map, dev); - if (dev_priv->hws_map.handle == NULL) { - dev->dev_private = (void *)dev_priv; - i915_dma_cleanup(dev); - dev_priv->status_gfx_addr = 0; - DRM_ERROR("can not ioremap virtual address for" - " G33 hw status page\n"); - return DRM_ERR(ENOMEM); - } - dev_priv->hw_status_page = dev_priv->hws_map.handle; - - memset(dev_priv->hw_status_page, 0, PAGE_SIZE); - I915_WRITE(0x02080, dev_priv->status_gfx_addr); - DRM_DEBUG("load hws 0x2080 with gfx mem 0x%x\n", - dev_priv->status_gfx_addr); - DRM_DEBUG("load hws at %p\n", dev_priv->hw_status_page); - return 0; -} - int i915_driver_load(drm_device_t *dev, unsigned long flags) { /* i915 has 4 more counters */ @@ -838,7 +785,6 @@ drm_ioctl_desc_t i915_ioctls[] = { [DRM_IOCTL_NR(DRM_I915_SET_VBLANK_PIPE)] = { i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY }, [DRM_IOCTL_NR(DRM_I915_GET_VBLANK_PIPE)] = { i915_vblank_pipe_get, DRM_AUTH }, [DRM_IOCTL_NR(DRM_I915_VBLANK_SWAP)] = {i915_vblank_swap, DRM_AUTH}, - [DRM_IOCTL_NR(DRM_I915_HWS_ADDR)] = {i915_set_status_page, DRM_AUTH}, }; int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); diff --git a/trunk/drivers/char/drm/i915_drm.h b/trunk/drivers/char/drm/i915_drm.h index 7b7b68b96f31..96a468886a7a 100644 --- a/trunk/drivers/char/drm/i915_drm.h +++ b/trunk/drivers/char/drm/i915_drm.h @@ -142,7 +142,6 @@ typedef struct _drm_i915_sarea { #define DRM_I915_SET_VBLANK_PIPE 0x0d #define DRM_I915_GET_VBLANK_PIPE 0x0e #define DRM_I915_VBLANK_SWAP 0x0f -#define DRM_I915_HWS_ADDR 0x11 #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) @@ -263,8 +262,4 @@ typedef struct drm_i915_vblank_swap { unsigned int sequence; } drm_i915_vblank_swap_t; -typedef struct drm_i915_hws_addr { - uint64_t addr; -} drm_i915_hws_addr_t; - #endif /* _I915_DRM_H_ */ diff --git a/trunk/drivers/char/drm/i915_drv.h b/trunk/drivers/char/drm/i915_drv.h index 85e323acb95d..93cdcfe6aa84 100644 --- a/trunk/drivers/char/drm/i915_drv.h +++ b/trunk/drivers/char/drm/i915_drv.h @@ -91,8 +91,6 @@ typedef struct drm_i915_private { void *hw_status_page; dma_addr_t dma_status_page; unsigned long counter; - unsigned int status_gfx_addr; - drm_local_map_t hws_map; unsigned int cpp; int back_offset; diff --git a/trunk/drivers/char/drm/radeon_ioc32.c b/trunk/drivers/char/drm/radeon_ioc32.c index 56decda2a71f..1f1f9cc055a4 100644 --- a/trunk/drivers/char/drm/radeon_ioc32.c +++ b/trunk/drivers/char/drm/radeon_ioc32.c @@ -349,36 +349,6 @@ static int compat_radeon_irq_emit(struct file *file, unsigned int cmd, DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request); } -/* The two 64-bit arches where alignof(u64)==4 in 32-bit code */ -#if defined (CONFIG_X86_64) || defined(CONFIG_IA64) -typedef struct drm_radeon_setparam32 { - int param; - u64 value; -} __attribute__((packed)) drm_radeon_setparam32_t; - -static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, - unsigned long arg) -{ - drm_radeon_setparam32_t req32; - drm_radeon_setparam_t __user *request; - - if (copy_from_user(&req32, (void __user *) arg, sizeof(req32))) - return -EFAULT; - - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.param, &request->param) - || __put_user((void __user *)(unsigned long)req32.value, - &request->value)) - return -EFAULT; - - return drm_ioctl(file->f_dentry->d_inode, file, - DRM_IOCTL_RADEON_SETPARAM, (unsigned long) request); -} -#else -#define compat_radeon_cp_setparam NULL -#endif /* X86_64 || IA64 */ - drm_ioctl_compat_t *radeon_compat_ioctls[] = { [DRM_RADEON_CP_INIT] = compat_radeon_cp_init, [DRM_RADEON_CLEAR] = compat_radeon_cp_clear, @@ -387,7 +357,6 @@ drm_ioctl_compat_t *radeon_compat_ioctls[] = { [DRM_RADEON_VERTEX2] = compat_radeon_cp_vertex2, [DRM_RADEON_CMDBUF] = compat_radeon_cp_cmdbuf, [DRM_RADEON_GETPARAM] = compat_radeon_cp_getparam, - [DRM_RADEON_SETPARAM] = compat_radeon_cp_setparam, [DRM_RADEON_ALLOC] = compat_radeon_mem_alloc, [DRM_RADEON_IRQ_EMIT] = compat_radeon_irq_emit, }; diff --git a/trunk/drivers/char/random.c b/trunk/drivers/char/random.c index 7f5271272f91..0474cac4a84e 100644 --- a/trunk/drivers/char/random.c +++ b/trunk/drivers/char/random.c @@ -794,7 +794,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out) buf[0] ^= buf[3]; buf[1] ^= buf[4]; - buf[2] ^= rol32(buf[2], 16); + buf[0] ^= rol32(buf[3], 16); memcpy(out, buf, EXTRACT_SIZE); memset(buf, 0, sizeof(buf)); } diff --git a/trunk/drivers/char/tty_io.c b/trunk/drivers/char/tty_io.c index a96f26a63fa2..3752edc30c36 100644 --- a/trunk/drivers/char/tty_io.c +++ b/trunk/drivers/char/tty_io.c @@ -1173,14 +1173,8 @@ static unsigned int hung_up_tty_poll(struct file * filp, poll_table * wait) return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM; } -static int hung_up_tty_ioctl(struct inode * inode, struct file * file, - unsigned int cmd, unsigned long arg) -{ - return cmd == TIOCSPGRP ? -ENOTTY : -EIO; -} - -static long hung_up_tty_compat_ioctl(struct file * file, - unsigned int cmd, unsigned long arg) +static long hung_up_tty_ioctl(struct file * file, + unsigned int cmd, unsigned long arg) { return cmd == TIOCSPGRP ? -ENOTTY : -EIO; } @@ -1228,8 +1222,8 @@ static const struct file_operations hung_up_tty_fops = { .read = hung_up_tty_read, .write = hung_up_tty_write, .poll = hung_up_tty_poll, - .ioctl = hung_up_tty_ioctl, - .compat_ioctl = hung_up_tty_compat_ioctl, + .unlocked_ioctl = hung_up_tty_ioctl, + .compat_ioctl = hung_up_tty_ioctl, .release = tty_release, }; diff --git a/trunk/drivers/ide/ide.c b/trunk/drivers/ide/ide.c index 0cd76bf66833..0af0d1614f75 100644 --- a/trunk/drivers/ide/ide.c +++ b/trunk/drivers/ide/ide.c @@ -1010,6 +1010,7 @@ static int generic_ide_resume(struct device *dev) { ide_drive_t *drive = dev->driver_data; ide_hwif_t *hwif = HWIF(drive); + ide_driver_t *drv = to_ide_driver(dev->driver); struct request rq; struct request_pm_state rqpm; ide_task_t args; @@ -1032,12 +1033,8 @@ static int generic_ide_resume(struct device *dev) err = ide_do_drive_cmd(drive, &rq, ide_head_wait); - if (err == 0 && dev->driver) { - ide_driver_t *drv = to_ide_driver(dev->driver); - - if (drv->resume) - drv->resume(drive); - } + if (err == 0 && drv && drv->resume) + drv->resume(drive); return err; } diff --git a/trunk/drivers/input/Kconfig b/trunk/drivers/input/Kconfig index 2d87357e2b2b..f814fb3a469d 100644 --- a/trunk/drivers/input/Kconfig +++ b/trunk/drivers/input/Kconfig @@ -39,19 +39,6 @@ config INPUT_FF_MEMLESS To compile this driver as a module, choose M here: the module will be called ff-memless. -config INPUT_POLLDEV - tristate "Polled input device skeleton" - help - Say Y here if you are using a driver for an input - device that periodically polls hardware state. This - option is only useful for out-of-tree drivers since - in-tree drivers select it automatically. - - If unsure, say N. - - To compile this driver as a module, choose M here: the - module will be called input-polldev. - comment "Userland interfaces" config INPUT_MOUSEDEV diff --git a/trunk/drivers/input/Makefile b/trunk/drivers/input/Makefile index 15eb752697b3..8a2dd987546c 100644 --- a/trunk/drivers/input/Makefile +++ b/trunk/drivers/input/Makefile @@ -8,7 +8,6 @@ obj-$(CONFIG_INPUT) += input-core.o input-core-objs := input.o ff-core.o obj-$(CONFIG_INPUT_FF_MEMLESS) += ff-memless.o -obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o obj-$(CONFIG_INPUT_MOUSEDEV) += mousedev.o obj-$(CONFIG_INPUT_JOYDEV) += joydev.o diff --git a/trunk/drivers/input/misc/Kconfig b/trunk/drivers/input/misc/Kconfig index 88e29074ac90..842a7b4d16f8 100644 --- a/trunk/drivers/input/misc/Kconfig +++ b/trunk/drivers/input/misc/Kconfig @@ -170,6 +170,17 @@ config INPUT_UINPUT To compile this driver as a module, choose M here: the module will be called uinput. +config INPUT_POLLDEV + tristate "Polled input device skeleton" + help + Say Y here if you are using a driver for an input + device that periodically polls hardware state. This + option is only useful for out-of-tree drivers since + in-tree drivers select it automatically. + + To compile this driver as a module, choose M here: the + module will be called input-polldev. + config HP_SDC_RTC tristate "HP SDC Real Time Clock" depends on GSC || HP300 diff --git a/trunk/drivers/input/misc/Makefile b/trunk/drivers/input/misc/Makefile index 3585b5038418..8b2f7799e25c 100644 --- a/trunk/drivers/input/misc/Makefile +++ b/trunk/drivers/input/misc/Makefile @@ -4,6 +4,7 @@ # Each configuration option enables a list of files. +obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o diff --git a/trunk/drivers/input/input-polldev.c b/trunk/drivers/input/misc/input-polldev.c similarity index 100% rename from trunk/drivers/input/input-polldev.c rename to trunk/drivers/input/misc/input-polldev.c diff --git a/trunk/drivers/input/serio/i8042-x86ia64io.h b/trunk/drivers/input/serio/i8042-x86ia64io.h index f4a2517925e4..6858bc58f0fd 100644 --- a/trunk/drivers/input/serio/i8042-x86ia64io.h +++ b/trunk/drivers/input/serio/i8042-x86ia64io.h @@ -68,15 +68,6 @@ static inline void i8042_write_command(int val) #include static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = { - { - /* AUX LOOP command does not raise AUX IRQ */ - .ident = "ASUS P65UP5", - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), - DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"), - DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"), - }, - }, { .ident = "Compaq Proliant 8500", .matches = { @@ -101,15 +92,6 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = { DMI_MATCH(DMI_PRODUCT_VERSION, "00"), }, }, - { - /* AUX LOOP does not work properly */ - .ident = "ULI EV4873", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "ULI"), - DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"), - DMI_MATCH(DMI_PRODUCT_VERSION, "5a"), - }, - }, { } }; diff --git a/trunk/drivers/input/touchscreen/usbtouchscreen.c b/trunk/drivers/input/touchscreen/usbtouchscreen.c index e3f22852bd09..8e18e6c64777 100644 --- a/trunk/drivers/input/touchscreen/usbtouchscreen.c +++ b/trunk/drivers/input/touchscreen/usbtouchscreen.c @@ -91,7 +91,7 @@ struct usbtouch_usb { }; -#if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) +#if defined(CONFIG_USB_TOUCHSCREEN_EGALAX) || defined(CONFIG_USB_TOUCHSCREEN_ETURBO) #define MULTI_PACKET #endif @@ -113,7 +113,7 @@ enum { }; static struct usb_device_id usbtouch_devices[] = { -#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX +#ifdef CONFIG_USB_TOUCHSCREEN_EGALAX {USB_DEVICE(0x3823, 0x0001), .driver_info = DEVTYPE_EGALAX}, {USB_DEVICE(0x3823, 0x0002), .driver_info = DEVTYPE_EGALAX}, {USB_DEVICE(0x0123, 0x0001), .driver_info = DEVTYPE_EGALAX}, @@ -123,30 +123,30 @@ static struct usb_device_id usbtouch_devices[] = { {USB_DEVICE(0x1234, 0x0002), .driver_info = DEVTYPE_EGALAX}, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_PANJIT +#ifdef CONFIG_USB_TOUCHSCREEN_PANJIT {USB_DEVICE(0x134c, 0x0001), .driver_info = DEVTYPE_PANJIT}, {USB_DEVICE(0x134c, 0x0002), .driver_info = DEVTYPE_PANJIT}, {USB_DEVICE(0x134c, 0x0003), .driver_info = DEVTYPE_PANJIT}, {USB_DEVICE(0x134c, 0x0004), .driver_info = DEVTYPE_PANJIT}, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_3M +#ifdef CONFIG_USB_TOUCHSCREEN_3M {USB_DEVICE(0x0596, 0x0001), .driver_info = DEVTYPE_3M}, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_ITM +#ifdef CONFIG_USB_TOUCHSCREEN_ITM {USB_DEVICE(0x0403, 0xf9e9), .driver_info = DEVTYPE_ITM}, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_ETURBO +#ifdef CONFIG_USB_TOUCHSCREEN_ETURBO {USB_DEVICE(0x1234, 0x5678), .driver_info = DEVTYPE_ETURBO}, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_GUNZE +#ifdef CONFIG_USB_TOUCHSCREEN_GUNZE {USB_DEVICE(0x0637, 0x0001), .driver_info = DEVTYPE_GUNZE}, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_DMC_TSC10 +#ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10 {USB_DEVICE(0x0afa, 0x03e8), .driver_info = DEVTYPE_DMC_TSC10}, #endif @@ -158,7 +158,7 @@ static struct usb_device_id usbtouch_devices[] = { * eGalax part */ -#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX +#ifdef CONFIG_USB_TOUCHSCREEN_EGALAX #define EGALAX_PKT_TYPE_MASK 0xFE #define EGALAX_PKT_TYPE_REPT 0x80 @@ -197,7 +197,7 @@ static int egalax_get_pkt_len(unsigned char *buf, int len) /***************************************************************************** * PanJit Part */ -#ifdef CONFIG_TOUCHSCREEN_USB_PANJIT +#ifdef CONFIG_USB_TOUCHSCREEN_PANJIT static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) { dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1]; @@ -212,7 +212,7 @@ static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) /***************************************************************************** * 3M/Microtouch Part */ -#ifdef CONFIG_TOUCHSCREEN_USB_3M +#ifdef CONFIG_USB_TOUCHSCREEN_3M #define MTOUCHUSB_ASYNC_REPORT 1 #define MTOUCHUSB_RESET 7 @@ -262,7 +262,7 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) /***************************************************************************** * ITM Part */ -#ifdef CONFIG_TOUCHSCREEN_USB_ITM +#ifdef CONFIG_USB_TOUCHSCREEN_ITM static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) { int touch; @@ -296,7 +296,7 @@ static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) /***************************************************************************** * eTurboTouch part */ -#ifdef CONFIG_TOUCHSCREEN_USB_ETURBO +#ifdef CONFIG_USB_TOUCHSCREEN_ETURBO static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) { unsigned int shift; @@ -327,7 +327,7 @@ static int eturbo_get_pkt_len(unsigned char *buf, int len) /***************************************************************************** * Gunze part */ -#ifdef CONFIG_TOUCHSCREEN_USB_GUNZE +#ifdef CONFIG_USB_TOUCHSCREEN_GUNZE static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt) { if (!(pkt[0] & 0x80) || ((pkt[1] | pkt[2] | pkt[3]) & 0x80)) @@ -348,7 +348,7 @@ static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt) * http://www.dmccoltd.com/files/controler/tsc10usb_pi_e.pdf * http://www.dmccoltd.com/files/controler/tsc25_usb_e.pdf */ -#ifdef CONFIG_TOUCHSCREEN_USB_DMC_TSC10 +#ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10 /* supported data rates. currently using 130 */ #define TSC10_RATE_POINT 0x50 @@ -419,7 +419,7 @@ static int dmc_tsc10_read_data(struct usbtouch_usb *dev, unsigned char *pkt) * the different device descriptors */ static struct usbtouch_device_info usbtouch_dev_info[] = { -#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX +#ifdef CONFIG_USB_TOUCHSCREEN_EGALAX [DEVTYPE_EGALAX] = { .min_xc = 0x0, .max_xc = 0x07ff, @@ -433,7 +433,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { }, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_PANJIT +#ifdef CONFIG_USB_TOUCHSCREEN_PANJIT [DEVTYPE_PANJIT] = { .min_xc = 0x0, .max_xc = 0x0fff, @@ -444,7 +444,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { }, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_3M +#ifdef CONFIG_USB_TOUCHSCREEN_3M [DEVTYPE_3M] = { .min_xc = 0x0, .max_xc = 0x4000, @@ -456,7 +456,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { }, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_ITM +#ifdef CONFIG_USB_TOUCHSCREEN_ITM [DEVTYPE_ITM] = { .min_xc = 0x0, .max_xc = 0x0fff, @@ -468,7 +468,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { }, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_ETURBO +#ifdef CONFIG_USB_TOUCHSCREEN_ETURBO [DEVTYPE_ETURBO] = { .min_xc = 0x0, .max_xc = 0x07ff, @@ -482,7 +482,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { }, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_GUNZE +#ifdef CONFIG_USB_TOUCHSCREEN_GUNZE [DEVTYPE_GUNZE] = { .min_xc = 0x0, .max_xc = 0x0fff, @@ -493,7 +493,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { }, #endif -#ifdef CONFIG_TOUCHSCREEN_USB_DMC_TSC10 +#ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10 [DEVTYPE_DMC_TSC10] = { .min_xc = 0x0, .max_xc = 0x03ff, diff --git a/trunk/drivers/kvm/kvm.h b/trunk/drivers/kvm/kvm.h index 152312c1fafa..1c040d80c641 100644 --- a/trunk/drivers/kvm/kvm.h +++ b/trunk/drivers/kvm/kvm.h @@ -304,7 +304,6 @@ struct kvm_vcpu { char *host_fx_image; char *guest_fx_image; int fpu_active; - int guest_fpu_loaded; int mmio_needed; int mmio_read_completed; @@ -509,8 +508,6 @@ void fx_init(struct kvm_vcpu *vcpu); void load_msrs(struct vmx_msr_entry *e, int n); void save_msrs(struct vmx_msr_entry *e, int n); void kvm_resched(struct kvm_vcpu *vcpu); -void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); -void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); int kvm_read_guest(struct kvm_vcpu *vcpu, gva_t addr, diff --git a/trunk/drivers/kvm/kvm_main.c b/trunk/drivers/kvm/kvm_main.c index 8f1f07adb04e..da985b31b17e 100644 --- a/trunk/drivers/kvm/kvm_main.c +++ b/trunk/drivers/kvm/kvm_main.c @@ -253,28 +253,6 @@ int kvm_write_guest(struct kvm_vcpu *vcpu, gva_t addr, unsigned long size, } EXPORT_SYMBOL_GPL(kvm_write_guest); -void kvm_load_guest_fpu(struct kvm_vcpu *vcpu) -{ - if (!vcpu->fpu_active || vcpu->guest_fpu_loaded) - return; - - vcpu->guest_fpu_loaded = 1; - fx_save(vcpu->host_fx_image); - fx_restore(vcpu->guest_fx_image); -} -EXPORT_SYMBOL_GPL(kvm_load_guest_fpu); - -void kvm_put_guest_fpu(struct kvm_vcpu *vcpu) -{ - if (!vcpu->guest_fpu_loaded) - return; - - vcpu->guest_fpu_loaded = 0; - fx_save(vcpu->guest_fx_image); - fx_restore(vcpu->host_fx_image); -} -EXPORT_SYMBOL_GPL(kvm_put_guest_fpu); - /* * Switches to specified vcpu, until a matching vcpu_put() */ diff --git a/trunk/drivers/kvm/vmx.c b/trunk/drivers/kvm/vmx.c index c1ac106ace8c..184238e2ece4 100644 --- a/trunk/drivers/kvm/vmx.c +++ b/trunk/drivers/kvm/vmx.c @@ -280,7 +280,6 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu) static void vmx_vcpu_put(struct kvm_vcpu *vcpu) { - kvm_put_guest_fpu(vcpu); put_cpu(); } @@ -1848,8 +1847,10 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) if (vcpu->guest_debug.enabled) kvm_guest_debug_pre(vcpu); - kvm_load_guest_fpu(vcpu); - + if (vcpu->fpu_active) { + fx_save(vcpu->host_fx_image); + fx_restore(vcpu->guest_fx_image); + } /* * Loading guest fpu may have cleared host cr0.ts */ @@ -2011,6 +2012,11 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) } #endif + if (vcpu->fpu_active) { + fx_save(vcpu->guest_fx_image); + fx_restore(vcpu->host_fx_image); + } + vcpu->interrupt_window_open = (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 3) == 0; asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index 46677d7d9980..3a95cc5e029c 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -1240,24 +1240,17 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) } r1_bio->read_disk = primary; for (i=0; iraid_disks; i++) - if (r1_bio->bios[i]->bi_end_io == end_sync_read) { + if (r1_bio->bios[i]->bi_end_io == end_sync_read && + test_bit(BIO_UPTODATE, &r1_bio->bios[i]->bi_flags)) { int j; int vcnt = r1_bio->sectors >> (PAGE_SHIFT- 9); struct bio *pbio = r1_bio->bios[primary]; struct bio *sbio = r1_bio->bios[i]; - - if (test_bit(BIO_UPTODATE, &sbio->bi_flags)) { - for (j = vcnt; j-- ; ) { - struct page *p, *s; - p = pbio->bi_io_vec[j].bv_page; - s = sbio->bi_io_vec[j].bv_page; - if (memcmp(page_address(p), - page_address(s), - PAGE_SIZE)) - break; - } - } else - j = 0; + for (j = vcnt; j-- ; ) + if (memcmp(page_address(pbio->bi_io_vec[j].bv_page), + page_address(sbio->bi_io_vec[j].bv_page), + PAGE_SIZE)) + break; if (j >= 0) mddev->resync_mismatches += r1_bio->sectors; if (j < 0 || test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) { diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c index 9eb66c1b523b..82249a69014f 100644 --- a/trunk/drivers/md/raid10.c +++ b/trunk/drivers/md/raid10.c @@ -1867,7 +1867,6 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i int d = r10_bio->devs[i].devnum; bio = r10_bio->devs[i].bio; bio->bi_end_io = NULL; - clear_bit(BIO_UPTODATE, &bio->bi_flags); if (conf->mirrors[d].rdev == NULL || test_bit(Faulty, &conf->mirrors[d].rdev->flags)) continue; @@ -2038,11 +2037,6 @@ static int run(mddev_t *mddev) /* 'size' is now the number of chunks in the array */ /* calculate "used chunks per device" in 'stride' */ stride = size * conf->copies; - - /* We need to round up when dividing by raid_disks to - * get the stride size. - */ - stride += conf->raid_disks - 1; sector_div(stride, conf->raid_disks); mddev->size = stride << (conf->chunk_shift-1); diff --git a/trunk/drivers/message/fusion/mptspi.c b/trunk/drivers/message/fusion/mptspi.c index 37bf65348372..d75f7ffbb02e 100644 --- a/trunk/drivers/message/fusion/mptspi.c +++ b/trunk/drivers/message/fusion/mptspi.c @@ -727,15 +727,13 @@ static int mptspi_slave_configure(struct scsi_device *sdev) struct _MPT_SCSI_HOST *hd = (struct _MPT_SCSI_HOST *)sdev->host->hostdata; VirtTarget *vtarget = scsi_target(sdev)->hostdata; - int ret; - - mptspi_initTarget(hd, vtarget, sdev); - - ret = mptscsih_slave_configure(sdev); + int ret = mptscsih_slave_configure(sdev); if (ret) return ret; + mptspi_initTarget(hd, vtarget, sdev); + ddvprintk((MYIOC_s_INFO_FMT "id=%d min_period=0x%02x" " max_offset=0x%02x max_width=%d\n", hd->ioc->name, sdev->id, spi_min_period(scsi_target(sdev)), diff --git a/trunk/drivers/mmc/core/sd.c b/trunk/drivers/mmc/core/sd.c index 918477c490b0..41bfb5dfe6ff 100644 --- a/trunk/drivers/mmc/core/sd.c +++ b/trunk/drivers/mmc/core/sd.c @@ -427,21 +427,6 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, mmc_set_bus_width(host, MMC_BUS_WIDTH_4); } - /* - * Check if read-only switch is active. - */ - if (!oldcard) { - if (!host->ops->get_ro) { - printk(KERN_WARNING "%s: host does not " - "support reading read-only " - "switch. assuming write-enable.\n", - mmc_hostname(host)); - } else { - if (host->ops->get_ro(host)) - mmc_card_set_readonly(card); - } - } - if (!oldcard) host->card = card; diff --git a/trunk/drivers/mmc/host/omap.c b/trunk/drivers/mmc/host/omap.c index b0824a38f425..1914e65d4db1 100644 --- a/trunk/drivers/mmc/host/omap.c +++ b/trunk/drivers/mmc/host/omap.c @@ -522,10 +522,28 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id) } if (status & OMAP_MMC_STAT_CARD_ERR) { - dev_dbg(mmc_dev(host->mmc), - "ignoring card status error (CMD%d)\n", + if (host->cmd && host->cmd->opcode == MMC_STOP_TRANSMISSION) { + u32 response = OMAP_MMC_READ(host, RSP6) + | (OMAP_MMC_READ(host, RSP7) << 16); + /* STOP sometimes sets must-ignore bits */ + if (!(response & (R1_CC_ERROR + | R1_ILLEGAL_COMMAND + | R1_COM_CRC_ERROR))) { + end_command = 1; + continue; + } + } + + dev_dbg(mmc_dev(host->mmc), "card status error (CMD%d)\n", host->cmd->opcode); - end_command = 1; + if (host->cmd) { + host->cmd->error = MMC_ERR_FAILED; + end_command = 1; + } + if (host->data) { + host->data->error = MMC_ERR_FAILED; + transfer_error = 1; + } } /* diff --git a/trunk/drivers/net/e100.c b/trunk/drivers/net/e100.c index 763810c7f33a..61696637a21e 100644 --- a/trunk/drivers/net/e100.c +++ b/trunk/drivers/net/e100.c @@ -285,12 +285,6 @@ enum scb_status { rus_mask = 0x3C, }; -enum ru_state { - RU_SUSPENDED = 0, - RU_RUNNING = 1, - RU_UNINITIALIZED = -1, -}; - enum scb_stat_ack { stat_ack_not_ours = 0x00, stat_ack_sw_gen = 0x04, @@ -532,7 +526,6 @@ struct nic { struct rx *rx_to_use; struct rx *rx_to_clean; struct rfd blank_rfd; - enum ru_state ru_running; spinlock_t cb_lock ____cacheline_aligned; spinlock_t cmd_lock; @@ -954,7 +947,7 @@ static void e100_get_defaults(struct nic *nic) ((nic->mac >= mac_82558_D101_A4) ? cb_cid : cb_i)); /* Template for a freshly allocated RFD */ - nic->blank_rfd.command = cpu_to_le16(cb_el); + nic->blank_rfd.command = cpu_to_le16(cb_el & cb_s); nic->blank_rfd.rbd = 0xFFFFFFFF; nic->blank_rfd.size = cpu_to_le16(VLAN_ETH_FRAME_LEN); @@ -1749,19 +1742,11 @@ static int e100_alloc_cbs(struct nic *nic) return 0; } -static inline void e100_start_receiver(struct nic *nic, struct rx *rx) +static inline void e100_start_receiver(struct nic *nic) { - if(!nic->rxs) return; - if(RU_SUSPENDED != nic->ru_running) return; - - /* handle init time starts */ - if(!rx) rx = nic->rxs; - - /* (Re)start RU if suspended or idle and RFA is non-NULL */ - if(rx->skb) { - e100_exec_cmd(nic, ruc_start, rx->dma_addr); - nic->ru_running = RU_RUNNING; - } + /* Start if RFA is non-NULL */ + if(nic->rx_to_clean->skb) + e100_exec_cmd(nic, ruc_start, nic->rx_to_clean->dma_addr); } #define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN) @@ -1790,7 +1775,7 @@ static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) put_unaligned(cpu_to_le32(rx->dma_addr), (u32 *)&prev_rfd->link); wmb(); - prev_rfd->command &= ~cpu_to_le16(cb_el); + prev_rfd->command &= ~cpu_to_le16(cb_el & cb_s); pci_dma_sync_single_for_device(nic->pdev, rx->prev->dma_addr, sizeof(struct rfd), PCI_DMA_TODEVICE); } @@ -1828,10 +1813,6 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, pci_unmap_single(nic->pdev, rx->dma_addr, RFD_BUF_LEN, PCI_DMA_FROMDEVICE); - /* this allows for a fast restart without re-enabling interrupts */ - if(le16_to_cpu(rfd->command) & cb_el) - nic->ru_running = RU_SUSPENDED; - /* Pull off the RFD and put the actual data (minus eth hdr) */ skb_reserve(skb, sizeof(struct rfd)); skb_put(skb, actual_size); @@ -1862,45 +1843,18 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done, unsigned int work_to_do) { struct rx *rx; - int restart_required = 0; - struct rx *rx_to_start = NULL; - - /* are we already rnr? then pay attention!!! this ensures that - * the state machine progression never allows a start with a - * partially cleaned list, avoiding a race between hardware - * and rx_to_clean when in NAPI mode */ - if(RU_SUSPENDED == nic->ru_running) - restart_required = 1; /* Indicate newly arrived packets */ for(rx = nic->rx_to_clean; rx->skb; rx = nic->rx_to_clean = rx->next) { - int err = e100_rx_indicate(nic, rx, work_done, work_to_do); - if(-EAGAIN == err) { - /* hit quota so have more work to do, restart once - * cleanup is complete */ - restart_required = 0; - break; - } else if(-ENODATA == err) + if(e100_rx_indicate(nic, rx, work_done, work_to_do)) break; /* No more to clean */ } - /* save our starting point as the place we'll restart the receiver */ - if(restart_required) - rx_to_start = nic->rx_to_clean; - /* Alloc new skbs to refill list */ for(rx = nic->rx_to_use; !rx->skb; rx = nic->rx_to_use = rx->next) { if(unlikely(e100_rx_alloc_skb(nic, rx))) break; /* Better luck next time (see watchdog) */ } - - if(restart_required) { - // ack the rnr? - writeb(stat_ack_rnr, &nic->csr->scb.stat_ack); - e100_start_receiver(nic, rx_to_start); - if(work_done) - (*work_done)++; - } } static void e100_rx_clean_list(struct nic *nic) @@ -1908,8 +1862,6 @@ static void e100_rx_clean_list(struct nic *nic) struct rx *rx; unsigned int i, count = nic->params.rfds.count; - nic->ru_running = RU_UNINITIALIZED; - if(nic->rxs) { for(rx = nic->rxs, i = 0; i < count; rx++, i++) { if(rx->skb) { @@ -1931,7 +1883,6 @@ static int e100_rx_alloc_list(struct nic *nic) unsigned int i, count = nic->params.rfds.count; nic->rx_to_use = nic->rx_to_clean = NULL; - nic->ru_running = RU_UNINITIALIZED; if(!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC))) return -ENOMEM; @@ -1946,7 +1897,6 @@ static int e100_rx_alloc_list(struct nic *nic) } nic->rx_to_use = nic->rx_to_clean = nic->rxs; - nic->ru_running = RU_SUSPENDED; return 0; } @@ -1966,10 +1916,6 @@ static irqreturn_t e100_intr(int irq, void *dev_id) /* Ack interrupt(s) */ iowrite8(stat_ack, &nic->csr->scb.stat_ack); - /* We hit Receive No Resource (RNR); restart RU after cleaning */ - if(stat_ack & stat_ack_rnr) - nic->ru_running = RU_SUSPENDED; - if(likely(netif_rx_schedule_prep(netdev))) { e100_disable_irq(nic); __netif_rx_schedule(netdev); @@ -2061,7 +2007,7 @@ static int e100_up(struct nic *nic) if((err = e100_hw_init(nic))) goto err_clean_cbs; e100_set_multicast_list(nic->netdev); - e100_start_receiver(nic, NULL); + e100_start_receiver(nic); mod_timer(&nic->watchdog, jiffies); if((err = request_irq(nic->pdev->irq, e100_intr, IRQF_SHARED, nic->netdev->name, nic->netdev))) @@ -2142,7 +2088,7 @@ static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode) mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, BMCR_LOOPBACK); - e100_start_receiver(nic, NULL); + e100_start_receiver(nic); if(!(skb = netdev_alloc_skb(nic->netdev, ETH_DATA_LEN))) { err = -ENOMEM; diff --git a/trunk/drivers/net/ehea/ehea.h b/trunk/drivers/net/ehea/ehea.h index c0f81b5a30fb..e85a933a4762 100644 --- a/trunk/drivers/net/ehea/ehea.h +++ b/trunk/drivers/net/ehea/ehea.h @@ -39,7 +39,7 @@ #include #define DRV_NAME "ehea" -#define DRV_VERSION "EHEA_0064" +#define DRV_VERSION "EHEA_0061" #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) diff --git a/trunk/drivers/net/ehea/ehea_main.c b/trunk/drivers/net/ehea/ehea_main.c index 9e13433a268a..152bb2016a2c 100644 --- a/trunk/drivers/net/ehea/ehea_main.c +++ b/trunk/drivers/net/ehea/ehea_main.c @@ -451,8 +451,7 @@ static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev, processed_rq3++; } - if ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) - && port->vgrp) + if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) vlan_hwaccel_receive_skb(skb, port->vgrp, cqe->vlan_tag); else @@ -1911,7 +1910,10 @@ static void ehea_vlan_rx_register(struct net_device *dev, goto out; } - memset(cb1->vlan_filter, 0, sizeof(cb1->vlan_filter)); + if (grp) + memset(cb1->vlan_filter, 0, sizeof(cb1->vlan_filter)); + else + memset(cb1->vlan_filter, 0xFF, sizeof(cb1->vlan_filter)); hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, H_PORT_CB1, H_PORT_CB1_ALL, cb1); @@ -1945,7 +1947,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) } index = (vid / 64); - cb1->vlan_filter[index] |= ((u64)(0x8000000000000000 >> (vid & 0x3F))); + cb1->vlan_filter[index] |= ((u64)(1 << (vid & 0x3F))); hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, H_PORT_CB1, H_PORT_CB1_ALL, cb1); @@ -1980,7 +1982,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) } index = (vid / 64); - cb1->vlan_filter[index] &= ~((u64)(0x8000000000000000 >> (vid & 0x3F))); + cb1->vlan_filter[index] &= ~((u64)(1 << (vid & 0x3F))); hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, H_PORT_CB1, H_PORT_CB1_ALL, cb1); diff --git a/trunk/drivers/net/ibmveth.c b/trunk/drivers/net/ibmveth.c index 6ec3d500f334..3bec0f733f01 100644 --- a/trunk/drivers/net/ibmveth.c +++ b/trunk/drivers/net/ibmveth.c @@ -915,36 +915,17 @@ static int ibmveth_change_mtu(struct net_device *dev, int new_mtu) { struct ibmveth_adapter *adapter = dev->priv; int new_mtu_oh = new_mtu + IBMVETH_BUFF_OH; - int reinit = 0; - int i, rc; + int i; if (new_mtu < IBMVETH_MAX_MTU) return -EINVAL; - for (i = 0; i < IbmVethNumBufferPools; i++) - if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size) - break; - - if (i == IbmVethNumBufferPools) - return -EINVAL; - /* Look for an active buffer pool that can hold the new MTU */ for(i = 0; irx_buff_pool[i].active) { - adapter->rx_buff_pool[i].active = 1; - reinit = 1; - } - + if (!adapter->rx_buff_pool[i].active) + continue; if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size) { - if (reinit && netif_running(adapter->netdev)) { - adapter->pool_config = 1; - ibmveth_close(adapter->netdev); - adapter->pool_config = 0; - dev->mtu = new_mtu; - if ((rc = ibmveth_open(adapter->netdev))) - return rc; - } else - dev->mtu = new_mtu; + dev->mtu = new_mtu; return 0; } } @@ -1262,19 +1243,16 @@ const char * buf, size_t count) if (attr == &veth_active_attr) { if (value && !pool->active) { - if (netif_running(netdev)) { - if(ibmveth_alloc_buffer_pool(pool)) { - ibmveth_error_printk("unable to alloc pool\n"); - return -ENOMEM; - } - pool->active = 1; - adapter->pool_config = 1; - ibmveth_close(netdev); - adapter->pool_config = 0; - if ((rc = ibmveth_open(netdev))) - return rc; - } else - pool->active = 1; + if(ibmveth_alloc_buffer_pool(pool)) { + ibmveth_error_printk("unable to alloc pool\n"); + return -ENOMEM; + } + pool->active = 1; + adapter->pool_config = 1; + ibmveth_close(netdev); + adapter->pool_config = 0; + if ((rc = ibmveth_open(netdev))) + return rc; } else if (!value && pool->active) { int mtu = netdev->mtu + IBMVETH_BUFF_OH; int i; @@ -1303,29 +1281,23 @@ const char * buf, size_t count) if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT) return -EINVAL; else { - if (netif_running(netdev)) { - adapter->pool_config = 1; - ibmveth_close(netdev); - adapter->pool_config = 0; - pool->size = value; - if ((rc = ibmveth_open(netdev))) - return rc; - } else - pool->size = value; + adapter->pool_config = 1; + ibmveth_close(netdev); + adapter->pool_config = 0; + pool->size = value; + if ((rc = ibmveth_open(netdev))) + return rc; } } else if (attr == &veth_size_attr) { if (value <= IBMVETH_BUFF_OH || value > IBMVETH_MAX_BUF_SIZE) return -EINVAL; else { - if (netif_running(netdev)) { - adapter->pool_config = 1; - ibmveth_close(netdev); - adapter->pool_config = 0; - pool->buff_size = value; - if ((rc = ibmveth_open(netdev))) - return rc; - } else - pool->buff_size = value; + adapter->pool_config = 1; + ibmveth_close(netdev); + adapter->pool_config = 0; + pool->buff_size = value; + if ((rc = ibmveth_open(netdev))) + return rc; } } diff --git a/trunk/drivers/net/lasi_82596.c b/trunk/drivers/net/lasi_82596.c index 741780e14b2c..6b49fc4bd1a1 100644 --- a/trunk/drivers/net/lasi_82596.c +++ b/trunk/drivers/net/lasi_82596.c @@ -83,7 +83,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/net/myri10ge/myri10ge.c b/trunk/drivers/net/myri10ge/myri10ge.c index 0f9904fe3a5a..b53b7ad999bc 100644 --- a/trunk/drivers/net/myri10ge/myri10ge.c +++ b/trunk/drivers/net/myri10ge/myri10ge.c @@ -71,7 +71,7 @@ #include "myri10ge_mcp.h" #include "myri10ge_mcp_gen_header.h" -#define MYRI10GE_VERSION_STR "1.3.1-1.248" +#define MYRI10GE_VERSION_STR "1.3.0-1.233" MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); MODULE_AUTHOR("Maintainer: help@myri.com"); @@ -279,8 +279,6 @@ static int myri10ge_fill_thresh = 256; module_param(myri10ge_fill_thresh, int, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed\n"); -static int myri10ge_reset_recover = 1; - static int myri10ge_wcfifo = 0; module_param(myri10ge_wcfifo, int, S_IRUGO); MODULE_PARM_DESC(myri10ge_wcfifo, "Enable WC Fifo when WC is enabled\n"); @@ -1156,11 +1154,9 @@ static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp) struct mcp_irq_data *stats = mgp->fw_stats; if (unlikely(stats->stats_updated)) { - unsigned link_up = ntohl(stats->link_up); - if (mgp->link_state != link_up) { - mgp->link_state = link_up; - - if (mgp->link_state == MXGEFW_LINK_UP) { + if (mgp->link_state != stats->link_up) { + mgp->link_state = stats->link_up; + if (mgp->link_state) { if (netif_msg_link(mgp)) printk(KERN_INFO "myri10ge: %s: link up\n", @@ -1170,11 +1166,8 @@ static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp) } else { if (netif_msg_link(mgp)) printk(KERN_INFO - "myri10ge: %s: link %s\n", - mgp->dev->name, - (link_up == MXGEFW_LINK_MYRINET ? - "mismatch (Myrinet detected)" : - "down")); + "myri10ge: %s: link down\n", + mgp->dev->name); netif_carrier_off(mgp->dev); mgp->link_changes++; } @@ -2737,14 +2730,8 @@ static void myri10ge_watchdog(struct work_struct *work) * For now, just report it */ reboot = myri10ge_read_reboot(mgp); printk(KERN_ERR - "myri10ge: %s: NIC rebooted (0x%x),%s resetting\n", - mgp->dev->name, reboot, - myri10ge_reset_recover ? " " : " not"); - if (myri10ge_reset_recover == 0) - return; - - myri10ge_reset_recover--; - + "myri10ge: %s: NIC rebooted (0x%x), resetting\n", + mgp->dev->name, reboot); /* * A rebooted nic will come back with config space as * it was after power was applied to PCIe bus. diff --git a/trunk/drivers/net/netxen/netxen_nic.h b/trunk/drivers/net/netxen/netxen_nic.h index 91f25e0a638e..ad6688eab265 100644 --- a/trunk/drivers/net/netxen/netxen_nic.h +++ b/trunk/drivers/net/netxen/netxen_nic.h @@ -68,10 +68,9 @@ #define _NETXEN_NIC_LINUX_SUBVERSION 2 #define NETXEN_NIC_LINUX_VERSIONID "3.4.2" -#define NETXEN_NUM_FLASH_SECTORS (64) -#define NETXEN_FLASH_SECTOR_SIZE (64 * 1024) -#define NETXEN_FLASH_TOTAL_SIZE (NETXEN_NUM_FLASH_SECTORS \ - * NETXEN_FLASH_SECTOR_SIZE) +#define NUM_FLASH_SECTORS (64) +#define FLASH_SECTOR_SIZE (64 * 1024) +#define FLASH_TOTAL_SIZE (NUM_FLASH_SECTORS * FLASH_SECTOR_SIZE) #define PHAN_VENDOR_ID 0x4040 @@ -678,28 +677,28 @@ struct netxen_new_user_info { /* Flash memory map */ typedef enum { - NETXEN_CRBINIT_START = 0, /* Crbinit section */ - NETXEN_BRDCFG_START = 0x4000, /* board config */ - NETXEN_INITCODE_START = 0x6000, /* pegtune code */ - NETXEN_BOOTLD_START = 0x10000, /* bootld */ - NETXEN_IMAGE_START = 0x43000, /* compressed image */ - NETXEN_SECONDARY_START = 0x200000, /* backup images */ - NETXEN_PXE_START = 0x3E0000, /* user defined region */ - NETXEN_USER_START = 0x3E8000, /* User defined region for new boards */ - NETXEN_FIXED_START = 0x3F0000 /* backup of crbinit */ + CRBINIT_START = 0, /* Crbinit section */ + BRDCFG_START = 0x4000, /* board config */ + INITCODE_START = 0x6000, /* pegtune code */ + BOOTLD_START = 0x10000, /* bootld */ + IMAGE_START = 0x43000, /* compressed image */ + SECONDARY_START = 0x200000, /* backup images */ + PXE_START = 0x3E0000, /* user defined region */ + USER_START = 0x3E8000, /* User defined region for new boards */ + FIXED_START = 0x3F0000 /* backup of crbinit */ } netxen_flash_map_t; -#define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward compatibility */ - -#define NETXEN_FLASH_START (NETXEN_CRBINIT_START) -#define NETXEN_INIT_SECTOR (0) -#define NETXEN_PRIMARY_START (NETXEN_BOOTLD_START) -#define NETXEN_FLASH_CRBINIT_SIZE (0x4000) -#define NETXEN_FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info)) -#define NETXEN_FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32)) -#define NETXEN_FLASH_SECONDARY_SIZE (NETXEN_USER_START-NETXEN_SECONDARY_START) -#define NETXEN_NUM_PRIMARY_SECTORS (0x20) -#define NETXEN_NUM_CONFIG_SECTORS (1) +#define USER_START_OLD PXE_START /* for backward compatibility */ + +#define FLASH_START (CRBINIT_START) +#define INIT_SECTOR (0) +#define PRIMARY_START (BOOTLD_START) +#define FLASH_CRBINIT_SIZE (0x4000) +#define FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info)) +#define FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32)) +#define FLASH_SECONDARY_SIZE (USER_START-SECONDARY_START) +#define NUM_PRIMARY_SECTORS (0x20) +#define NUM_CONFIG_SECTORS (1) #define PFX "NetXen: " extern char netxen_nic_driver_name[]; @@ -1049,7 +1048,6 @@ int netxen_rom_se(struct netxen_adapter *adapter, int addr); int netxen_do_rom_se(struct netxen_adapter *adapter, int addr); /* Functions from netxen_nic_isr.c */ -int netxen_nic_link_ok(struct netxen_adapter *adapter); void netxen_nic_isr_other(struct netxen_adapter *adapter); void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link); void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable); diff --git a/trunk/drivers/net/netxen/netxen_nic_ethtool.c b/trunk/drivers/net/netxen/netxen_nic_ethtool.c index 0175f6c353f6..16fabb377488 100644 --- a/trunk/drivers/net/netxen/netxen_nic_ethtool.c +++ b/trunk/drivers/net/netxen/netxen_nic_ethtool.c @@ -94,7 +94,7 @@ static const char netxen_nic_gstrings_test[][ETH_GSTRING_LEN] = { static int netxen_nic_get_eeprom_len(struct net_device *dev) { - return NETXEN_FLASH_TOTAL_SIZE; + return FLASH_TOTAL_SIZE; } static void @@ -470,7 +470,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, return 0; } - if (offset == NETXEN_BOOTLD_START) { + if (offset == BOOTLD_START) { ret = netxen_flash_erase_primary(adapter); if (ret != FLASH_SUCCESS) { printk(KERN_ERR "%s: Flash erase failed.\n", @@ -478,10 +478,10 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, return ret; } - ret = netxen_rom_se(adapter, NETXEN_USER_START); + ret = netxen_rom_se(adapter, USER_START); if (ret != FLASH_SUCCESS) return ret; - ret = netxen_rom_se(adapter, NETXEN_FIXED_START); + ret = netxen_rom_se(adapter, FIXED_START); if (ret != FLASH_SUCCESS) return ret; diff --git a/trunk/drivers/net/netxen/netxen_nic_hw.c b/trunk/drivers/net/netxen/netxen_nic_hw.c index c012764d1145..baff17a24d63 100644 --- a/trunk/drivers/net/netxen/netxen_nic_hw.c +++ b/trunk/drivers/net/netxen/netxen_nic_hw.c @@ -257,7 +257,7 @@ u64 ctx_addr_sig_regs[][3] = { #define ADDR_IN_RANGE(addr, low, high) \ (((addr) <= (high)) && ((addr) >= (low))) -#define NETXEN_FLASH_BASE (NETXEN_BOOTLD_START) +#define NETXEN_FLASH_BASE (BOOTLD_START) #define NETXEN_PHANTOM_MEM_BASE (NETXEN_FLASH_BASE) #define NETXEN_MAX_MTU 8000 + NETXEN_ENET_HEADER_SIZE + NETXEN_ETH_FCS_SIZE #define NETXEN_MIN_MTU 64 @@ -611,7 +611,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]) u32 *pmac = (u32 *) & mac[0]; if (netxen_get_flash_block(adapter, - NETXEN_USER_START + + USER_START + offsetof(struct netxen_new_user_info, mac_addr), FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) { @@ -619,7 +619,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]) } if (*mac == ~0ULL) { if (netxen_get_flash_block(adapter, - NETXEN_USER_START_OLD + + USER_START_OLD + offsetof(struct netxen_user_old_info, mac_addr), FLASH_NUM_PORTS * sizeof(u64), @@ -942,7 +942,7 @@ netxen_nic_pci_set_window(struct netxen_adapter *adapter, int netxen_nic_erase_pxe(struct netxen_adapter *adapter) { - if (netxen_rom_fast_write(adapter, NETXEN_PXE_START, 0) == -1) { + if (netxen_rom_fast_write(adapter, PXE_START, 0) == -1) { printk(KERN_ERR "%s: erase pxe failed\n", netxen_nic_driver_name); return -1; @@ -953,7 +953,7 @@ netxen_nic_erase_pxe(struct netxen_adapter *adapter) int netxen_nic_get_board_info(struct netxen_adapter *adapter) { int rv = 0; - int addr = NETXEN_BRDCFG_START; + int addr = BRDCFG_START; struct netxen_board_info *boardinfo; int index; u32 *ptr32; @@ -1115,7 +1115,7 @@ void netxen_nic_flash_print(struct netxen_adapter *adapter) u32 fw_build = 0; char brd_name[NETXEN_MAX_SHORT_NAME]; struct netxen_new_user_info user_info; - int i, addr = NETXEN_USER_START; + int i, addr = USER_START; __le32 *ptr32; struct netxen_board_info *board_info = &(adapter->ahw.boardcfg); diff --git a/trunk/drivers/net/netxen/netxen_nic_init.c b/trunk/drivers/net/netxen/netxen_nic_init.c index bb23f4c360db..a36892457761 100644 --- a/trunk/drivers/net/netxen/netxen_nic_init.c +++ b/trunk/drivers/net/netxen/netxen_nic_init.c @@ -585,7 +585,7 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter) { int ret = FLASH_SUCCESS; int val; - char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL); + char *buffer = kmalloc(FLASH_SECTOR_SIZE, GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -601,13 +601,13 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter) goto out_kfree; /* copy sector 0 to sector 63 */ - ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START, - buffer, NETXEN_FLASH_SECTOR_SIZE); + ret = netxen_rom_fast_read_words(adapter, CRBINIT_START, + buffer, FLASH_SECTOR_SIZE); if (ret != FLASH_SUCCESS) goto out_kfree; - ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START, - buffer, NETXEN_FLASH_SECTOR_SIZE); + ret = netxen_rom_fast_write_words(adapter, FIXED_START, + buffer, FLASH_SECTOR_SIZE); if (ret != FLASH_SUCCESS) goto out_kfree; @@ -654,8 +654,7 @@ void check_erased_flash(struct netxen_adapter *adapter, int addr) int count = 0, erased_errors = 0; int range; - range = (addr == NETXEN_USER_START) ? - NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE; + range = (addr == USER_START) ? FIXED_START : addr + FLASH_SECTOR_SIZE; for (i = addr; i < range; i += 4) { netxen_rom_fast_read(adapter, i, &val); @@ -690,7 +689,7 @@ netxen_flash_erase_sections(struct netxen_adapter *adapter, int start, int end) int i; for (i = start; i < end; i++) { - ret = netxen_rom_se(adapter, i * NETXEN_FLASH_SECTOR_SIZE); + ret = netxen_rom_se(adapter, i * FLASH_SECTOR_SIZE); if (ret) break; ret = netxen_rom_wip_poll(adapter); @@ -707,8 +706,8 @@ netxen_flash_erase_secondary(struct netxen_adapter *adapter) int ret = FLASH_SUCCESS; int start, end; - start = NETXEN_SECONDARY_START / NETXEN_FLASH_SECTOR_SIZE; - end = NETXEN_USER_START / NETXEN_FLASH_SECTOR_SIZE; + start = SECONDARY_START / FLASH_SECTOR_SIZE; + end = USER_START / FLASH_SECTOR_SIZE; ret = netxen_flash_erase_sections(adapter, start, end); return ret; @@ -720,8 +719,8 @@ netxen_flash_erase_primary(struct netxen_adapter *adapter) int ret = FLASH_SUCCESS; int start, end; - start = NETXEN_PRIMARY_START / NETXEN_FLASH_SECTOR_SIZE; - end = NETXEN_SECONDARY_START / NETXEN_FLASH_SECTOR_SIZE; + start = PRIMARY_START / FLASH_SECTOR_SIZE; + end = SECONDARY_START / FLASH_SECTOR_SIZE; ret = netxen_flash_erase_sections(adapter, start, end); return ret; @@ -1037,23 +1036,18 @@ void netxen_watchdog_task(struct work_struct *work) if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter)) return; - if (adapter->handle_phy_intr) - adapter->handle_phy_intr(adapter); - netdev = adapter->netdev; - if ((netif_running(netdev)) && !netif_carrier_ok(netdev) && - netxen_nic_link_ok(adapter) ) { - printk(KERN_INFO "%s %s (port %d), Link is up\n", - netxen_nic_driver_name, netdev->name, adapter->portnum); + if ((netif_running(netdev)) && !netif_carrier_ok(netdev)) { + printk(KERN_INFO "%s port %d, %s carrier is now ok\n", + netxen_nic_driver_name, adapter->portnum, netdev->name); netif_carrier_on(netdev); - netif_wake_queue(netdev); - } else if(!(netif_running(netdev)) && netif_carrier_ok(netdev)) { - printk(KERN_ERR "%s %s Link is Down\n", - netxen_nic_driver_name, netdev->name); - netif_carrier_off(netdev); - netif_stop_queue(netdev); } + if (netif_queue_stopped(netdev)) + netif_wake_queue(netdev); + + if (adapter->handle_phy_intr) + adapter->handle_phy_intr(adapter); mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ); } diff --git a/trunk/drivers/net/netxen/netxen_nic_isr.c b/trunk/drivers/net/netxen/netxen_nic_isr.c index b2de6b6c2a7f..b213b062eb56 100644 --- a/trunk/drivers/net/netxen/netxen_nic_isr.c +++ b/trunk/drivers/net/netxen/netxen_nic_isr.c @@ -169,24 +169,6 @@ void netxen_nic_gbe_handle_phy_intr(struct netxen_adapter *adapter) netxen_nic_isr_other(adapter); } -int netxen_nic_link_ok(struct netxen_adapter *adapter) -{ - switch (adapter->ahw.board_type) { - case NETXEN_NIC_GBE: - return ((adapter->ahw.qg_linksup) & 1); - - case NETXEN_NIC_XGBE: - return ((adapter->ahw.xg_linkup) & 1); - - default: - printk(KERN_ERR"%s: Function: %s, Unknown board type\n", - netxen_nic_driver_name, __FUNCTION__); - break; - } - - return 0; -} - void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) { struct net_device *netdev = adapter->netdev; @@ -201,10 +183,6 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) printk(KERN_INFO "%s: %s NIC Link is down\n", netxen_nic_driver_name, netdev->name); adapter->ahw.xg_linkup = 0; - if (netif_running(netdev)) { - netif_carrier_off(netdev); - netif_stop_queue(netdev); - } /* read twice to clear sticky bits */ /* WINDOW = 0 */ netxen_nic_read_w0(adapter, NETXEN_NIU_XG_STATUS, &val1); @@ -218,7 +196,5 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) printk(KERN_INFO "%s: %s NIC Link is up\n", netxen_nic_driver_name, netdev->name); adapter->ahw.xg_linkup = 1; - netif_carrier_on(netdev); - netif_wake_queue(netdev); } } diff --git a/trunk/drivers/net/netxen/netxen_nic_main.c b/trunk/drivers/net/netxen/netxen_nic_main.c index 6167b58d2731..c61181f23bd5 100644 --- a/trunk/drivers/net/netxen/netxen_nic_main.c +++ b/trunk/drivers/net/netxen/netxen_nic_main.c @@ -542,13 +542,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) NETXEN_ROMUSB_GLB_PEGTUNE_DONE)); /* Handshake with the card before we register the devices. */ netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); - - /* leave the hw in the same state as reboot */ - writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); - netxen_pinit_from_rom(adapter, 0); - udelay(500); - netxen_load_firmware(adapter); - netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); } /* diff --git a/trunk/drivers/net/netxen/netxen_nic_niu.c b/trunk/drivers/net/netxen/netxen_nic_niu.c index 75102d30730f..cef90a78351e 100644 --- a/trunk/drivers/net/netxen/netxen_nic_niu.c +++ b/trunk/drivers/net/netxen/netxen_nic_niu.c @@ -454,12 +454,16 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) { + u32 reg; u32 portnum = physical_port[adapter->portnum]; - netxen_crb_writelit_adapter(adapter, - NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), 0x1447); netxen_crb_writelit_adapter(adapter, NETXEN_NIU_XGE_CONFIG_0+(0x10000*portnum), 0x5); + netxen_nic_hw_read_wx(adapter, + NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), ®, 4); + reg = (reg & ~0x2000UL); + netxen_crb_writelit_adapter(adapter, + NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), reg); return 0; } diff --git a/trunk/drivers/net/phy/marvell.c b/trunk/drivers/net/phy/marvell.c index b87f8d2a888b..22aec5cce683 100644 --- a/trunk/drivers/net/phy/marvell.c +++ b/trunk/drivers/net/phy/marvell.c @@ -54,12 +54,6 @@ #define MII_M1111_PHY_LED_CONTROL 0x18 #define MII_M1111_PHY_LED_DIRECT 0x4100 #define MII_M1111_PHY_LED_COMBINE 0x411c -#define MII_M1111_PHY_EXT_CR 0x14 -#define MII_M1111_RX_DELAY 0x80 -#define MII_M1111_TX_DELAY 0x2 -#define MII_M1111_PHY_EXT_SR 0x1b -#define MII_M1111_HWCFG_MODE_MASK 0xf -#define MII_M1111_HWCFG_MODE_RGMII 0xb MODULE_DESCRIPTION("Marvell PHY driver"); MODULE_AUTHOR("Andy Fleming"); @@ -137,45 +131,6 @@ static int marvell_config_aneg(struct phy_device *phydev) return err; } -static int m88e1111_config_init(struct phy_device *phydev) -{ - int err; - - if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || - (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)) { - int temp; - - if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { - temp = phy_read(phydev, MII_M1111_PHY_EXT_CR); - if (temp < 0) - return temp; - - temp |= (MII_M1111_RX_DELAY | MII_M1111_TX_DELAY); - - err = phy_write(phydev, MII_M1111_PHY_EXT_CR, temp); - if (err < 0) - return err; - } - - temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); - if (temp < 0) - return temp; - - temp &= ~(MII_M1111_HWCFG_MODE_MASK); - temp |= MII_M1111_HWCFG_MODE_RGMII; - - err = phy_write(phydev, MII_M1111_PHY_EXT_SR, temp); - if (err < 0) - return err; - } - - err = phy_write(phydev, MII_BMCR, BMCR_RESET); - if (err < 0) - return err; - - return 0; -} - static int m88e1145_config_init(struct phy_device *phydev) { int err; @@ -197,7 +152,7 @@ static int m88e1145_config_init(struct phy_device *phydev) if (err < 0) return err; - if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { + if (phydev->interface == PHY_INTERFACE_MODE_RGMII) { int temp = phy_read(phydev, MII_M1145_PHY_EXT_CR); if (temp < 0) return temp; @@ -251,7 +206,7 @@ static struct phy_driver m88e1101_driver = { .driver = {.owner = THIS_MODULE,}, }; -static struct phy_driver m88e1111_driver = { +static struct phy_driver m88e1111s_driver = { .phy_id = 0x01410cc0, .phy_id_mask = 0xfffffff0, .name = "Marvell 88E1111", @@ -261,7 +216,6 @@ static struct phy_driver m88e1111_driver = { .read_status = &genphy_read_status, .ack_interrupt = &marvell_ack_interrupt, .config_intr = &marvell_config_intr, - .config_init = &m88e1111_config_init, .driver = {.owner = THIS_MODULE,}, }; @@ -287,9 +241,9 @@ static int __init marvell_init(void) if (ret) return ret; - ret = phy_driver_register(&m88e1111_driver); + ret = phy_driver_register(&m88e1111s_driver); if (ret) - goto err1111; + goto err1111s; ret = phy_driver_register(&m88e1145_driver); if (ret) @@ -297,9 +251,9 @@ static int __init marvell_init(void) return 0; -err1145: - phy_driver_unregister(&m88e1111_driver); -err1111: + err1145: + phy_driver_unregister(&m88e1111s_driver); + err1111s: phy_driver_unregister(&m88e1101_driver); return ret; } @@ -307,7 +261,7 @@ static int __init marvell_init(void) static void __exit marvell_exit(void) { phy_driver_unregister(&m88e1101_driver); - phy_driver_unregister(&m88e1111_driver); + phy_driver_unregister(&m88e1111s_driver); phy_driver_unregister(&m88e1145_driver); } diff --git a/trunk/drivers/net/ppp_mppe.c b/trunk/drivers/net/ppp_mppe.c index 5ae80bbe2edc..d5bdd2574659 100644 --- a/trunk/drivers/net/ppp_mppe.c +++ b/trunk/drivers/net/ppp_mppe.c @@ -493,14 +493,14 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf, /* * Make sure we have enough room to decrypt the packet. - * To account for possible PFC we should only subtract 1 - * byte whereas in mppe_compress() we added 2 bytes (+MPPE_OVHD); - * However, we assume no PFC, thus subtracting 2 bytes. + * Note that for our test we only subtract 1 byte whereas in + * mppe_compress() we added 2 bytes (+MPPE_OVHD); + * this is to account for possible PFC. */ - if (osize < isize - MPPE_OVHD - 2) { + if (osize < isize - MPPE_OVHD - 1) { printk(KERN_DEBUG "mppe_decompress[%d]: osize too small! " "(have: %d need: %d)\n", state->unit, - osize, isize - MPPE_OVHD - 2); + osize, isize - MPPE_OVHD - 1); return DECOMP_ERROR; } osize = isize - MPPE_OVHD - 2; /* assume no PFC */ diff --git a/trunk/drivers/net/smc91x.h b/trunk/drivers/net/smc91x.h index f8429449dc1e..506bffcbc6dc 100644 --- a/trunk/drivers/net/smc91x.h +++ b/trunk/drivers/net/smc91x.h @@ -58,8 +58,6 @@ #elif defined(CONFIG_BFIN) #define SMC_IRQ_FLAGS IRQF_TRIGGER_HIGH -#define RPC_LSA_DEFAULT RPC_LED_100_10 -#define RPC_LSB_DEFAULT RPC_LED_TX_RX # if defined (CONFIG_BFIN561_EZKIT) #define SMC_CAN_USE_8BIT 0 diff --git a/trunk/drivers/net/usb/Kconfig b/trunk/drivers/net/usb/Kconfig index 8dc09a3790cb..3de564b23147 100644 --- a/trunk/drivers/net/usb/Kconfig +++ b/trunk/drivers/net/usb/Kconfig @@ -313,8 +313,8 @@ config USB_KC2190 boolean "KT Technology KC2190 based cables (InstaNet)" depends on USB_NET_CDC_SUBSET && EXPERIMENTAL help - Choose this option if you're using a host-to-host cable - with one of these chips. +  Choose this option if you're using a host-to-host cable +  with one of these chips. config USB_NET_ZAURUS tristate "Sharp Zaurus (stock ROMs) and compatible" diff --git a/trunk/drivers/net/via-velocity.c b/trunk/drivers/net/via-velocity.c index b670b97bcfde..25b75b615188 100644 --- a/trunk/drivers/net/via-velocity.c +++ b/trunk/drivers/net/via-velocity.c @@ -1562,7 +1562,7 @@ static void velocity_print_link_status(struct velocity_info *vptr) if (vptr->mii_status & VELOCITY_LINK_FAIL) { VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: failed to detect cable link\n", vptr->dev->name); } else if (vptr->options.spd_dpx == SPD_DPX_AUTO) { - VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: Link auto-negotiation", vptr->dev->name); + VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: Link autonegation", vptr->dev->name); if (vptr->mii_status & VELOCITY_SPEED_1000) VELOCITY_PRT(MSG_LEVEL_INFO, " speed 1000M bps"); diff --git a/trunk/drivers/net/wireless/Kconfig b/trunk/drivers/net/wireless/Kconfig index fa2399cbd5ca..e3f5bb0fe603 100644 --- a/trunk/drivers/net/wireless/Kconfig +++ b/trunk/drivers/net/wireless/Kconfig @@ -266,23 +266,16 @@ config IPW2200_DEBUG If you are not sure, say N here. -config LIBERTAS - tristate "Marvell 8xxx Libertas WLAN driver support" - depends on WLAN_80211 - select IEEE80211 - select FW_LOADER - ---help--- - A library for Marvell Libertas 8xxx devices. - config LIBERTAS_USB - tristate "Marvell Libertas 8388 USB 802.11b/g cards" - depends on LIBERTAS && USB + tristate "Marvell Libertas 8388 802.11a/b/g cards" + depends on USB && WLAN_80211 + select FW_LOADER ---help--- A driver for Marvell Libertas 8388 USB devices. -config LIBERTAS_DEBUG - bool "Enable full debugging output in the Libertas module." - depends on LIBERTAS +config LIBERTAS_USB_DEBUG + bool "Enable full debugging output in the Libertas USB module." + depends on LIBERTAS_USB ---help--- Debugging support. diff --git a/trunk/drivers/net/wireless/libertas/11d.c b/trunk/drivers/net/wireless/libertas/11d.c index 4cf0ff7b833d..e0ecc4d483bb 100644 --- a/trunk/drivers/net/wireless/libertas/11d.c +++ b/trunk/drivers/net/wireless/libertas/11d.c @@ -95,7 +95,7 @@ static u8 wlan_get_chan_11d(u8 band, u8 firstchan, u8 nrchan, u8 * chan) for (i = 0; i < cfp_no; i++) { if ((cfp + i)->channel == firstchan) { - lbs_deb_11d("firstchan found\n"); + lbs_pr_debug(1, "firstchan found\n"); break; } } @@ -129,12 +129,12 @@ static u8 wlan_channel_known_11d(u8 chan, for (i = 0; i < nr_chan; i++) { if (chan == chanpwr[i].chan) { - lbs_deb_11d("11D: Found Chan:%d\n", chan); + lbs_pr_debug(1, "11D: Found Chan:%d\n", chan); return 1; } } - lbs_deb_11d("11D: Not Find Chan:%d\n", chan); + lbs_pr_debug(1, "11D: Not Find Chan:%d\n", chan); return 0; } @@ -174,7 +174,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d memcpy(domaininfo->countrycode, parsed_region_chan->countrycode, COUNTRY_CODE_LEN); - lbs_deb_11d("11D:nrchan=%d\n", nr_chan); + lbs_pr_debug(1, "11D:nrchan=%d\n", nr_chan); lbs_dbg_hex("11D:parsed_region_chan:", (char *)parsed_region_chan, sizeof(struct parsed_region_chan_11d)); @@ -212,7 +212,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d } domaininfo->nr_subband = nr_subband; - lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband); + lbs_pr_debug(1, "nr_subband=%x\n", domaininfo->nr_subband); lbs_dbg_hex("11D:domaininfo:", (char *)domaininfo, COUNTRY_CODE_LEN + 1 + sizeof(struct ieeetypes_subbandset) * nr_subband); @@ -233,13 +233,13 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_ struct chan_freq_power *cfp; if (region_chan == NULL) { - lbs_deb_11d("11D: region_chan is NULL\n"); + lbs_pr_debug(1, "11D: region_chan is NULL\n"); return; } cfp = region_chan->CFP; if (cfp == NULL) { - lbs_deb_11d("11D: cfp equal NULL \n"); + lbs_pr_debug(1, "11D: cfp equal NULL \n"); return; } @@ -248,19 +248,19 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_ memcpy(parsed_region_chan->countrycode, wlan_code_2_region(region_chan->region), COUNTRY_CODE_LEN); - lbs_deb_11d("11D: region[0x%x] band[%d]\n", parsed_region_chan->region, + lbs_pr_debug(1, "11D: region[0x%x] band[%d]\n", parsed_region_chan->region, parsed_region_chan->band); for (i = 0; i < region_chan->nrcfp; i++, cfp++) { parsed_region_chan->chanpwr[i].chan = cfp->channel; parsed_region_chan->chanpwr[i].pwr = cfp->maxtxpower; - lbs_deb_11d("11D: Chan[%d] Pwr[%d]\n", + lbs_pr_debug(1, "11D: Chan[%d] Pwr[%d]\n", parsed_region_chan->chanpwr[i].chan, parsed_region_chan->chanpwr[i].pwr); } parsed_region_chan->nr_chan = region_chan->nrcfp; - lbs_deb_11d("11D: nrchan[%d]\n", parsed_region_chan->nr_chan); + lbs_pr_debug(1, "11D: nrchan[%d]\n", parsed_region_chan->nr_chan); return; } @@ -277,9 +277,8 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan) struct chan_freq_power *cfp; int cfp_no; u8 idx; - int ret = 0; - lbs_deb_enter(LBS_DEB_11D); + ENTER(); cfp = libertas_get_region_cfp_table(region, band, &cfp_no); if (cfp == NULL) @@ -289,19 +288,16 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan) if (chan == (cfp + idx)->channel) { /* If Mrvl Chip Supported? */ if ((cfp + idx)->unsupported) { - ret = 0; + return 0; } else { - ret = 1; + return 1; } - goto done; } } /*chan is not in the region table */ - -done: - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); - return ret; + LEAVE(); + return 0; } /** @@ -325,7 +321,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* u8 j, i; - lbs_deb_enter(LBS_DEB_11D); + ENTER(); /*validation Rules: 1. valid region Code @@ -341,14 +337,15 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* if ((*(countryinfo->countrycode)) == 0 || (countryinfo->len <= COUNTRY_CODE_LEN)) { /* No region Info or Wrong region info: treat as No 11D info */ - goto done; + LEAVE(); + return 0; } /*Step1: check region_code */ parsed_region_chan->region = region = wlan_region_2_code(countryinfo->countrycode); - lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region); + lbs_pr_debug(1, "regioncode=%x\n", (u8) parsed_region_chan->region); lbs_dbg_hex("CountryCode:", (char *)countryinfo->countrycode, COUNTRY_CODE_LEN); @@ -364,7 +361,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* if (countryinfo->subband[j].firstchan <= lastchan) { /*Step2&3. Check First Chan Num increment and no overlap */ - lbs_deb_11d("11D: Chan[%d>%d] Overlap\n", + lbs_pr_debug(1, "11D: Chan[%d>%d] Overlap\n", countryinfo->subband[j].firstchan, lastchan); continue; } @@ -377,7 +374,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* if (!wlan_get_chan_11d(band, firstchan, i, &curchan)) { /* Chan is not found in UN table */ - lbs_deb_11d("chan is not supported: %d \n", i); + lbs_pr_debug(1, "chan is not supported: %d \n", i); break; } @@ -392,7 +389,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* idx++; } else { /*not supported and ignore the chan */ - lbs_deb_11d( + lbs_pr_debug(1, "11D:i[%d] chan[%d] unsupported in region[%x] band[%d]\n", i, curchan, region, band); } @@ -404,12 +401,11 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* parsed_region_chan->nr_chan = idx; - lbs_deb_11d("nrchan=%x\n", parsed_region_chan->nr_chan); + lbs_pr_debug(1, "nrchan=%x\n", parsed_region_chan->nr_chan); lbs_dbg_hex("11D:parsed_region_chan:", (u8 *) parsed_region_chan, 2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx); -done: - lbs_deb_enter(LBS_DEB_11D); + LEAVE(); return 0; } @@ -424,16 +420,16 @@ u8 libertas_get_scan_type_11d(u8 chan, { u8 scan_type = cmd_scan_type_passive; - lbs_deb_enter(LBS_DEB_11D); + ENTER(); if (wlan_channel_known_11d(chan, parsed_region_chan)) { - lbs_deb_11d("11D: Found and do Active Scan\n"); + lbs_pr_debug(1, "11D: Found and do Active Scan\n"); scan_type = cmd_scan_type_active; } else { - lbs_deb_11d("11D: Not Find and do Passive Scan\n"); + lbs_pr_debug(1, "11D: Not Find and do Passive Scan\n"); } - lbs_deb_leave_args(LBS_DEB_11D, "ret scan_type %d", scan_type); + LEAVE(); return scan_type; } @@ -460,7 +456,7 @@ static int wlan_enable_11d(wlan_private * priv, u8 flag) OID_802_11D_ENABLE, &priv->adapter->enable11d); if (ret) - lbs_deb_11d("11D: Fail to enable 11D \n"); + lbs_pr_debug(1, "11D: Fail to enable 11D \n"); return 0; } @@ -475,7 +471,7 @@ static int set_domain_info_11d(wlan_private * priv) int ret; if (!priv->adapter->enable11d) { - lbs_deb_11d("11D: dnld domain Info with 11d disabled\n"); + lbs_pr_debug(1, "11D: dnld domain Info with 11d disabled\n"); return 0; } @@ -483,7 +479,7 @@ static int set_domain_info_11d(wlan_private * priv) cmd_act_set, cmd_option_waitforrsp, 0, NULL); if (ret) - lbs_deb_11d("11D: Fail to dnld domain Info\n"); + lbs_pr_debug(1, "11D: Fail to dnld domain Info\n"); return ret; } @@ -505,7 +501,7 @@ int libertas_set_universaltable(wlan_private * priv, u8 band) adapter->universal_channel[i].nrcfp = sizeof(channel_freq_power_UN_BG) / size; - lbs_deb_11d("11D: BG-band nrcfp=%d\n", + lbs_pr_debug(1, "11D: BG-band nrcfp=%d\n", adapter->universal_channel[i].nrcfp); adapter->universal_channel[i].CFP = channel_freq_power_UN_BG; @@ -535,9 +531,9 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, wlan_adapter *adapter = priv->adapter; u8 nr_subband = adapter->domainreg.nr_subband; - lbs_deb_enter(LBS_DEB_11D); + ENTER(); - lbs_deb_11d("nr_subband=%x\n", nr_subband); + lbs_pr_debug(1, "nr_subband=%x\n", nr_subband); cmd->command = cpu_to_le16(cmdno); pdomaininfo->action = cpu_to_le16(cmdoption); @@ -546,7 +542,8 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); lbs_dbg_hex("11D: 802_11D_DOMAIN_INFO:", (u8 *) cmd, (int)(cmd->size)); - goto done; + LEAVE(); + return 0; } domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN); @@ -570,10 +567,10 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); } - lbs_dbg_hex("11D:802_11D_DOMAIN_INFO:", (u8 *) cmd, le16_to_cpu(cmd->size)); + lbs_dbg_hex("11D:802_11D_DOMAIN_INFO:", (u8 *) cmd, (int)(cmd->size)); + + LEAVE(); -done: - lbs_deb_enter(LBS_DEB_11D); return 0; } @@ -588,17 +585,17 @@ int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq) int data = 0; int *val; - lbs_deb_enter(LBS_DEB_11D); + ENTER(); data = SUBCMD_DATA(wrq); - lbs_deb_11d("enable 11D: %s\n", + lbs_pr_debug(1, "enable 11D: %s\n", (data == 1) ? "enable" : "Disable"); wlan_enable_11d(priv, data); val = (int *)wrq->u.name; *val = priv->adapter->enable11d; - lbs_deb_enter(LBS_DEB_11D); + LEAVE(); return 0; } @@ -611,24 +608,25 @@ int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq) int libertas_ret_802_11d_domain_info(wlan_private * priv, struct cmd_ds_command *resp) { - struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp; + struct cmd_ds_802_11d_domain_info + *domaininfo = &resp->params.domaininforesp; struct mrvlietypes_domainparamset *domain = &domaininfo->domain; u16 action = le16_to_cpu(domaininfo->action); s16 ret = 0; u8 nr_subband = 0; - lbs_deb_enter(LBS_DEB_11D); + ENTER(); lbs_dbg_hex("11D DOMAIN Info Rsp Data:", (u8 *) resp, (int)le16_to_cpu(resp->size)); - nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) / - sizeof(struct ieeetypes_subbandset); + nr_subband = (domain->header.len - 3) / sizeof(struct ieeetypes_subbandset); + /* countrycode 3 bytes */ - lbs_deb_11d("11D Domain Info Resp: nr_subband=%d\n", nr_subband); + lbs_pr_debug(1, "11D Domain Info Resp: nr_subband=%d\n", nr_subband); if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) { - lbs_deb_11d("Invalid Numrer of Subband returned!!\n"); + lbs_pr_debug(1, "Invalid Numrer of Subband returned!!\n"); return -1; } @@ -639,12 +637,12 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, case cmd_act_get: break; default: - lbs_deb_11d("Invalid action:%d\n", domaininfo->action); + lbs_pr_debug(1, "Invalid action:%d\n", domaininfo->action); ret = -1; break; } - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); + LEAVE(); return ret; } @@ -653,22 +651,23 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, * @param priv pointer to wlan_private * @return 0; -1 */ -int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, - struct bss_descriptor * bss) +int libertas_parse_dnld_countryinfo_11d(wlan_private * priv) { int ret; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_11D); + ENTER(); if (priv->adapter->enable11d) { memset(&adapter->parsed_region_chan, 0, sizeof(struct parsed_region_chan_11d)); - ret = parse_domain_info_11d(&bss->countryinfo, 0, + ret = parse_domain_info_11d(&adapter->pattemptedbssdesc-> + countryinfo, 0, &adapter->parsed_region_chan); if (ret == -1) { - lbs_deb_11d("11D: Err Parse domain_info from AP..\n"); - goto done; + lbs_pr_debug(1, "11D: Err Parse domain_info from AP..\n"); + LEAVE(); + return ret; } memset(&adapter->domainreg, 0, @@ -679,15 +678,13 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, ret = set_domain_info_11d(priv); if (ret) { - lbs_deb_11d("11D: Err set domainInfo to FW\n"); - goto done; + lbs_pr_debug(1, "11D: Err set domainInfo to FW\n"); + LEAVE(); + return ret; } } - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); - return ret; + LEAVE(); + return 0; } /** @@ -702,8 +699,8 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) struct region_channel *region_chan; u8 j; - lbs_deb_enter(LBS_DEB_11D); - lbs_deb_11d("11D:curbssparams.band[%d]\n", adapter->curbssparams.band); + ENTER(); + lbs_pr_debug(1, "11D:curbssparams.band[%d]\n", adapter->curbssparams.band); if (priv->adapter->enable11d) { /* update parsed_region_chan_11; dnld domaininf to FW */ @@ -712,7 +709,7 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) sizeof(adapter->region_channel[0]); j++) { region_chan = &adapter->region_channel[j]; - lbs_deb_11d("11D:[%d] region_chan->band[%d]\n", j, + lbs_pr_debug(1, "11D:[%d] region_chan->band[%d]\n", j, region_chan->band); if (!region_chan || !region_chan->valid @@ -725,10 +722,10 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) if (j >= sizeof(adapter->region_channel) / sizeof(adapter->region_channel[0])) { - lbs_deb_11d("11D:region_chan not found. band[%d]\n", + lbs_pr_debug(1, "11D:region_chan not found. band[%d]\n", adapter->curbssparams.band); - ret = -1; - goto done; + LEAVE(); + return -1; } memset(&adapter->parsed_region_chan, 0, @@ -745,14 +742,13 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) ret = set_domain_info_11d(priv); if (ret) { - lbs_deb_11d("11D: Err set domainInfo to FW\n"); - goto done; + lbs_pr_debug(1, "11D: Err set domainInfo to FW\n"); + LEAVE(); + return ret; } } - ret = 0; -done: - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); - return ret; + LEAVE(); + return 0; } diff --git a/trunk/drivers/net/wireless/libertas/11d.h b/trunk/drivers/net/wireless/libertas/11d.h index 73e42e712911..db2ebea9f231 100644 --- a/trunk/drivers/net/wireless/libertas/11d.h +++ b/trunk/drivers/net/wireless/libertas/11d.h @@ -47,7 +47,7 @@ struct mrvlietypes_domainparamset { } __attribute__ ((packed)); struct cmd_ds_802_11d_domain_info { - __le16 action; + u16 action; struct mrvlietypes_domainparamset domain; } __attribute__ ((packed)); @@ -98,9 +98,7 @@ int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq); int libertas_ret_802_11d_domain_info(wlan_private * priv, struct cmd_ds_command *resp); -struct bss_descriptor; -int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, - struct bss_descriptor * bss); +int libertas_parse_dnld_countryinfo_11d(wlan_private * priv); int libertas_create_dnld_countryinfo_11d(wlan_private * priv); diff --git a/trunk/drivers/net/wireless/libertas/Makefile b/trunk/drivers/net/wireless/libertas/Makefile index a1097f59fd46..56a8ea1fbf04 100644 --- a/trunk/drivers/net/wireless/libertas/Makefile +++ b/trunk/drivers/net/wireless/libertas/Makefile @@ -1,4 +1,4 @@ -libertas-objs := main.o fw.o wext.o \ +usb8xxx-objs := main.o fw.o wext.o \ rx.o tx.o cmd.o \ cmdresp.o scan.o \ join.o 11d.o \ @@ -8,5 +8,5 @@ libertas-objs := main.o fw.o wext.o \ usb8xxx-objs += if_bootcmd.o usb8xxx-objs += if_usb.o -obj-$(CONFIG_LIBERTAS) += libertas.o obj-$(CONFIG_LIBERTAS_USB) += usb8xxx.o + diff --git a/trunk/drivers/net/wireless/libertas/README b/trunk/drivers/net/wireless/libertas/README index 1f92f50b643c..378577200b56 100644 --- a/trunk/drivers/net/wireless/libertas/README +++ b/trunk/drivers/net/wireless/libertas/README @@ -1,7 +1,7 @@ ================================================================================ README for USB8388 - (c) Copyright © 2003-2006, Marvell International Ltd. + (c) Copyright © 2003-2006, Marvell International Ltd. All Rights Reserved This software file (the "File") is distributed by Marvell International @@ -47,19 +47,15 @@ Version 5 Command: iwpriv ethX ledgpio BT Commands: - The blinding table (BT) contains a list of mac addresses that will be, - by default, ignored by the firmware. It is also possible to invert this - behavior so that we will ignore all traffic except for the portion - coming from mac addresess in the list. It is primarily used for - debugging and testing networks. It can be edited and inspected with - the following commands: + The blinding table (BT) contains a list of mac addresses that should be + ignored by the firmware. It is primarily used for debugging and + testing networks. It can be edited and inspected with the following + commands: iwpriv ethX bt_reset iwpriv ethX bt_add iwpriv ethX bt_del iwpriv ethX bt_list - iwpriv ethX bt_get_invert - iwpriv ethX bt_set_invert FWT Commands: The forwarding table (FWT) is a feature used to manage mesh network @@ -139,7 +135,7 @@ fwt_add This command is used to insert an entry into the FWT table. The list of parameters must follow the following structure: - iwpriv ethX fwt_add da ra [metric dir rate ssn dsn hopcount ttl expiration sleepmode snr] + iwpriv ethX fwt_add da ra [metric dir ssn dsn hopcount ttl expiration sleepmode snr] The parameters between brackets are optional, but they must appear in the order specified. For example, if you want to specify the metric, @@ -154,9 +150,6 @@ fwt_add preferred, default is 0) dir -- direction (1 for direct, 0 for reverse, default is 1) - rate -- data rate used for transmission to the RA, - as specified for the rateadapt command, - default is 3 (11Mbps) ssn -- Source Sequence Number (time at the RA for reverse routes. Default is 0) dsn -- Destination Sequence Number (time at the DA @@ -214,17 +207,13 @@ fwt_list The output is a string of the following form: - da ra valid metric dir rate ssn dsn hopcount ttl expiration - sleepmode snr precursor + da ra metric dir ssn dsn hopcount ttl expiration sleepmode snr where the different fields are:- da -- DA MAC address (in the form "00:11:22:33:44:55") ra -- RA MAC address (in the form "00:11:22:33:44:55") - valid -- whether the route is valid (0 if not valid) metric -- route metric (cost: smaller-metric routes are preferred) dir -- direction (1 for direct, 0 for reverse) - rate -- data rate used for transmission to the RA, - as specified for the rateadapt command ssn -- Source Sequence Number (time at the RA for reverse routes) dsn -- Destination Sequence Number (time at the DA for direct routes) hopcount -- hop count (currently unused) @@ -232,10 +221,33 @@ fwt_list expiration -- entry expiration (in ticks, where a tick is 1024us, or ~ 1ms. Use 0 for an indefinite entry) sleepmode -- RA's sleep mode (currently unused) snr -- SNR in the link to RA (currently unused) - precursor -- predecessor in direct routes fwt_list_route - This command is equivalent to fwt_list. + This command is used to list a route from the FWT table. The only + parameter is the route ID. If you want to list all the routes in a + table, start with rid=0, and keep incrementing rid until you get a + "(null)" string. This function is similar to fwt_list. The only + difference is the output format. Also note that this command is meant + for debugging. It is expected that users will use fwt_lookup and + fwt_list. One important reason for this is that the route id may change + as the route table is altered. + + iwpriv ethX fwt_list_route rid + + The output is a string of the following form: + + da metric dir nid ssn dsn hopcount ttl expiration + + where the different fields are:- + da -- DA MAC address (in the form "00:11:22:33:44:55") + metric -- route metric (cost: smaller-metric routes are preferred) + dir -- direction (1 for direct, 0 for reverse) + nid -- Next-hop (neighbor) host ID (nid) + ssn -- Source Sequence Number (time at the RA for reverse routes) + dsn -- Destination Sequence Number (time at the DA for direct routes) + hopcount -- hop count (currently unused) + ttl -- TTL count (only used in reverse entries) + expiration -- entry expiration (in ticks, where a tick is 1024us, or ~ 1ms. Use 0 for an indefinite entry) fwt_list_neigh This command is used to list a neighbor from the FWT table. The only diff --git a/trunk/drivers/net/wireless/libertas/assoc.c b/trunk/drivers/net/wireless/libertas/assoc.c index f67efa0815fe..c260bd1b3d46 100644 --- a/trunk/drivers/net/wireless/libertas/assoc.c +++ b/trunk/drivers/net/wireless/libertas/assoc.c @@ -2,7 +2,6 @@ #include #include -#include #include "assoc.h" #include "join.h" @@ -14,88 +13,59 @@ static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static void print_assoc_req(const char * extra, struct assoc_request * assoc_req) -{ - lbs_deb_assoc( - "#### Association Request: %s\n" - " flags: 0x%08lX\n" - " SSID: '%s'\n" - " channel: %d\n" - " band: %d\n" - " mode: %d\n" - " BSSID: " MAC_FMT "\n" - " Encryption:%s%s%s\n" - " auth: %d\n", - extra, assoc_req->flags, - escape_essid(assoc_req->ssid, assoc_req->ssid_len), - assoc_req->channel, assoc_req->band, assoc_req->mode, - MAC_ARG(assoc_req->bssid), - assoc_req->secinfo.WPAenabled ? " WPA" : "", - assoc_req->secinfo.WPA2enabled ? " WPA2" : "", - assoc_req->secinfo.wep_enabled ? " WEP" : "", - assoc_req->secinfo.auth_mode); -} - - static int assoc_helper_essid(wlan_private *priv, struct assoc_request * assoc_req) { wlan_adapter *adapter = priv->adapter; int ret = 0; - struct bss_descriptor * bss; - int channel = -1; - - lbs_deb_enter(LBS_DEB_ASSOC); - - /* FIXME: take channel into account when picking SSIDs if a channel - * is set. - */ + int i; - if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) - channel = assoc_req->channel; + ENTER(); - lbs_deb_assoc("New SSID requested: '%s'\n", - escape_essid(assoc_req->ssid, assoc_req->ssid_len)); + lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid); if (assoc_req->mode == IW_MODE_INFRA) { if (adapter->prescan) { - libertas_send_specific_ssid_scan(priv, assoc_req->ssid, - assoc_req->ssid_len, 0); + libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1); } - bss = libertas_find_ssid_in_list(adapter, assoc_req->ssid, - assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel); - if (bss != NULL) { - lbs_deb_assoc("SSID found in scan list, associating\n"); - memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); - ret = wlan_associate(priv, assoc_req); + i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, + NULL, IW_MODE_INFRA); + if (i >= 0) { + lbs_pr_debug(1, + "SSID found in scan list ... associating...\n"); + + ret = wlan_associate(priv, &adapter->scantable[i]); + if (ret == 0) { + memcpy(&assoc_req->bssid, + &adapter->scantable[i].macaddress, + ETH_ALEN); + } } else { - lbs_deb_assoc("SSID not found; cannot associate\n"); + lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n", + assoc_req->ssid.ssid); } } else if (assoc_req->mode == IW_MODE_ADHOC) { /* Scan for the network, do not save previous results. Stale * scan data will cause us to join a non-existant adhoc network */ - libertas_send_specific_ssid_scan(priv, assoc_req->ssid, - assoc_req->ssid_len, 1); + libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 0); /* Search for the requested SSID in the scan table */ - bss = libertas_find_ssid_in_list(adapter, assoc_req->ssid, - assoc_req->ssid_len, NULL, IW_MODE_ADHOC, channel); - if (bss != NULL) { - lbs_deb_assoc("SSID found, will join\n"); - memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); - libertas_join_adhoc_network(priv, assoc_req); + i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL, + IW_MODE_ADHOC); + if (i >= 0) { + lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret); + libertas_join_adhoc_network(priv, &adapter->scantable[i]); } else { /* else send START command */ - lbs_deb_assoc("SSID not found, creating adhoc network\n"); - memcpy(&assoc_req->bss.ssid, &assoc_req->ssid, - IW_ESSID_MAX_SIZE); - assoc_req->bss.ssid_len = assoc_req->ssid_len; - libertas_start_adhoc_network(priv, assoc_req); + lbs_pr_debug(1, "SSID not found in list, so creating adhoc" + " with SSID '%s'\n", assoc_req->ssid.ssid); + libertas_start_adhoc_network(priv, &assoc_req->ssid); } + memcpy(&assoc_req->bssid, &adapter->current_addr, ETH_ALEN); } - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); + LEAVE(); return ret; } @@ -104,31 +74,33 @@ static int assoc_helper_bssid(wlan_private *priv, struct assoc_request * assoc_req) { wlan_adapter *adapter = priv->adapter; - int ret = 0; - struct bss_descriptor * bss; + int i, ret = 0; + + ENTER(); - lbs_deb_enter_args(LBS_DEB_ASSOC, "BSSID " MAC_FMT, + lbs_pr_debug(1, "ASSOC: WAP: BSSID = " MAC_FMT "\n", MAC_ARG(assoc_req->bssid)); /* Search for index position in list for requested MAC */ - bss = libertas_find_bssid_in_list(adapter, assoc_req->bssid, + i = libertas_find_BSSID_in_list(adapter, assoc_req->bssid, assoc_req->mode); - if (bss == NULL) { - lbs_deb_assoc("ASSOC: WAP: BSSID " MAC_FMT " not found, " + if (i < 0) { + lbs_pr_debug(1, "ASSOC: WAP: BSSID " MAC_FMT " not found, " "cannot associate.\n", MAC_ARG(assoc_req->bssid)); goto out; } - memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); if (assoc_req->mode == IW_MODE_INFRA) { - ret = wlan_associate(priv, assoc_req); - lbs_deb_assoc("ASSOC: wlan_associate(bssid) returned %d\n", ret); + ret = wlan_associate(priv, &adapter->scantable[i]); + lbs_pr_debug(1, "ASSOC: return from wlan_associate(bssd) was %d\n", ret); } else if (assoc_req->mode == IW_MODE_ADHOC) { - libertas_join_adhoc_network(priv, assoc_req); + libertas_join_adhoc_network(priv, &adapter->scantable[i]); } + memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid, + sizeof(struct WLAN_802_11_SSID)); out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); + LEAVE(); return ret; } @@ -141,12 +113,12 @@ static int assoc_helper_associate(wlan_private *priv, /* If we're given and 'any' BSSID, try associating based on SSID */ if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { - if (compare_ether_addr(bssid_any, assoc_req->bssid) - && compare_ether_addr(bssid_off, assoc_req->bssid)) { + if (memcmp(bssid_any, assoc_req->bssid, ETH_ALEN) + && memcmp(bssid_off, assoc_req->bssid, ETH_ALEN)) { ret = assoc_helper_bssid(priv, assoc_req); done = 1; if (ret) { - lbs_deb_assoc("ASSOC: bssid: ret = %d\n", ret); + lbs_pr_debug(1, "ASSOC: bssid: ret = %d\n", ret); } } } @@ -154,7 +126,7 @@ static int assoc_helper_associate(wlan_private *priv, if (!done && test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { ret = assoc_helper_essid(priv, assoc_req); if (ret) { - lbs_deb_assoc("ASSOC: bssid: ret = %d\n", ret); + lbs_pr_debug(1, "ASSOC: bssid: ret = %d\n", ret); } } @@ -168,10 +140,12 @@ static int assoc_helper_mode(wlan_private *priv, wlan_adapter *adapter = priv->adapter; int ret = 0; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); - if (assoc_req->mode == adapter->mode) - goto done; + if (assoc_req->mode == adapter->mode) { + LEAVE(); + return 0; + } if (assoc_req->mode == IW_MODE_INFRA) { if (adapter->psstate != PS_STATE_FULL_POWER) @@ -184,81 +158,9 @@ static int assoc_helper_mode(wlan_private *priv, cmd_802_11_snmp_mib, 0, cmd_option_waitforrsp, OID_802_11_INFRASTRUCTURE_MODE, - /* Shoot me now */ (void *) (size_t) assoc_req->mode); + (void *) (size_t) assoc_req->mode); -done: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - - -static int update_channel(wlan_private * priv) -{ - /* the channel in f/w could be out of sync, get the current channel */ - return libertas_prepare_and_send_command(priv, cmd_802_11_rf_channel, - cmd_opt_802_11_rf_channel_get, - cmd_option_waitforrsp, 0, NULL); -} - -void libertas_sync_channel(struct work_struct *work) -{ - wlan_private *priv = container_of(work, wlan_private, sync_channel); - - if (update_channel(priv) != 0) - lbs_pr_info("Channel synchronization failed."); -} - -static int assoc_helper_channel(wlan_private *priv, - struct assoc_request * assoc_req) -{ - wlan_adapter *adapter = priv->adapter; - int ret = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - ret = update_channel(priv); - if (ret < 0) { - lbs_deb_assoc("ASSOC: channel: error getting channel."); - } - - if (assoc_req->channel == adapter->curbssparams.channel) - goto done; - - lbs_deb_assoc("ASSOC: channel: %d -> %d\n", - adapter->curbssparams.channel, assoc_req->channel); - - ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_channel, - cmd_opt_802_11_rf_channel_set, - cmd_option_waitforrsp, 0, &assoc_req->channel); - if (ret < 0) { - lbs_deb_assoc("ASSOC: channel: error setting channel."); - } - - ret = update_channel(priv); - if (ret < 0) { - lbs_deb_assoc("ASSOC: channel: error getting channel."); - } - - if (assoc_req->channel != adapter->curbssparams.channel) { - lbs_deb_assoc("ASSOC: channel: failed to update channel to %d", - assoc_req->channel); - goto done; - } - - if ( assoc_req->secinfo.wep_enabled - && (assoc_req->wep_keys[0].len - || assoc_req->wep_keys[1].len - || assoc_req->wep_keys[2].len - || assoc_req->wep_keys[3].len)) { - /* Make sure WEP keys are re-sent to firmware */ - set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); - } - - /* Must restart/rejoin adhoc networks after channel change */ - set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); - -done: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); + LEAVE(); return ret; } @@ -270,7 +172,7 @@ static int assoc_helper_wep_keys(wlan_private *priv, int i; int ret = 0; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); /* Set or remove WEP keys */ if ( assoc_req->wep_keys[0].len @@ -314,7 +216,7 @@ static int assoc_helper_wep_keys(wlan_private *priv, mutex_unlock(&adapter->lock); out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); + LEAVE(); return ret; } @@ -324,24 +226,14 @@ static int assoc_helper_secinfo(wlan_private *priv, wlan_adapter *adapter = priv->adapter; int ret = 0; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); memcpy(&adapter->secinfo, &assoc_req->secinfo, sizeof(struct wlan_802_11_security)); ret = libertas_set_mac_packet_filter(priv); - if (ret) - goto out; - /* enable/disable RSN */ - ret = libertas_prepare_and_send_command(priv, - cmd_802_11_enable_rsn, - cmd_act_set, - cmd_option_waitforrsp, - 0, assoc_req); - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); + LEAVE(); return ret; } @@ -351,7 +243,16 @@ static int assoc_helper_wpa_keys(wlan_private *priv, { int ret = 0; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); + + /* enable/Disable RSN */ + ret = libertas_prepare_and_send_command(priv, + cmd_802_11_enable_rsn, + cmd_act_set, + cmd_option_waitforrsp, + 0, assoc_req); + if (ret) + goto out; ret = libertas_prepare_and_send_command(priv, cmd_802_11_key_material, @@ -359,7 +260,8 @@ static int assoc_helper_wpa_keys(wlan_private *priv, cmd_option_waitforrsp, 0, assoc_req); - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); +out: + LEAVE(); return ret; } @@ -370,7 +272,7 @@ static int assoc_helper_wpa_ie(wlan_private *priv, wlan_adapter *adapter = priv->adapter; int ret = 0; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { memcpy(&adapter->wpa_ie, &assoc_req->wpa_ie, assoc_req->wpa_ie_len); @@ -380,7 +282,7 @@ static int assoc_helper_wpa_ie(wlan_private *priv, adapter->wpa_ie_len = 0; } - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); + LEAVE(); return ret; } @@ -392,30 +294,25 @@ static int should_deauth_infrastructure(wlan_adapter *adapter, return 0; if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { - lbs_deb_assoc("Deauthenticating due to new SSID in " + lbs_pr_debug(1, "Deauthenticating due to new SSID in " " configuration request.\n"); return 1; } if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { if (adapter->secinfo.auth_mode != assoc_req->secinfo.auth_mode) { - lbs_deb_assoc("Deauthenticating due to updated security " + lbs_pr_debug(1, "Deauthenticating due to updated security " "info in configuration request.\n"); return 1; } } if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { - lbs_deb_assoc("Deauthenticating due to new BSSID in " + lbs_pr_debug(1, "Deauthenticating due to new BSSID in " " configuration request.\n"); return 1; } - if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { - lbs_deb_assoc("Deauthenticating due to channel switch.\n"); - return 1; - } - /* FIXME: deal with 'auto' mode somehow */ if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { if (assoc_req->mode != IW_MODE_INFRA) @@ -432,9 +329,10 @@ static int should_stop_adhoc(wlan_adapter *adapter, if (adapter->connect_status != libertas_connected) return 0; - if (libertas_ssid_cmp(adapter->curbssparams.ssid, - adapter->curbssparams.ssid_len, - assoc_req->ssid, assoc_req->ssid_len) != 0) + if (adapter->curbssparams.ssid.ssidlength != assoc_req->ssid.ssidlength) + return 1; + if (memcmp(adapter->curbssparams.ssid.ssid, assoc_req->ssid.ssid, + adapter->curbssparams.ssid.ssidlength)) return 1; /* FIXME: deal with 'auto' mode somehow */ @@ -443,16 +341,11 @@ static int should_stop_adhoc(wlan_adapter *adapter, return 1; } - if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { - if (assoc_req->channel != adapter->curbssparams.channel) - return 1; - } - return 0; } -void libertas_association_worker(struct work_struct *work) +void wlan_association_worker(struct work_struct *work) { wlan_private *priv = container_of(work, wlan_private, assoc_work.work); wlan_adapter *adapter = priv->adapter; @@ -460,38 +353,40 @@ void libertas_association_worker(struct work_struct *work) int ret = 0; int find_any_ssid = 0; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); mutex_lock(&adapter->lock); - assoc_req = adapter->pending_assoc_req; - adapter->pending_assoc_req = NULL; - adapter->in_progress_assoc_req = assoc_req; + assoc_req = adapter->assoc_req; + adapter->assoc_req = NULL; mutex_unlock(&adapter->lock); - if (!assoc_req) - goto done; + if (!assoc_req) { + LEAVE(); + return; + } - print_assoc_req(__func__, assoc_req); + lbs_pr_debug(1, "ASSOC: starting new association request: flags = 0x%lX\n", + assoc_req->flags); /* If 'any' SSID was specified, find an SSID to associate with */ if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags) - && !assoc_req->ssid_len) + && !assoc_req->ssid.ssidlength) find_any_ssid = 1; /* But don't use 'any' SSID if there's a valid locked BSSID to use */ if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { - if (compare_ether_addr(assoc_req->bssid, bssid_any) - && compare_ether_addr(assoc_req->bssid, bssid_off)) + if (memcmp(&assoc_req->bssid, bssid_any, ETH_ALEN) + && memcmp(&assoc_req->bssid, bssid_off, ETH_ALEN)) find_any_ssid = 0; } if (find_any_ssid) { u8 new_mode; - ret = libertas_find_best_network_ssid(priv, assoc_req->ssid, - &assoc_req->ssid_len, assoc_req->mode, &new_mode); + ret = libertas_find_best_network_SSID(priv, &assoc_req->ssid, + assoc_req->mode, &new_mode); if (ret) { - lbs_deb_assoc("Could not find best network\n"); + lbs_pr_debug(1, "Could not find best network\n"); ret = -ENETUNREACH; goto out; } @@ -511,7 +406,7 @@ void libertas_association_worker(struct work_struct *work) if (should_deauth_infrastructure(adapter, assoc_req)) { ret = libertas_send_deauthentication(priv); if (ret) { - lbs_deb_assoc("Deauthentication due to new " + lbs_pr_debug(1, "Deauthentication due to new " "configuration request failed: %d\n", ret); } @@ -520,7 +415,7 @@ void libertas_association_worker(struct work_struct *work) if (should_stop_adhoc(adapter, assoc_req)) { ret = libertas_stop_adhoc_network(priv); if (ret) { - lbs_deb_assoc("Teardown of AdHoc network due to " + lbs_pr_debug(1, "Teardown of AdHoc network due to " "new configuration request failed: %d\n", ret); } @@ -532,16 +427,7 @@ void libertas_association_worker(struct work_struct *work) if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { ret = assoc_helper_mode(priv, assoc_req); if (ret) { -lbs_deb_assoc("ASSOC(:%d) mode: ret = %d\n", __LINE__, ret); - goto out; - } - } - - if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { - ret = assoc_helper_channel(priv, assoc_req); - if (ret) { - lbs_deb_assoc("ASSOC(:%d) channel: ret = %d\n", - __LINE__, ret); +lbs_pr_debug(1, "ASSOC(:%d) mode: ret = %d\n", __LINE__, ret); goto out; } } @@ -550,7 +436,7 @@ lbs_deb_assoc("ASSOC(:%d) mode: ret = %d\n", __LINE__, ret); || test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) { ret = assoc_helper_wep_keys(priv, assoc_req); if (ret) { -lbs_deb_assoc("ASSOC(:%d) wep_keys: ret = %d\n", __LINE__, ret); +lbs_pr_debug(1, "ASSOC(:%d) wep_keys: ret = %d\n", __LINE__, ret); goto out; } } @@ -558,7 +444,7 @@ lbs_deb_assoc("ASSOC(:%d) wep_keys: ret = %d\n", __LINE__, ret); if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { ret = assoc_helper_secinfo(priv, assoc_req); if (ret) { -lbs_deb_assoc("ASSOC(:%d) secinfo: ret = %d\n", __LINE__, ret); +lbs_pr_debug(1, "ASSOC(:%d) secinfo: ret = %d\n", __LINE__, ret); goto out; } } @@ -566,7 +452,7 @@ lbs_deb_assoc("ASSOC(:%d) secinfo: ret = %d\n", __LINE__, ret); if (test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) { ret = assoc_helper_wpa_ie(priv, assoc_req); if (ret) { -lbs_deb_assoc("ASSOC(:%d) wpa_ie: ret = %d\n", __LINE__, ret); +lbs_pr_debug(1, "ASSOC(:%d) wpa_ie: ret = %d\n", __LINE__, ret); goto out; } } @@ -575,7 +461,7 @@ lbs_deb_assoc("ASSOC(:%d) wpa_ie: ret = %d\n", __LINE__, ret); || test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { ret = assoc_helper_wpa_keys(priv, assoc_req); if (ret) { -lbs_deb_assoc("ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret); +lbs_pr_debug(1, "ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret); goto out; } } @@ -589,23 +475,21 @@ lbs_deb_assoc("ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret); ret = assoc_helper_associate(priv, assoc_req); if (ret) { - lbs_deb_assoc("ASSOC: association attempt unsuccessful: %d\n", + lbs_pr_debug(1, "ASSOC: association attempt unsuccessful: %d\n", ret); success = 0; } if (adapter->connect_status != libertas_connected) { - lbs_deb_assoc("ASSOC: assoication attempt unsuccessful, " + lbs_pr_debug(1, "ASSOC: assoication attempt unsuccessful, " "not connected.\n"); success = 0; } if (success) { - lbs_deb_assoc("ASSOC: association attempt successful. " + lbs_pr_debug(1, "ASSOC: association attempt successful. " "Associated to '%s' (" MAC_FMT ")\n", - escape_essid(adapter->curbssparams.ssid, - adapter->curbssparams.ssid_len), - MAC_ARG(adapter->curbssparams.bssid)); + assoc_req->ssid.ssid, MAC_ARG(assoc_req->bssid)); libertas_prepare_and_send_command(priv, cmd_802_11_rssi, 0, cmd_option_waitforrsp, 0, NULL); @@ -614,23 +498,18 @@ lbs_deb_assoc("ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret); cmd_802_11_get_log, 0, cmd_option_waitforrsp, 0, NULL); } else { + ret = -1; } } out: if (ret) { - lbs_deb_assoc("ASSOC: reconfiguration attempt unsuccessful: %d\n", + lbs_pr_debug(1, "ASSOC: reconfiguration attempt unsuccessful: %d\n", ret); } - - mutex_lock(&adapter->lock); - adapter->in_progress_assoc_req = NULL; - mutex_unlock(&adapter->lock); kfree(assoc_req); - -done: - lbs_deb_leave(LBS_DEB_ASSOC); + LEAVE(); } @@ -641,10 +520,9 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter) { struct assoc_request * assoc_req; - if (!adapter->pending_assoc_req) { - adapter->pending_assoc_req = kzalloc(sizeof(struct assoc_request), - GFP_KERNEL); - if (!adapter->pending_assoc_req) { + if (!adapter->assoc_req) { + adapter->assoc_req = kzalloc(sizeof(struct assoc_request), GFP_KERNEL); + if (!adapter->assoc_req) { lbs_pr_info("Not enough memory to allocate association" " request!\n"); return NULL; @@ -654,19 +532,15 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter) /* Copy current configuration attributes to the association request, * but don't overwrite any that are already set. */ - assoc_req = adapter->pending_assoc_req; + assoc_req = adapter->assoc_req; if (!test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { - memcpy(&assoc_req->ssid, &adapter->curbssparams.ssid, - IW_ESSID_MAX_SIZE); - assoc_req->ssid_len = adapter->curbssparams.ssid_len; + memcpy(&assoc_req->ssid, adapter->curbssparams.ssid.ssid, + adapter->curbssparams.ssid.ssidlength); } if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) assoc_req->channel = adapter->curbssparams.channel; - if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags)) - assoc_req->band = adapter->curbssparams.band; - if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) assoc_req->mode = adapter->mode; @@ -707,7 +581,7 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter) assoc_req->wpa_ie_len = adapter->wpa_ie_len; } - print_assoc_req(__func__, assoc_req); - return assoc_req; } + + diff --git a/trunk/drivers/net/wireless/libertas/assoc.h b/trunk/drivers/net/wireless/libertas/assoc.h index 5e9c31f0932b..2ffd82d99b34 100644 --- a/trunk/drivers/net/wireless/libertas/assoc.h +++ b/trunk/drivers/net/wireless/libertas/assoc.h @@ -5,12 +5,10 @@ #include "dev.h" -void libertas_association_worker(struct work_struct *work); +void wlan_association_worker(struct work_struct *work); struct assoc_request * wlan_get_association_request(wlan_adapter *adapter); -void libertas_sync_channel(struct work_struct *work); - #define ASSOC_DELAY (HZ / 2) static inline void wlan_postpone_association_work(wlan_private *priv) { @@ -23,9 +21,9 @@ static inline void wlan_postpone_association_work(wlan_private *priv) static inline void wlan_cancel_association_work(wlan_private *priv) { cancel_delayed_work(&priv->assoc_work); - if (priv->adapter->pending_assoc_req) { - kfree(priv->adapter->pending_assoc_req); - priv->adapter->pending_assoc_req = NULL; + if (priv->adapter->assoc_req) { + kfree(priv->adapter->assoc_req); + priv->adapter->assoc_req = NULL; } } diff --git a/trunk/drivers/net/wireless/libertas/cmd.c b/trunk/drivers/net/wireless/libertas/cmd.c index 124e029f1bf4..de9cb46a70ff 100644 --- a/trunk/drivers/net/wireless/libertas/cmd.c +++ b/trunk/drivers/net/wireless/libertas/cmd.c @@ -6,6 +6,7 @@ #include #include "host.h" #include "hostcmd.h" +#include "sbi.h" #include "decl.h" #include "defs.h" #include "dev.h" @@ -25,11 +26,13 @@ static u16 commands_allowed_in_ps[] = { * @param command the command ID * @return TRUE or FALSE */ -static u8 is_command_allowed_in_ps(__le16 command) +static u8 is_command_allowed_in_ps(u16 command) { + int count = sizeof(commands_allowed_in_ps) + / sizeof(commands_allowed_in_ps[0]); int i; - for (i = 0; i < ARRAY_SIZE(commands_allowed_in_ps); i++) { + for (i = 0; i < count; i++) { if (command == cpu_to_le16(commands_allowed_in_ps[i])) return 1; } @@ -41,13 +44,14 @@ static int wlan_cmd_hw_spec(wlan_private * priv, struct cmd_ds_command *cmd) { struct cmd_ds_get_hw_spec *hwspec = &cmd->params.hwspec; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); cmd->command = cpu_to_le16(cmd_get_hw_spec); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_get_hw_spec) + S_DS_GEN); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_get_hw_spec) + S_DS_GEN); memcpy(hwspec->permanentaddr, priv->adapter->current_addr, ETH_ALEN); - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -56,19 +60,21 @@ static int wlan_cmd_802_11_ps_mode(wlan_private * priv, u16 cmd_action) { struct cmd_ds_802_11_ps_mode *psm = &cmd->params.psmode; + u16 action = cmd_action; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); cmd->command = cpu_to_le16(cmd_802_11_ps_mode); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ps_mode) + - S_DS_GEN); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_ps_mode) + + S_DS_GEN); psm->action = cpu_to_le16(cmd_action); psm->multipledtim = 0; - switch (cmd_action) { + switch (action) { case cmd_subcmd_enter_ps: - lbs_deb_cmd("PS command:" "SubCode- Enter PS\n"); - lbs_deb_cmd("locallisteninterval = %d\n", + lbs_pr_debug(1, "PS command:" "SubCode- Enter PS\n"); + lbs_pr_debug(1, "locallisteninterval = %d\n", adapter->locallisteninterval); psm->locallisteninterval = @@ -80,18 +86,18 @@ static int wlan_cmd_802_11_ps_mode(wlan_private * priv, break; case cmd_subcmd_exit_ps: - lbs_deb_cmd("PS command:" "SubCode- Exit PS\n"); + lbs_pr_debug(1, "PS command:" "SubCode- Exit PS\n"); break; case cmd_subcmd_sleep_confirmed: - lbs_deb_cmd("PS command: SubCode- sleep confirm\n"); + lbs_pr_debug(1, "PS command: SubCode- sleep confirm\n"); break; default: break; } - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -109,7 +115,8 @@ static int wlan_cmd_802_11_inactivity_timeout(wlan_private * priv, cmd->params.inactivity_timeout.action = cpu_to_le16(cmd_action); if (cmd_action) - cmd->params.inactivity_timeout.timeout = cpu_to_le16(*timeout); + cmd->params.inactivity_timeout.timeout = + cpu_to_le16(*timeout); else cmd->params.inactivity_timeout.timeout = 0; @@ -123,10 +130,11 @@ static int wlan_cmd_802_11_sleep_params(wlan_private * priv, wlan_adapter *adapter = priv->adapter; struct cmd_ds_802_11_sleep_params *sp = &cmd->params.sleep_params; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - cmd->size = cpu_to_le16((sizeof(struct cmd_ds_802_11_sleep_params)) + - S_DS_GEN); + cmd->size = + cpu_to_le16((sizeof(struct cmd_ds_802_11_sleep_params)) + + S_DS_GEN); cmd->command = cpu_to_le16(cmd_802_11_sleep_params); if (cmd_action == cmd_act_get) { @@ -143,7 +151,7 @@ static int wlan_cmd_802_11_sleep_params(wlan_private * priv, sp->reserved = cpu_to_le16(adapter->sp.sp_reserved); } - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -157,16 +165,17 @@ static int wlan_cmd_802_11_set_wep(wlan_private * priv, int ret = 0; struct assoc_request * assoc_req = pdata_buf; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); cmd->command = cpu_to_le16(cmd_802_11_set_wep); - cmd->size = cpu_to_le16(sizeof(*wep) + S_DS_GEN); + cmd->size = cpu_to_le16((sizeof(struct cmd_ds_802_11_set_wep)) + + S_DS_GEN); if (cmd_act == cmd_act_add) { int i; if (!assoc_req) { - lbs_deb_cmd("Invalid association request!"); + lbs_pr_debug(1, "Invalid association request!"); ret = -1; goto done; } @@ -174,10 +183,11 @@ static int wlan_cmd_802_11_set_wep(wlan_private * priv, wep->action = cpu_to_le16(cmd_act_add); /* default tx key index */ - wep->keyindex = cpu_to_le16((u16)(assoc_req->wep_tx_keyidx & - (u32)cmd_WEP_KEY_INDEX_MASK)); + wep->keyindex = cpu_to_le16((u16) + (assoc_req->wep_tx_keyidx & + (u32)cmd_WEP_KEY_INDEX_MASK)); - lbs_deb_cmd("Tx key Index: %u\n", le16_to_cpu(wep->keyindex)); + lbs_pr_debug(1, "Tx key Index: %u\n", wep->keyindex); /* Copy key types and material to host command structure */ for (i = 0; i < 4; i++) { @@ -185,21 +195,19 @@ static int wlan_cmd_802_11_set_wep(wlan_private * priv, switch (pkey->len) { case KEY_LEN_WEP_40: - wep->keytype[i] = - cpu_to_le16(cmd_type_wep_40_bit); + wep->keytype[i] = cmd_type_wep_40_bit; memmove(&wep->keymaterial[i], pkey->key, pkey->len); break; case KEY_LEN_WEP_104: - wep->keytype[i] = - cpu_to_le16(cmd_type_wep_104_bit); + wep->keytype[i] = cmd_type_wep_104_bit; memmove(&wep->keymaterial[i], pkey->key, pkey->len); break; case 0: break; default: - lbs_deb_cmd("Invalid WEP key %d length of %d\n", + lbs_pr_debug(1, "Invalid WEP key %d length of %d\n", i, pkey->len); ret = -1; goto done; @@ -211,37 +219,36 @@ static int wlan_cmd_802_11_set_wep(wlan_private * priv, wep->action = cpu_to_le16(cmd_act_remove); /* default tx key index */ - wep->keyindex = cpu_to_le16((u16)(adapter->wep_tx_keyidx & - (u32)cmd_WEP_KEY_INDEX_MASK)); + wep->keyindex = cpu_to_le16((u16) + (adapter->wep_tx_keyidx & + (u32)cmd_WEP_KEY_INDEX_MASK)); } ret = 0; done: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); + LEAVE(); return ret; } static int wlan_cmd_802_11_enable_rsn(wlan_private * priv, struct cmd_ds_command *cmd, - u16 cmd_action, - void * pdata_buf) + u16 cmd_action) { struct cmd_ds_802_11_enable_rsn *penableRSN = &cmd->params.enbrsn; - struct assoc_request * assoc_req = pdata_buf; - - lbs_deb_enter(LBS_DEB_CMD); + wlan_adapter *adapter = priv->adapter; cmd->command = cpu_to_le16(cmd_802_11_enable_rsn); - cmd->size = cpu_to_le16(sizeof(*penableRSN) + S_DS_GEN); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_enable_rsn) + + S_DS_GEN); penableRSN->action = cpu_to_le16(cmd_action); - if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { + if (adapter->secinfo.WPAenabled || adapter->secinfo.WPA2enabled) { penableRSN->enable = cpu_to_le16(cmd_enable_rsn); } else { penableRSN->enable = cpu_to_le16(cmd_disable_rsn); } - lbs_deb_leave(LBS_DEB_CMD); return 0; } @@ -252,12 +259,14 @@ static void set_one_wpa_key(struct MrvlIEtype_keyParamSet * pkeyparamset, pkeyparamset->keytypeid = cpu_to_le16(pkey->type); if (pkey->flags & KEY_INFO_WPA_ENABLED) { - pkeyparamset->keyinfo |= cpu_to_le16(KEY_INFO_WPA_ENABLED); + pkeyparamset->keyinfo = cpu_to_le16(KEY_INFO_WPA_ENABLED); + } else { + pkeyparamset->keyinfo = cpu_to_le16(!KEY_INFO_WPA_ENABLED); } + if (pkey->flags & KEY_INFO_WPA_UNICAST) { pkeyparamset->keyinfo |= cpu_to_le16(KEY_INFO_WPA_UNICAST); - } - if (pkey->flags & KEY_INFO_WPA_MCAST) { + } else if (pkey->flags & KEY_INFO_WPA_MCAST) { pkeyparamset->keyinfo |= cpu_to_le16(KEY_INFO_WPA_MCAST); } @@ -275,45 +284,46 @@ static int wlan_cmd_802_11_key_material(wlan_private * priv, u16 cmd_action, u32 cmd_oid, void *pdata_buf) { + wlan_adapter *adapter = priv->adapter; struct cmd_ds_802_11_key_material *pkeymaterial = &cmd->params.keymaterial; - struct assoc_request * assoc_req = pdata_buf; int ret = 0; int index = 0; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); cmd->command = cpu_to_le16(cmd_802_11_key_material); pkeymaterial->action = cpu_to_le16(cmd_action); if (cmd_action == cmd_act_get) { - cmd->size = cpu_to_le16(S_DS_GEN + sizeof (pkeymaterial->action)); + cmd->size = cpu_to_le16( S_DS_GEN + + sizeof (pkeymaterial->action)); ret = 0; goto done; } memset(&pkeymaterial->keyParamSet, 0, sizeof(pkeymaterial->keyParamSet)); - if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { + if (adapter->wpa_unicast_key.len) { set_one_wpa_key(&pkeymaterial->keyParamSet[index], - &assoc_req->wpa_unicast_key); + &adapter->wpa_unicast_key); index++; } - if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { + if (adapter->wpa_mcast_key.len) { set_one_wpa_key(&pkeymaterial->keyParamSet[index], - &assoc_req->wpa_mcast_key); + &adapter->wpa_mcast_key); index++; } cmd->size = cpu_to_le16( S_DS_GEN - + sizeof (pkeymaterial->action) - + (index * sizeof(struct MrvlIEtype_keyParamSet))); + + sizeof (pkeymaterial->action) + + index * sizeof(struct MrvlIEtype_keyParamSet)); ret = 0; done: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); + LEAVE(); return ret; } @@ -344,7 +354,8 @@ static int wlan_cmd_802_11_get_stat(wlan_private * priv, { cmd->command = cpu_to_le16(cmd_802_11_get_stat); cmd->size = - cpu_to_le16(sizeof(struct cmd_ds_802_11_get_stat) + S_DS_GEN); + cpu_to_le16(sizeof(struct cmd_ds_802_11_get_stat) + + S_DS_GEN); return 0; } @@ -358,12 +369,14 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv, wlan_adapter *adapter = priv->adapter; u8 ucTemp; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - lbs_deb_cmd("SNMP_CMD: cmd_oid = 0x%x\n", cmd_oid); + lbs_pr_debug(1, "SNMP_CMD: cmd_oid = 0x%x\n", cmd_oid); cmd->command = cpu_to_le16(cmd_802_11_snmp_mib); - cmd->size = cpu_to_le16(sizeof(*pSNMPMIB) + S_DS_GEN); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_snmp_mib) + + S_DS_GEN); switch (cmd_oid) { case OID_802_11_INFRASTRUCTURE_MODE: @@ -394,7 +407,7 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv, pSNMPMIB->querytype = cmd_act_set; pSNMPMIB->bufsize = sizeof(u16); ulTemp = *(u32 *)pdata_buf; - *((__le16 *)(pSNMPMIB->value)) = + *((unsigned short *)(pSNMPMIB->value)) = cpu_to_le16((u16) ulTemp); } break; @@ -407,12 +420,15 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv, pSNMPMIB->oid = cpu_to_le16((u16) fragthresh_i); if (cmd_action == cmd_act_get) { - pSNMPMIB->querytype = cpu_to_le16(cmd_act_get); + pSNMPMIB->querytype = + cpu_to_le16(cmd_act_get); } else if (cmd_action == cmd_act_set) { - pSNMPMIB->querytype = cpu_to_le16(cmd_act_set); - pSNMPMIB->bufsize = cpu_to_le16(sizeof(u16)); + pSNMPMIB->querytype = + cpu_to_le16(cmd_act_set); + pSNMPMIB->bufsize = + cpu_to_le16(sizeof(u16)); ulTemp = *((u32 *) pdata_buf); - *((__le16 *)(pSNMPMIB->value)) = + *((unsigned short *)(pSNMPMIB->value)) = cpu_to_le16((u16) ulTemp); } @@ -427,12 +443,16 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv, pSNMPMIB->oid = le16_to_cpu((u16) rtsthresh_i); if (cmd_action == cmd_act_get) { - pSNMPMIB->querytype = cpu_to_le16(cmd_act_get); + pSNMPMIB->querytype = + cpu_to_le16(cmd_act_get); } else if (cmd_action == cmd_act_set) { - pSNMPMIB->querytype = cpu_to_le16(cmd_act_set); - pSNMPMIB->bufsize = cpu_to_le16(sizeof(u16)); - ulTemp = *((u32 *)pdata_buf); - *(__le16 *)(pSNMPMIB->value) = + pSNMPMIB->querytype = + cpu_to_le16(cmd_act_set); + pSNMPMIB->bufsize = + cpu_to_le16(sizeof(u16)); + ulTemp = *((u32 *) + pdata_buf); + *(unsigned short *)(pSNMPMIB->value) = cpu_to_le16((u16) ulTemp); } @@ -442,11 +462,13 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv, pSNMPMIB->oid = cpu_to_le16((u16) short_retrylim_i); if (cmd_action == cmd_act_get) { - pSNMPMIB->querytype = cpu_to_le16(cmd_act_get); + pSNMPMIB->querytype = + cpu_to_le16(cmd_act_get); } else if (cmd_action == cmd_act_set) { - pSNMPMIB->querytype = cpu_to_le16(cmd_act_set); + pSNMPMIB->querytype = + cpu_to_le16(cmd_act_set); pSNMPMIB->bufsize = cpu_to_le16(sizeof(u16)); - *((__le16 *)(pSNMPMIB->value)) = + *((unsigned short *)(pSNMPMIB->value)) = cpu_to_le16((u16) adapter->txretrycount); } @@ -455,18 +477,16 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv, break; } - lbs_deb_cmd( + lbs_pr_debug(1, "SNMP_CMD: command=0x%x, size=0x%x, seqnum=0x%x, result=0x%x\n", - le16_to_cpu(cmd->command), le16_to_cpu(cmd->size), - le16_to_cpu(cmd->seqnum), le16_to_cpu(cmd->result)); + cmd->command, cmd->size, cmd->seqnum, cmd->result); - lbs_deb_cmd( + lbs_pr_debug(1, "SNMP_CMD: action=0x%x, oid=0x%x, oidsize=0x%x, value=0x%x\n", - le16_to_cpu(pSNMPMIB->querytype), le16_to_cpu(pSNMPMIB->oid), - le16_to_cpu(pSNMPMIB->bufsize), - le16_to_cpu(*(__le16 *) pSNMPMIB->value)); + pSNMPMIB->querytype, pSNMPMIB->oid, pSNMPMIB->bufsize, + *(u16 *) pSNMPMIB->value); - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -475,9 +495,10 @@ static int wlan_cmd_802_11_radio_control(wlan_private * priv, int cmd_action) { wlan_adapter *adapter = priv->adapter; - struct cmd_ds_802_11_radio_control *pradiocontrol = &cmd->params.radio; + struct cmd_ds_802_11_radio_control *pradiocontrol = + &cmd->params.radio; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); cmd->size = cpu_to_le16((sizeof(struct cmd_ds_802_11_radio_control)) + @@ -506,7 +527,7 @@ static int wlan_cmd_802_11_radio_control(wlan_private * priv, else pradiocontrol->control &= cpu_to_le16(~TURN_ON_RF); - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -517,16 +538,16 @@ static int wlan_cmd_802_11_rf_tx_power(wlan_private * priv, struct cmd_ds_802_11_rf_tx_power *prtp = &cmd->params.txp; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); cmd->size = - cpu_to_le16((sizeof(struct cmd_ds_802_11_rf_tx_power)) + S_DS_GEN); + cpu_to_le16((sizeof(struct cmd_ds_802_11_rf_tx_power)) + + S_DS_GEN); cmd->command = cpu_to_le16(cmd_802_11_rf_tx_power); - prtp->action = cpu_to_le16(cmd_action); + prtp->action = cmd_action; - lbs_deb_cmd("RF_TX_POWER_CMD: size:%d cmd:0x%x Act:%d\n", - le16_to_cpu(cmd->size), le16_to_cpu(cmd->command), - le16_to_cpu(prtp->action)); + lbs_pr_debug(1, "RF_TX_POWER_CMD: size:%d cmd:0x%x Act:%d\n", cmd->size, + cmd->command, prtp->action); switch (cmd_action) { case cmd_act_tx_power_opt_get: @@ -536,12 +557,14 @@ static int wlan_cmd_802_11_rf_tx_power(wlan_private * priv, case cmd_act_tx_power_opt_set_high: prtp->action = cpu_to_le16(cmd_act_set); - prtp->currentlevel = cpu_to_le16(cmd_act_tx_power_index_high); + prtp->currentlevel = + cpu_to_le16(cmd_act_tx_power_index_high); break; case cmd_act_tx_power_opt_set_mid: prtp->action = cpu_to_le16(cmd_act_set); - prtp->currentlevel = cpu_to_le16(cmd_act_tx_power_index_mid); + prtp->currentlevel = + cpu_to_le16(cmd_act_tx_power_index_mid); break; case cmd_act_tx_power_opt_set_low: @@ -549,8 +572,7 @@ static int wlan_cmd_802_11_rf_tx_power(wlan_private * priv, prtp->currentlevel = cpu_to_le16(*((u16 *) pdata_buf)); break; } - - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -561,12 +583,15 @@ static int wlan_cmd_802_11_rf_antenna(wlan_private * priv, struct cmd_ds_802_11_rf_antenna *rant = &cmd->params.rant; cmd->command = cpu_to_le16(cmd_802_11_rf_antenna); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rf_antenna) + - S_DS_GEN); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_rf_antenna) + + S_DS_GEN); rant->action = cpu_to_le16(cmd_action); - if ((cmd_action == cmd_act_set_rx) || (cmd_action == cmd_act_set_tx)) { - rant->antennamode = cpu_to_le16((u16) (*(u32 *) pdata_buf)); + if ((cmd_action == cmd_act_set_rx) || + (cmd_action == cmd_act_set_tx)) { + rant->antennamode = + cpu_to_le16((u16) (*(u32 *) pdata_buf)); } return 0; @@ -585,13 +610,13 @@ static int wlan_cmd_802_11_rate_adapt_rateset(wlan_private * priv, + S_DS_GEN); cmd->command = cpu_to_le16(cmd_802_11_rate_adapt_rateset); - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - rateadapt->action = cpu_to_le16(cmd_action); - rateadapt->enablehwauto = cpu_to_le16(adapter->enablehwauto); - rateadapt->bitmap = cpu_to_le16(adapter->ratebitmap); + rateadapt->action = cmd_action; + rateadapt->enablehwauto = adapter->enablehwauto; + rateadapt->bitmap = adapter->ratebitmap; - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -601,10 +626,12 @@ static int wlan_cmd_802_11_data_rate(wlan_private * priv, { struct cmd_ds_802_11_data_rate *pdatarate = &cmd->params.drate; wlan_adapter *adapter = priv->adapter; + u16 action = cmd_action; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_data_rate) + + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_data_rate) + S_DS_GEN); cmd->command = cpu_to_le16(cmd_802_11_data_rate); @@ -613,15 +640,15 @@ static int wlan_cmd_802_11_data_rate(wlan_private * priv, pdatarate->action = cpu_to_le16(cmd_action); - if (cmd_action == cmd_act_set_tx_fix_rate) { + if (action == cmd_act_set_tx_fix_rate) { pdatarate->datarate[0] = libertas_data_rate_to_index(adapter->datarate); - lbs_deb_cmd("Setting FW for fixed rate 0x%02X\n", + lbs_pr_debug(1, "Setting FW for fixed rate 0x%02X\n", adapter->datarate); - } else if (cmd_action == cmd_act_set_tx_auto) { - lbs_deb_cmd("Setting FW for AUTO rate\n"); + } else if (action == cmd_act_set_tx_auto) { + lbs_pr_debug(1, "Setting FW for AUTO rate\n"); } - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -632,7 +659,8 @@ static int wlan_cmd_mac_multicast_adr(wlan_private * priv, struct cmd_ds_mac_multicast_adr *pMCastAdr = &cmd->params.madr; wlan_adapter *adapter = priv->adapter; - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_mac_multicast_adr) + + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_mac_multicast_adr) + S_DS_GEN); cmd->command = cpu_to_le16(cmd_mac_multicast_adr); @@ -652,8 +680,8 @@ static int wlan_cmd_802_11_rf_channel(wlan_private * priv, struct cmd_ds_802_11_rf_channel *rfchan = &cmd->params.rfchannel; cmd->command = cpu_to_le16(cmd_802_11_rf_channel); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rf_channel) + - S_DS_GEN); + cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rf_channel) + + S_DS_GEN); if (option == cmd_opt_802_11_rf_channel_set) { rfchan->currentchannel = cpu_to_le16(*((u16 *) pdata_buf)); @@ -670,8 +698,9 @@ static int wlan_cmd_802_11_rssi(wlan_private * priv, wlan_adapter *adapter = priv->adapter; cmd->command = cpu_to_le16(cmd_802_11_rssi); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rssi) + S_DS_GEN); - cmd->params.rssi.N = cpu_to_le16(priv->adapter->bcn_avg_factor); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_rssi) + S_DS_GEN); + cmd->params.rssi.N = priv->adapter->bcn_avg_factor; /* reset Beacon SNR/NF/RSSI values */ adapter->SNR[TYPE_BEACON][TYPE_NOAVG] = 0; @@ -690,7 +719,7 @@ static int wlan_cmd_reg_access(wlan_private * priv, { struct wlan_offset_value *offval; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); offval = (struct wlan_offset_value *)pdata_buf; @@ -700,8 +729,9 @@ static int wlan_cmd_reg_access(wlan_private * priv, struct cmd_ds_mac_reg_access *macreg; cmdptr->size = - cpu_to_le16(sizeof (struct cmd_ds_mac_reg_access) - + S_DS_GEN); + cpu_to_le16(sizeof + (struct cmd_ds_mac_reg_access) + + S_DS_GEN); macreg = (struct cmd_ds_mac_reg_access *)&cmdptr->params. macreg; @@ -755,7 +785,7 @@ static int wlan_cmd_reg_access(wlan_private * priv, break; } - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -766,7 +796,8 @@ static int wlan_cmd_802_11_mac_address(wlan_private * priv, wlan_adapter *adapter = priv->adapter; cmd->command = cpu_to_le16(cmd_802_11_mac_address); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_mac_address) + + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_mac_address) + S_DS_GEN); cmd->result = 0; @@ -787,11 +818,12 @@ static int wlan_cmd_802_11_eeprom_access(wlan_private * priv, { struct wlan_ioctl_regrdwr *ea = pdata_buf; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); cmd->command = cpu_to_le16(cmd_802_11_eeprom_access); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_eeprom_access) + - S_DS_GEN); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_eeprom_access) + + S_DS_GEN); cmd->result = 0; cmd->params.rdeeprom.action = cpu_to_le16(ea->action); @@ -807,10 +839,11 @@ static int wlan_cmd_bt_access(wlan_private * priv, u16 cmd_action, void *pdata_buf) { struct cmd_ds_bt_access *bt_access = &cmd->params.bt; - lbs_deb_cmd("BT CMD(%d)\n", cmd_action); + lbs_pr_debug(1, "BT CMD(%d)\n", cmd_action); cmd->command = cpu_to_le16(cmd_bt_access); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_bt_access) + S_DS_GEN); + cmd->size = cpu_to_le16(sizeof(struct cmd_ds_bt_access) + + S_DS_GEN); cmd->result = 0; bt_access->action = cpu_to_le16(cmd_action); @@ -828,11 +861,6 @@ static int wlan_cmd_bt_access(wlan_private * priv, break; case cmd_act_bt_access_reset: break; - case cmd_act_bt_access_set_invert: - bt_access->id = cpu_to_le32(*(u32 *) pdata_buf); - break; - case cmd_act_bt_access_get_invert: - break; default: break; } @@ -844,10 +872,11 @@ static int wlan_cmd_fwt_access(wlan_private * priv, u16 cmd_action, void *pdata_buf) { struct cmd_ds_fwt_access *fwt_access = &cmd->params.fwt; - lbs_deb_cmd("FWT CMD(%d)\n", cmd_action); + lbs_pr_debug(1, "FWT CMD(%d)\n", cmd_action); cmd->command = cpu_to_le16(cmd_fwt_access); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access) + S_DS_GEN); + cmd->size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access) + + S_DS_GEN); cmd->result = 0; if (pdata_buf) @@ -865,10 +894,11 @@ static int wlan_cmd_mesh_access(wlan_private * priv, u16 cmd_action, void *pdata_buf) { struct cmd_ds_mesh_access *mesh_access = &cmd->params.mesh; - lbs_deb_cmd("FWT CMD(%d)\n", cmd_action); + lbs_pr_debug(1, "FWT CMD(%d)\n", cmd_action); cmd->command = cpu_to_le16(cmd_mesh_access); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_mesh_access) + S_DS_GEN); + cmd->size = cpu_to_le16(sizeof(struct cmd_ds_mesh_access) + + S_DS_GEN); cmd->result = 0; if (pdata_buf) @@ -886,23 +916,23 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u unsigned long flags; struct cmd_ds_command *cmdptr; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); if (!cmdnode) { - lbs_deb_cmd("QUEUE_CMD: cmdnode is NULL\n"); + lbs_pr_debug(1, "QUEUE_CMD: cmdnode is NULL\n"); goto done; } cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr; if (!cmdptr) { - lbs_deb_cmd("QUEUE_CMD: cmdptr is NULL\n"); + lbs_pr_debug(1, "QUEUE_CMD: cmdptr is NULL\n"); goto done; } /* Exit_PS command needs to be queued in the header always. */ if (cmdptr->command == cmd_802_11_ps_mode) { struct cmd_ds_802_11_ps_mode *psm = &cmdptr->params.psmode; - if (psm->action == cpu_to_le16(cmd_subcmd_exit_ps)) { + if (psm->action == cmd_subcmd_exit_ps) { if (adapter->psstate != PS_STATE_FULL_POWER) addtail = 0; } @@ -918,12 +948,13 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u spin_unlock_irqrestore(&adapter->driver_lock, flags); - lbs_deb_cmd("QUEUE_CMD: Inserted node=%p, cmd=0x%x in cmdpendingq\n", + lbs_pr_debug(1, "QUEUE_CMD: Inserted node=%p, cmd=0x%x in cmdpendingq\n", cmdnode, - le16_to_cpu(((struct cmd_ds_gen*)cmdnode->bufvirtualaddr)->command)); + ((struct cmd_ds_gen*)cmdnode->bufvirtualaddr)->command); done: - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); + return; } /* @@ -943,10 +974,10 @@ static int DownloadcommandToStation(wlan_private * priv, u16 cmdsize; u16 command; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); if (!adapter || !cmdnode) { - lbs_deb_cmd("DNLD_CMD: adapter = %p, cmdnode = %p\n", + lbs_pr_debug(1, "DNLD_CMD: adapter = %p, cmdnode = %p\n", adapter, cmdnode); if (cmdnode) { spin_lock_irqsave(&adapter->driver_lock, flags); @@ -962,7 +993,7 @@ static int DownloadcommandToStation(wlan_private * priv, spin_lock_irqsave(&adapter->driver_lock, flags); if (!cmdptr || !cmdptr->size) { - lbs_deb_cmd("DNLD_CMD: cmdptr is Null or cmd size is Zero, " + lbs_pr_debug(1, "DNLD_CMD: cmdptr is Null or cmd size is Zero, " "Not sending\n"); __libertas_cleanup_and_insert_cmd(priv, cmdnode); spin_unlock_irqrestore(&adapter->driver_lock, flags); @@ -973,8 +1004,8 @@ static int DownloadcommandToStation(wlan_private * priv, adapter->cur_cmd = cmdnode; adapter->cur_cmd_retcode = 0; spin_unlock_irqrestore(&adapter->driver_lock, flags); - lbs_deb_cmd("DNLD_CMD:: Before download, size of cmd = %d\n", - le16_to_cpu(cmdptr->size)); + lbs_pr_debug(1, "DNLD_CMD:: Before download, size of cmd = %d\n", + cmdptr->size); cmdsize = cmdptr->size; @@ -983,10 +1014,10 @@ static int DownloadcommandToStation(wlan_private * priv, cmdnode->cmdwaitqwoken = 0; cmdsize = cpu_to_le16(cmdsize); - ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmdptr, cmdsize); + ret = libertas_sbi_host_to_card(priv, MVMS_CMD, (u8 *) cmdptr, cmdsize); if (ret != 0) { - lbs_deb_cmd("DNLD_CMD: Host to Card failed\n"); + lbs_pr_debug(1, "DNLD_CMD: Host to Card failed\n"); spin_lock_irqsave(&adapter->driver_lock, flags); __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); adapter->cur_cmd = NULL; @@ -995,11 +1026,12 @@ static int DownloadcommandToStation(wlan_private * priv, goto done; } - lbs_deb_cmd("DNLD_CMD: Sent command 0x%x @ %lu\n", command, jiffies); + lbs_pr_debug(1, "DNLD_CMD: Sent command 0x%x @ %lu\n", command, jiffies); lbs_dbg_hex("DNLD_CMD: command", cmdnode->bufvirtualaddr, cmdsize); /* Setup the timer after transmit command */ - if (command == cmd_802_11_scan || command == cmd_802_11_authenticate + if (command == cmd_802_11_scan + || command == cmd_802_11_authenticate || command == cmd_802_11_associate) mod_timer(&adapter->command_timer, jiffies + (10*HZ)); else @@ -1007,8 +1039,8 @@ static int DownloadcommandToStation(wlan_private * priv, ret = 0; -done: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); + done: + LEAVE(); return ret; } @@ -1017,16 +1049,17 @@ static int wlan_cmd_mac_control(wlan_private * priv, { struct cmd_ds_mac_control *mac = &cmd->params.macctrl; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); cmd->command = cpu_to_le16(cmd_mac_control); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_mac_control) + S_DS_GEN); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_mac_control) + S_DS_GEN); mac->action = cpu_to_le16(priv->adapter->currentpacketfilter); - lbs_deb_cmd("wlan_cmd_mac_control(): action=0x%X size=%d\n", - le16_to_cpu(mac->action), le16_to_cpu(cmd->size)); + lbs_pr_debug(1, "wlan_cmd_mac_control(): action=0x%X size=%d\n", + mac->action, cmd->size); - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -1060,17 +1093,17 @@ int libertas_set_radio_control(wlan_private * priv) { int ret = 0; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); ret = libertas_prepare_and_send_command(priv, cmd_802_11_radio_control, cmd_act_set, cmd_option_waitforrsp, 0, NULL); - lbs_deb_cmd("RADIO_SET: on or off: 0x%X, preamble = 0x%X\n", + lbs_pr_debug(1, "RADIO_SET: on or off: 0x%X, preamble = 0x%X\n", priv->adapter->radioon, priv->adapter->preamble); - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); + LEAVE(); return ret; } @@ -1078,16 +1111,16 @@ int libertas_set_mac_packet_filter(wlan_private * priv) { int ret = 0; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - lbs_deb_cmd("libertas_set_mac_packet_filter value = %x\n", + lbs_pr_debug(1, "libertas_set_mac_packet_filter value = %x\n", priv->adapter->currentpacketfilter); /* Send MAC control command to station */ ret = libertas_prepare_and_send_command(priv, cmd_mac_control, 0, 0, 0, NULL); - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); + LEAVE(); return ret; } @@ -1113,16 +1146,16 @@ int libertas_prepare_and_send_command(wlan_private * priv, struct cmd_ds_command *cmdptr; unsigned long flags; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); if (!adapter) { - lbs_deb_cmd("PREP_CMD: adapter is Null\n"); + lbs_pr_debug(1, "PREP_CMD: adapter is Null\n"); ret = -1; goto done; } if (adapter->surpriseremoved) { - lbs_deb_cmd("PREP_CMD: Card is Removed\n"); + lbs_pr_debug(1, "PREP_CMD: Card is Removed\n"); ret = -1; goto done; } @@ -1130,7 +1163,7 @@ int libertas_prepare_and_send_command(wlan_private * priv, cmdnode = libertas_get_free_cmd_ctrl_node(priv); if (cmdnode == NULL) { - lbs_deb_cmd("PREP_CMD: No free cmdnode\n"); + lbs_pr_debug(1, "PREP_CMD: No free cmdnode\n"); /* Wake up main thread to execute next command */ wake_up_interruptible(&priv->mainthread.waitq); @@ -1142,11 +1175,11 @@ int libertas_prepare_and_send_command(wlan_private * priv, cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr; - lbs_deb_cmd("PREP_CMD: Val of cmd ptr=%p, command=0x%X\n", + lbs_pr_debug(1, "PREP_CMD: Val of cmd ptr=%p, command=0x%X\n", cmdptr, cmd_no); if (!cmdptr) { - lbs_deb_cmd("PREP_CMD: bufvirtualaddr of cmdnode is NULL\n"); + lbs_pr_debug(1, "PREP_CMD: bufvirtualaddr of cmdnode is NULL\n"); libertas_cleanup_and_insert_cmd(priv, cmdnode); ret = -1; goto done; @@ -1156,7 +1189,7 @@ int libertas_prepare_and_send_command(wlan_private * priv, adapter->seqnum++; cmdptr->seqnum = cpu_to_le16(adapter->seqnum); - cmdptr->command = cpu_to_le16(cmd_no); + cmdptr->command = cmd_no; cmdptr->result = 0; switch (cmd_no) { @@ -1265,13 +1298,13 @@ int libertas_prepare_and_send_command(wlan_private * priv, break; case cmd_802_11_enable_rsn: - ret = wlan_cmd_802_11_enable_rsn(priv, cmdptr, cmd_action, - pdata_buf); + ret = wlan_cmd_802_11_enable_rsn(priv, cmdptr, cmd_action); break; case cmd_802_11_key_material: - ret = wlan_cmd_802_11_key_material(priv, cmdptr, cmd_action, - cmd_oid, pdata_buf); + ret = wlan_cmd_802_11_key_material(priv, cmdptr, + cmd_action, cmd_oid, + pdata_buf); break; case cmd_802_11_pairwise_tsc: @@ -1292,8 +1325,9 @@ int libertas_prepare_and_send_command(wlan_private * priv, case cmd_802_11_get_afc: cmdptr->command = cpu_to_le16(cmd_no); - cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_afc) + - S_DS_GEN); + cmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_afc) + + S_DS_GEN); memmove(&cmdptr->params.afc, pdata_buf, sizeof(struct cmd_ds_802_11_afc)); @@ -1372,26 +1406,29 @@ int libertas_prepare_and_send_command(wlan_private * priv, case cmd_get_tsf: cmdptr->command = cpu_to_le16(cmd_get_tsf); - cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) + - S_DS_GEN); + cmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_get_tsf) + + S_DS_GEN); ret = 0; break; case cmd_802_11_tx_rate_query: - cmdptr->command = cpu_to_le16(cmd_802_11_tx_rate_query); - cmdptr->size = cpu_to_le16(sizeof(struct cmd_tx_rate_query) + - S_DS_GEN); + cmdptr->command = + cpu_to_le16(cmd_802_11_tx_rate_query); + cmdptr->size = + cpu_to_le16(sizeof(struct cmd_tx_rate_query) + + S_DS_GEN); adapter->txrate = 0; ret = 0; break; default: - lbs_deb_cmd("PREP_CMD: unknown command- %#x\n", cmd_no); + lbs_pr_debug(1, "PREP_CMD: unknown command- %#x\n", cmd_no); ret = -1; break; } /* return error, since the command preparation failed */ if (ret != 0) { - lbs_deb_cmd("PREP_CMD: command preparation failed\n"); + lbs_pr_debug(1, "PREP_CMD: command preparation failed\n"); libertas_cleanup_and_insert_cmd(priv, cmdnode); ret = -1; goto done; @@ -1404,7 +1441,7 @@ int libertas_prepare_and_send_command(wlan_private * priv, wake_up_interruptible(&priv->mainthread.waitq); if (wait_option & cmd_option_waitforrsp) { - lbs_deb_cmd("PREP_CMD: Wait for CMD response\n"); + lbs_pr_debug(1, "PREP_CMD: Wait for CMD response\n"); might_sleep(); wait_event_interruptible(cmdnode->cmdwait_q, cmdnode->cmdwaitqwoken); @@ -1412,7 +1449,7 @@ int libertas_prepare_and_send_command(wlan_private * priv, spin_lock_irqsave(&adapter->driver_lock, flags); if (adapter->cur_cmd_retcode) { - lbs_deb_cmd("PREP_CMD: command failed with return code=%d\n", + lbs_pr_debug(1, "PREP_CMD: command failed with return code=%d\n", adapter->cur_cmd_retcode); adapter->cur_cmd_retcode = 0; ret = -1; @@ -1420,10 +1457,9 @@ int libertas_prepare_and_send_command(wlan_private * priv, spin_unlock_irqrestore(&adapter->driver_lock, flags); done: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); + LEAVE(); return ret; } -EXPORT_SYMBOL_GPL(libertas_prepare_and_send_command); /** * @brief This function allocates the command buffer and link @@ -1441,29 +1477,33 @@ int libertas_allocate_cmd_buffer(wlan_private * priv) u8 *ptempvirtualaddr; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); /* Allocate and initialize cmdCtrlNode */ ulbufsize = sizeof(struct cmd_ctrl_node) * MRVDRV_NUM_OF_CMD_BUFFER; - if (!(tempcmd_array = kzalloc(ulbufsize, GFP_KERNEL))) { - lbs_deb_cmd( + if (!(tempcmd_array = kmalloc(ulbufsize, GFP_KERNEL))) { + lbs_pr_debug(1, "ALLOC_CMD_BUF: failed to allocate tempcmd_array\n"); ret = -1; goto done; } + adapter->cmd_array = tempcmd_array; + memset(adapter->cmd_array, 0, ulbufsize); /* Allocate and initialize command buffers */ ulbufsize = MRVDRV_SIZE_OF_CMD_BUFFER; for (i = 0; i < MRVDRV_NUM_OF_CMD_BUFFER; i++) { - if (!(ptempvirtualaddr = kzalloc(ulbufsize, GFP_KERNEL))) { - lbs_deb_cmd( + if (!(ptempvirtualaddr = kmalloc(ulbufsize, GFP_KERNEL))) { + lbs_pr_debug(1, "ALLOC_CMD_BUF: ptempvirtualaddr: out of memory\n"); ret = -1; goto done; } + memset(ptempvirtualaddr, 0, ulbufsize); + /* Update command buffer virtual */ tempcmd_array[i].bufvirtualaddr = ptempvirtualaddr; } @@ -1474,9 +1514,8 @@ int libertas_allocate_cmd_buffer(wlan_private * priv) } ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); + done: + LEAVE(); return ret; } @@ -1488,16 +1527,16 @@ int libertas_allocate_cmd_buffer(wlan_private * priv) */ int libertas_free_cmd_buffer(wlan_private * priv) { - u32 ulbufsize; /* Someone needs to die for this. Slowly and painfully */ + u32 ulbufsize; unsigned int i; struct cmd_ctrl_node *tempcmd_array; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); /* need to check if cmd array is allocated or not */ if (adapter->cmd_array == NULL) { - lbs_deb_cmd("FREE_CMD_BUF: cmd_array is Null\n"); + lbs_pr_debug(1, "FREE_CMD_BUF: cmd_array is Null\n"); goto done; } @@ -1507,7 +1546,7 @@ int libertas_free_cmd_buffer(wlan_private * priv) ulbufsize = MRVDRV_SIZE_OF_CMD_BUFFER; for (i = 0; i < MRVDRV_NUM_OF_CMD_BUFFER; i++) { if (tempcmd_array[i].bufvirtualaddr) { - lbs_deb_cmd("Free all the array\n"); + lbs_pr_debug(1, "Free all the array\n"); kfree(tempcmd_array[i].bufvirtualaddr); tempcmd_array[i].bufvirtualaddr = NULL; } @@ -1515,13 +1554,13 @@ int libertas_free_cmd_buffer(wlan_private * priv) /* Release cmd_ctrl_node */ if (adapter->cmd_array) { - lbs_deb_cmd("Free cmd_array\n"); + lbs_pr_debug(1, "Free cmd_array\n"); kfree(adapter->cmd_array); adapter->cmd_array = NULL; } done: - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -1547,18 +1586,16 @@ struct cmd_ctrl_node *libertas_get_free_cmd_ctrl_node(wlan_private * priv) tempnode = (struct cmd_ctrl_node *)adapter->cmdfreeq.next; list_del((struct list_head *)tempnode); } else { - lbs_deb_cmd("GET_CMD_NODE: cmd_ctrl_node is not available\n"); + lbs_pr_debug(1, "GET_CMD_NODE: cmd_ctrl_node is not available\n"); tempnode = NULL; } spin_unlock_irqrestore(&adapter->driver_lock, flags); if (tempnode) { - /* lbs_pr_debug(3, "GET_CMD_NODE: cmdCtrlNode available\n"); lbs_pr_debug(3, "GET_CMD_NODE: cmdCtrlNode Address = %p\n", tempnode); - */ cleanup_cmdnode(tempnode); } @@ -1601,7 +1638,7 @@ void libertas_set_cmd_ctrl_node(wlan_private * priv, struct cmd_ctrl_node *ptempnode, u32 cmd_oid, u16 wait_option, void *pdata_buf) { - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); if (!ptempnode) return; @@ -1610,7 +1647,7 @@ void libertas_set_cmd_ctrl_node(wlan_private * priv, ptempnode->wait_option = wait_option; ptempnode->pdata_buf = pdata_buf; - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); } /** @@ -1629,7 +1666,7 @@ int libertas_execute_next_command(wlan_private * priv) unsigned long flags; int ret = 0; - lbs_deb_enter(LBS_DEB_CMD); + lbs_pr_debug(1, "libertas_execute_next_command\n"); spin_lock_irqsave(&adapter->driver_lock, flags); @@ -1648,24 +1685,23 @@ int libertas_execute_next_command(wlan_private * priv) spin_unlock_irqrestore(&adapter->driver_lock, flags); if (cmdnode) { - lbs_deb_cmd( + lbs_pr_debug(1, "EXEC_NEXT_CMD: Got next command from cmdpendingq\n"); cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr; if (is_command_allowed_in_ps(cmdptr->command)) { - if ((adapter->psstate == PS_STATE_SLEEP) || - (adapter->psstate == PS_STATE_PRE_SLEEP)) { - lbs_deb_cmd( + if ((adapter->psstate == PS_STATE_SLEEP) + || (adapter->psstate == PS_STATE_PRE_SLEEP) + ) { + lbs_pr_debug(1, "EXEC_NEXT_CMD: Cannot send cmd 0x%x in psstate %d\n", - le16_to_cpu(cmdptr->command), - adapter->psstate); + cmdptr->command, adapter->psstate); ret = -1; goto done; } - lbs_deb_cmd("EXEC_NEXT_CMD: OK to send command " + lbs_pr_debug(1, "EXEC_NEXT_CMD: OK to send command " "0x%x in psstate %d\n", - le16_to_cpu(cmdptr->command), - adapter->psstate); + cmdptr->command, adapter->psstate); } else if (adapter->psstate != PS_STATE_FULL_POWER) { /* * 1. Non-PS command: @@ -1701,12 +1737,12 @@ int libertas_execute_next_command(wlan_private * priv) struct cmd_ds_802_11_ps_mode *psm = &cmdptr->params.psmode; - lbs_deb_cmd( + lbs_pr_debug(1, "EXEC_NEXT_CMD: PS cmd- action=0x%x\n", psm->action); if (psm->action != cpu_to_le16(cmd_subcmd_exit_ps)) { - lbs_deb_cmd( + lbs_pr_debug(1, "EXEC_NEXT_CMD: Ignore Enter PS cmd\n"); list_del((struct list_head *)cmdnode); libertas_cleanup_and_insert_cmd(priv, cmdnode); @@ -1715,9 +1751,10 @@ int libertas_execute_next_command(wlan_private * priv) goto done; } - if ((adapter->psstate == PS_STATE_SLEEP) || - (adapter->psstate == PS_STATE_PRE_SLEEP)) { - lbs_deb_cmd( + if ((adapter->psstate == PS_STATE_SLEEP) + || (adapter->psstate == PS_STATE_PRE_SLEEP) + ) { + lbs_pr_debug(1, "EXEC_NEXT_CMD: Ignore ExitPS cmd in sleep\n"); list_del((struct list_head *)cmdnode); libertas_cleanup_and_insert_cmd(priv, cmdnode); @@ -1727,13 +1764,13 @@ int libertas_execute_next_command(wlan_private * priv) goto done; } - lbs_deb_cmd( + lbs_pr_debug(1, "EXEC_NEXT_CMD: Sending Exit_PS down...\n"); } } list_del((struct list_head *)cmdnode); - lbs_deb_cmd("EXEC_NEXT_CMD: Sending 0x%04X command\n", - le16_to_cpu(cmdptr->command)); + lbs_pr_debug(1, "EXEC_NEXT_CMD: Sending 0x%04X command\n", + cmdptr->command); DownloadcommandToStation(priv, cmdnode); } else { /* @@ -1743,18 +1780,18 @@ int libertas_execute_next_command(wlan_private * priv) if ((adapter->psmode != wlan802_11powermodecam) && (adapter->psstate == PS_STATE_FULL_POWER) && (adapter->connect_status == libertas_connected)) { - if (adapter->secinfo.WPAenabled || - adapter->secinfo.WPA2enabled) { + if (adapter->secinfo.WPAenabled + || adapter->secinfo.WPA2enabled) { /* check for valid WPA group keys */ - if (adapter->wpa_mcast_key.len || - adapter->wpa_unicast_key.len) { - lbs_deb_cmd( + if (adapter->wpa_mcast_key.len + || adapter->wpa_unicast_key.len) { + lbs_pr_debug(1, "EXEC_NEXT_CMD: WPA enabled and GTK_SET" " go back to PS_SLEEP"); libertas_ps_sleep(priv, 0); } } else { - lbs_deb_cmd( + lbs_pr_debug(1, "EXEC_NEXT_CMD: command PendQ is empty," " go back to PS_SLEEP"); libertas_ps_sleep(priv, 0); @@ -1764,7 +1801,6 @@ int libertas_execute_next_command(wlan_private * priv) ret = 0; done: - lbs_deb_leave(LBS_DEB_CMD); return ret; } @@ -1773,7 +1809,7 @@ void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str) union iwreq_data iwrq; u8 buf[50]; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); memset(&iwrq, 0, sizeof(union iwreq_data)); memset(buf, 0, sizeof(buf)); @@ -1783,13 +1819,15 @@ void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str) iwrq.data.length = strlen(buf) + 1 + IW_EV_LCP_LEN; /* Send Event to upper layer */ - lbs_deb_cmd("Event Indication string = %s\n", (char *)buf); - lbs_deb_cmd("Event Indication String length = %d\n", iwrq.data.length); + lbs_pr_debug(1, "Event Indication string = %s\n", + (char *)buf); + lbs_pr_debug(1, "Event Indication String length = %d\n", iwrq.data.length); - lbs_deb_cmd("Sending wireless event IWEVCUSTOM for %s\n", str); - wireless_send_event(priv->dev, IWEVCUSTOM, &iwrq, buf); + lbs_pr_debug(1, "Sending wireless event IWEVCUSTOM for %s\n", str); + wireless_send_event(priv->wlan_dev.netdev, IWEVCUSTOM, &iwrq, buf); - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); + return; } static int sendconfirmsleep(wlan_private * priv, u8 * cmdptr, u16 size) @@ -1798,19 +1836,19 @@ static int sendconfirmsleep(wlan_private * priv, u8 * cmdptr, u16 size) wlan_adapter *adapter = priv->adapter; int ret = 0; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - lbs_deb_cmd("SEND_SLEEPC_CMD: Before download, size of cmd = %d\n", + lbs_pr_debug(1, "SEND_SLEEPC_CMD: Before download, size of cmd = %d\n", size); lbs_dbg_hex("SEND_SLEEPC_CMD: Sleep confirm command", cmdptr, size); - ret = priv->hw_host_to_card(priv, MVMS_CMD, cmdptr, size); - priv->dnld_sent = DNLD_RES_RECEIVED; + ret = libertas_sbi_host_to_card(priv, MVMS_CMD, cmdptr, size); + priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; spin_lock_irqsave(&adapter->driver_lock, flags); if (adapter->intcounter || adapter->currenttxskb) - lbs_deb_cmd("SEND_SLEEPC_CMD: intcounter=%d currenttxskb=%p\n", + lbs_pr_debug(1, "SEND_SLEEPC_CMD: intcounter=%d currenttxskb=%p\n", adapter->intcounter, adapter->currenttxskb); spin_unlock_irqrestore(&adapter->driver_lock, flags); @@ -1822,22 +1860,23 @@ static int sendconfirmsleep(wlan_private * priv, u8 * cmdptr, u16 size) if (!adapter->intcounter) { adapter->psstate = PS_STATE_SLEEP; } else { - lbs_deb_cmd("SEND_SLEEPC_CMD: After sent,IntC=%d\n", + lbs_pr_debug(1, "SEND_SLEEPC_CMD: After sent,IntC=%d\n", adapter->intcounter); } spin_unlock_irqrestore(&adapter->driver_lock, flags); - lbs_deb_cmd("SEND_SLEEPC_CMD: Sent Confirm Sleep command\n"); - lbs_deb_cmd("+"); + lbs_pr_debug(1, "SEND_SLEEPC_CMD: Sent Confirm Sleep command\n"); + lbs_pr_debug(1, "+"); } - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); + LEAVE(); return ret; } void libertas_ps_sleep(wlan_private * priv, int wait_option) { - lbs_deb_enter(LBS_DEB_CMD); + + ENTER(); /* * PS is currently supported only in Infrastructure mode @@ -1847,7 +1886,8 @@ void libertas_ps_sleep(wlan_private * priv, int wait_option) libertas_prepare_and_send_command(priv, cmd_802_11_ps_mode, cmd_subcmd_enter_ps, wait_option, 0, NULL); - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); + return; } /** @@ -1859,19 +1899,20 @@ void libertas_ps_sleep(wlan_private * priv, int wait_option) */ void libertas_ps_wakeup(wlan_private * priv, int wait_option) { - __le32 Localpsmode; + enum WLAN_802_11_POWER_MODE Localpsmode; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - Localpsmode = cpu_to_le32(wlan802_11powermodecam); + Localpsmode = wlan802_11powermodecam; - lbs_deb_cmd("Exit_PS: Localpsmode = %d\n", wlan802_11powermodecam); + lbs_pr_debug(1, "Exit_PS: Localpsmode = %d\n", Localpsmode); libertas_prepare_and_send_command(priv, cmd_802_11_ps_mode, cmd_subcmd_exit_ps, wait_option, 0, &Localpsmode); - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); + return; } /** @@ -1888,31 +1929,31 @@ void libertas_ps_confirm_sleep(wlan_private * priv, u16 psmode) wlan_adapter *adapter = priv->adapter; u8 allowed = 1; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - if (priv->dnld_sent) { + if (priv->wlan_dev.dnld_sent) { allowed = 0; - lbs_deb_cmd("D"); + lbs_pr_debug(1, "D"); } spin_lock_irqsave(&adapter->driver_lock, flags); if (adapter->cur_cmd) { allowed = 0; - lbs_deb_cmd("C"); + lbs_pr_debug(1, "C"); } if (adapter->intcounter > 0) { allowed = 0; - lbs_deb_cmd("I%d", adapter->intcounter); + lbs_pr_debug(1, "I%d", adapter->intcounter); } spin_unlock_irqrestore(&adapter->driver_lock, flags); if (allowed) { - lbs_deb_cmd("Sending libertas_ps_confirm_sleep\n"); + lbs_pr_debug(1, "Sending libertas_ps_confirm_sleep\n"); sendconfirmsleep(priv, (u8 *) & adapter->libertas_ps_confirm_sleep, sizeof(struct PS_CMD_ConfirmSleep)); } else { - lbs_deb_cmd("Sleep Confirm has been delayed\n"); + lbs_pr_debug(1, "Sleep Confirm has been delayed\n"); } - lbs_deb_leave(LBS_DEB_CMD); + LEAVE(); } diff --git a/trunk/drivers/net/wireless/libertas/cmdresp.c b/trunk/drivers/net/wireless/libertas/cmdresp.c index 0c3b9a583d83..c86454034b58 100644 --- a/trunk/drivers/net/wireless/libertas/cmdresp.c +++ b/trunk/drivers/net/wireless/libertas/cmdresp.c @@ -9,6 +9,7 @@ #include #include "host.h" +#include "sbi.h" #include "decl.h" #include "defs.h" #include "dev.h" @@ -31,7 +32,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) if (adapter->connect_status != libertas_connected) return; - lbs_deb_cmd("Handles disconnect event.\n"); + lbs_pr_debug(1, "Handles disconnect event.\n"); memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN); wrqu.ap_addr.sa_family = ARPHRD_ETHER; @@ -42,15 +43,15 @@ void libertas_mac_event_disconnected(wlan_private * priv) */ msleep_interruptible(1000); - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); + wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); /* Free Tx and Rx packets */ kfree_skb(priv->adapter->currenttxskb); priv->adapter->currenttxskb = NULL; /* report disconnect to upper layer */ - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); + netif_stop_queue(priv->wlan_dev.netdev); + netif_carrier_off(priv->wlan_dev.netdev); /* reset SNR/NF/RSSI values */ memset(adapter->SNR, 0x00, sizeof(adapter->SNR)); @@ -61,32 +62,35 @@ void libertas_mac_event_disconnected(wlan_private * priv) adapter->nextSNRNF = 0; adapter->numSNRNF = 0; adapter->rxpd_rate = 0; - lbs_deb_cmd("Current SSID='%s', ssid length=%u\n", - escape_essid(adapter->curbssparams.ssid, - adapter->curbssparams.ssid_len), - adapter->curbssparams.ssid_len); - lbs_deb_cmd("Previous SSID='%s', ssid length=%u\n", - escape_essid(adapter->prev_ssid, adapter->prev_ssid_len), - adapter->prev_ssid_len); + lbs_pr_debug(1, "Current SSID=%s, ssid length=%u\n", + adapter->curbssparams.ssid.ssid, + adapter->curbssparams.ssid.ssidlength); + lbs_pr_debug(1, "Previous SSID=%s, ssid length=%u\n", + adapter->previousssid.ssid, adapter->previousssid.ssidlength); - adapter->connect_status = libertas_disconnected; + /* reset internal flags */ + adapter->secinfo.WPAenabled = 0; + adapter->secinfo.WPA2enabled = 0; + adapter->wpa_ie_len = 0; - /* Save previous SSID and BSSID for possible reassociation */ - memcpy(&adapter->prev_ssid, &adapter->curbssparams.ssid, - IW_ESSID_MAX_SIZE); - adapter->prev_ssid_len = adapter->curbssparams.ssid_len; - memcpy(adapter->prev_bssid, adapter->curbssparams.bssid, ETH_ALEN); + adapter->connect_status = libertas_disconnected; - /* Clear out associated SSID and BSSID since connection is - * no longer valid. + /* + * memorize the previous SSID and BSSID + * it could be used for re-assoc */ - memset(&adapter->curbssparams.bssid, 0, ETH_ALEN); - memset(&adapter->curbssparams.ssid, 0, IW_ESSID_MAX_SIZE); - adapter->curbssparams.ssid_len = 0; + memcpy(&adapter->previousssid, + &adapter->curbssparams.ssid, sizeof(struct WLAN_802_11_SSID)); + memcpy(adapter->previousbssid, + adapter->curbssparams.bssid, ETH_ALEN); + + /* need to erase the current SSID and BSSID info */ + adapter->pattemptedbssdesc = NULL; + memset(&adapter->curbssparams, 0, sizeof(adapter->curbssparams)); if (adapter->psstate != PS_STATE_FULL_POWER) { /* make firmware to exit PS mode */ - lbs_deb_cmd("Disconnected, so exit PS mode.\n"); + lbs_pr_debug(1, "Disconnected, so exit PS mode.\n"); libertas_ps_wakeup(priv, 0); } } @@ -118,45 +122,55 @@ static void handle_mic_failureevent(wlan_private * priv, u32 event) static int wlan_ret_reg_access(wlan_private * priv, u16 type, struct cmd_ds_command *resp) { - int ret = 0; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); switch (type) { case cmd_ret_mac_reg_access: { - struct cmd_ds_mac_reg_access *reg = &resp->params.macreg; + struct cmd_ds_mac_reg_access *reg; + + reg = + (struct cmd_ds_mac_reg_access *)&resp->params. + macreg; - adapter->offsetvalue.offset = (u32)le16_to_cpu(reg->offset); - adapter->offsetvalue.value = le32_to_cpu(reg->value); + adapter->offsetvalue.offset = reg->offset; + adapter->offsetvalue.value = reg->value; break; } case cmd_ret_bbp_reg_access: { - struct cmd_ds_bbp_reg_access *reg = &resp->params.bbpreg; + struct cmd_ds_bbp_reg_access *reg; + reg = + (struct cmd_ds_bbp_reg_access *)&resp->params. + bbpreg; - adapter->offsetvalue.offset = (u32)le16_to_cpu(reg->offset); + adapter->offsetvalue.offset = reg->offset; adapter->offsetvalue.value = reg->value; break; } case cmd_ret_rf_reg_access: { - struct cmd_ds_rf_reg_access *reg = &resp->params.rfreg; + struct cmd_ds_rf_reg_access *reg; + reg = + (struct cmd_ds_rf_reg_access *)&resp->params. + rfreg; - adapter->offsetvalue.offset = (u32)le16_to_cpu(reg->offset); + adapter->offsetvalue.offset = reg->offset; adapter->offsetvalue.value = reg->value; break; } default: - ret = -1; + LEAVE(); + return -1; } - lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); - return ret; + LEAVE(); + return 0; } static int wlan_ret_get_hw_spec(wlan_private * priv, @@ -167,20 +181,19 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, wlan_adapter *adapter = priv->adapter; int ret = 0; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); adapter->fwcapinfo = le32_to_cpu(hwspec->fwcapinfo); - memcpy(adapter->fwreleasenumber, hwspec->fwreleasenumber, 4); + adapter->fwreleasenumber = hwspec->fwreleasenumber; - lbs_deb_cmd("GET_HW_SPEC: FWReleaseVersion- %u.%u.%u.p%u\n", - adapter->fwreleasenumber[2], adapter->fwreleasenumber[1], - adapter->fwreleasenumber[0], adapter->fwreleasenumber[3]); - lbs_deb_cmd("GET_HW_SPEC: Permanent addr- %2x:%2x:%2x:%2x:%2x:%2x\n", + lbs_pr_debug(1, "GET_HW_SPEC: FWReleaseVersion- 0x%X\n", + adapter->fwreleasenumber); + lbs_pr_debug(1, "GET_HW_SPEC: Permanent addr- %2x:%2x:%2x:%2x:%2x:%2x\n", hwspec->permanentaddr[0], hwspec->permanentaddr[1], hwspec->permanentaddr[2], hwspec->permanentaddr[3], hwspec->permanentaddr[4], hwspec->permanentaddr[5]); - lbs_deb_cmd("GET_HW_SPEC: hwifversion=0x%X version=0x%X\n", + lbs_pr_debug(1, "GET_HW_SPEC: hwifversion=0x%X version=0x%X\n", hwspec->hwifversion, hwspec->version); adapter->regioncode = le16_to_cpu(hwspec->regioncode); @@ -197,15 +210,17 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, if (i >= MRVDRV_MAX_REGION_CODE) { adapter->regioncode = 0x10; adapter->regiontableindex = 0; - lbs_pr_info("unidentified region code; using the default (USA)\n"); + lbs_pr_info( + "unidentified region code, use the default (USA)\n"); } - if (adapter->current_addr[0] == 0xff) - memmove(adapter->current_addr, hwspec->permanentaddr, ETH_ALEN); + if (adapter->current_addr[0] == 0xff) { + memmove(adapter->current_addr, hwspec->permanentaddr, + ETH_ALEN); + } - memcpy(priv->dev->dev_addr, adapter->current_addr, ETH_ALEN); - if (priv->mesh_dev) - memcpy(priv->mesh_dev->dev_addr, adapter->current_addr, ETH_ALEN); + memcpy(priv->wlan_dev.netdev->dev_addr, adapter->current_addr, ETH_ALEN); + memcpy(priv->mesh_dev->dev_addr, adapter->current_addr, ETH_ALEN); if (libertas_set_regiontable(priv, adapter->regioncode, 0)) { ret = -1; @@ -217,8 +232,8 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, goto done; } -done: - lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); + done: + LEAVE(); return ret; } @@ -228,21 +243,19 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv, struct cmd_ds_802_11_sleep_params *sp = &resp->params.sleep_params; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); - - lbs_deb_cmd("error=%x offset=%x stabletime=%x calcontrol=%x\n" - " extsleepclk=%x\n", le16_to_cpu(sp->error), - le16_to_cpu(sp->offset), le16_to_cpu(sp->stabletime), - sp->calcontrol, sp->externalsleepclk); + ENTER(); + lbs_pr_debug(1, "error=%x offset=%x stabletime=%x calcontrol=%x\n" + " extsleepclk=%x\n", sp->error, sp->offset, + sp->stabletime, sp->calcontrol, sp->externalsleepclk); adapter->sp.sp_error = le16_to_cpu(sp->error); adapter->sp.sp_offset = le16_to_cpu(sp->offset); adapter->sp.sp_stabletime = le16_to_cpu(sp->stabletime); - adapter->sp.sp_calcontrol = sp->calcontrol; - adapter->sp.sp_extsleepclk = sp->externalsleepclk; + adapter->sp.sp_calcontrol = le16_to_cpu(sp->calcontrol); + adapter->sp.sp_extsleepclk = le16_to_cpu(sp->externalsleepclk); adapter->sp.sp_reserved = le16_to_cpu(sp->reserved); - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -268,38 +281,42 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, u16 oid = le16_to_cpu(smib->oid); u16 querytype = le16_to_cpu(smib->querytype); - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - lbs_deb_cmd("SNMP_RESP: value of the oid = %x, querytype=%x\n", oid, + lbs_pr_debug(1, "SNMP_RESP: value of the oid = %x, querytype=%x\n", oid, querytype); - lbs_deb_cmd("SNMP_RESP: Buf size = %x\n", le16_to_cpu(smib->bufsize)); + lbs_pr_debug(1, "SNMP_RESP: Buf size = %x\n", + le16_to_cpu(smib->bufsize)); if (querytype == cmd_act_get) { switch (oid) { case fragthresh_i: priv->adapter->fragthsd = - le16_to_cpu(*((__le16 *)(smib->value))); - lbs_deb_cmd("SNMP_RESP: fragthsd =%u\n", - priv->adapter->fragthsd); + le16_to_cpu(* + ((unsigned short *)(smib->value))); + lbs_pr_debug(1, "SNMP_RESP: fragthsd =%u\n", + priv->adapter->fragthsd); break; case rtsthresh_i: priv->adapter->rtsthsd = - le16_to_cpu(*((__le16 *)(smib->value))); - lbs_deb_cmd("SNMP_RESP: rtsthsd =%u\n", - priv->adapter->rtsthsd); + le16_to_cpu(* + ((unsigned short *)(smib->value))); + lbs_pr_debug(1, "SNMP_RESP: rtsthsd =%u\n", + priv->adapter->rtsthsd); break; case short_retrylim_i: priv->adapter->txretrycount = - le16_to_cpu(*((__le16 *)(smib->value))); - lbs_deb_cmd("SNMP_RESP: txretrycount =%u\n", - priv->adapter->rtsthsd); + le16_to_cpu(* + ((unsigned short *)(smib->value))); + lbs_pr_debug(1, "SNMP_RESP: txretrycount =%u\n", + priv->adapter->rtsthsd); break; default: break; } } - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -311,7 +328,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv, wlan_adapter *adapter = priv->adapter; u16 action = le16_to_cpu(pkeymaterial->action); - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); /* Copy the returned key to driver private data */ if (action == cmd_act_get) { @@ -354,7 +371,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv, } } - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -364,11 +381,11 @@ static int wlan_ret_802_11_mac_address(wlan_private * priv, struct cmd_ds_802_11_mac_address *macadd = &resp->params.macadd; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); memcpy(adapter->current_addr, macadd->macadd, ETH_ALEN); - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -378,13 +395,13 @@ static int wlan_ret_802_11_rf_tx_power(wlan_private * priv, struct cmd_ds_802_11_rf_tx_power *rtp = &resp->params.txp; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); adapter->txpowerlevel = le16_to_cpu(rtp->currentlevel); - lbs_deb_cmd("Current TxPower Level = %d\n", adapter->txpowerlevel); + lbs_pr_debug(1, "Current TxPower Level = %d\n", adapter->txpowerlevel); - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -396,12 +413,14 @@ static int wlan_ret_802_11_rf_antenna(wlan_private * priv, u16 action = le16_to_cpu(pAntenna->action); if (action == cmd_act_get_rx) - adapter->rxantennamode = le16_to_cpu(pAntenna->antennamode); + adapter->rxantennamode = + le16_to_cpu(pAntenna->antennamode); if (action == cmd_act_get_tx) - adapter->txantennamode = le16_to_cpu(pAntenna->antennamode); + adapter->txantennamode = + le16_to_cpu(pAntenna->antennamode); - lbs_deb_cmd("RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n", + lbs_pr_debug(1, "RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n", action, le16_to_cpu(pAntenna->antennamode)); return 0; @@ -410,17 +429,19 @@ static int wlan_ret_802_11_rf_antenna(wlan_private * priv, static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv, struct cmd_ds_command *resp) { - struct cmd_ds_802_11_rate_adapt_rateset *rates = &resp->params.rateset; + struct cmd_ds_802_11_rate_adapt_rateset *rates = + &resp->params.rateset; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); if (rates->action == cmd_act_get) { - adapter->enablehwauto = le16_to_cpu(rates->enablehwauto); - adapter->ratebitmap = le16_to_cpu(rates->bitmap); + adapter->enablehwauto = rates->enablehwauto; + adapter->ratebitmap = rates->bitmap; } - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); + return 0; } @@ -431,42 +452,43 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, wlan_adapter *adapter = priv->adapter; u8 dot11datarate; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); lbs_dbg_hex("DATA_RATE_RESP: data_rate- ", (u8 *) pdatarate, sizeof(struct cmd_ds_802_11_data_rate)); dot11datarate = pdatarate->datarate[0]; - if (pdatarate->action == cpu_to_le16(cmd_act_get_tx_rate)) { + if (pdatarate->action == cmd_act_get_tx_rate) { memcpy(adapter->libertas_supported_rates, pdatarate->datarate, sizeof(adapter->libertas_supported_rates)); } adapter->datarate = libertas_index_to_data_rate(dot11datarate); - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); return 0; } static int wlan_ret_802_11_rf_channel(wlan_private * priv, struct cmd_ds_command *resp) { - struct cmd_ds_802_11_rf_channel *rfchannel = &resp->params.rfchannel; + struct cmd_ds_802_11_rf_channel *rfchannel = + &resp->params.rfchannel; wlan_adapter *adapter = priv->adapter; u16 action = le16_to_cpu(rfchannel->action); u16 newchannel = le16_to_cpu(rfchannel->currentchannel); - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); if (action == cmd_opt_802_11_rf_channel_get && adapter->curbssparams.channel != newchannel) { - lbs_deb_cmd("channel Switch: %d to %d\n", + lbs_pr_debug(1, "channel Switch: %d to %d\n", adapter->curbssparams.channel, newchannel); /* Update the channel again */ adapter->curbssparams.channel = newchannel; } - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -478,10 +500,12 @@ static int wlan_ret_802_11_rssi(wlan_private * priv, /* store the non average value */ adapter->SNR[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->SNR); - adapter->NF[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->noisefloor); + adapter->NF[TYPE_BEACON][TYPE_NOAVG] = + le16_to_cpu(rssirsp->noisefloor); adapter->SNR[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->avgSNR); - adapter->NF[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->avgnoisefloor); + adapter->NF[TYPE_BEACON][TYPE_AVG] = + le16_to_cpu(rssirsp->avgnoisefloor); adapter->RSSI[TYPE_BEACON][TYPE_NOAVG] = CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_NOAVG], @@ -491,7 +515,7 @@ static int wlan_ret_802_11_rssi(wlan_private * priv, CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_AVG] / AVG_SCALE, adapter->NF[TYPE_BEACON][TYPE_AVG] / AVG_SCALE); - lbs_deb_cmd("Beacon RSSI value = 0x%x\n", + lbs_pr_debug(1, "Beacon RSSI value = 0x%x\n", adapter->RSSI[TYPE_BEACON][TYPE_AVG]); return 0; @@ -504,11 +528,11 @@ static int wlan_ret_802_11_eeprom_access(wlan_private * priv, struct wlan_ioctl_regrdwr *pbuf; pbuf = (struct wlan_ioctl_regrdwr *) adapter->prdeeprom; - lbs_deb_cmd("eeprom read len=%x\n", + lbs_pr_debug(1, "eeprom read len=%x\n", le16_to_cpu(resp->params.rdeeprom.bytecount)); if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) { pbuf->NOB = 0; - lbs_deb_cmd("eeprom read return length is too big\n"); + lbs_pr_debug(1, "eeprom read return length is too big\n"); return -1; } pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount); @@ -525,15 +549,17 @@ static int wlan_ret_802_11_eeprom_access(wlan_private * priv, static int wlan_ret_get_log(wlan_private * priv, struct cmd_ds_command *resp) { - struct cmd_ds_802_11_get_log *logmessage = &resp->params.glog; + struct cmd_ds_802_11_get_log *logmessage = + (struct cmd_ds_802_11_get_log *)&resp->params.glog; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - /* Stored little-endian */ - memcpy(&adapter->logmsg, logmessage, sizeof(struct cmd_ds_802_11_get_log)); + /* TODO Convert it to Big Endian before copy */ + memcpy(&adapter->logmsg, logmessage, + sizeof(struct cmd_ds_802_11_get_log)); - lbs_deb_enter(LBS_DEB_CMD); + LEAVE(); return 0; } @@ -594,7 +620,8 @@ static inline int handle_cmd_response(u16 respcmd, case cmd_ret_802_11_set_afc: case cmd_ret_802_11_get_afc: spin_lock_irqsave(&adapter->driver_lock, flags); - memmove(adapter->cur_cmd->pdata_buf, &resp->params.afc, + memmove(adapter->cur_cmd->pdata_buf, + &resp->params.afc, sizeof(struct cmd_ds_802_11_afc)); spin_unlock_irqrestore(&adapter->driver_lock, flags); @@ -636,7 +663,7 @@ static inline int handle_cmd_response(u16 respcmd, break; case cmd_ret_802_11_key_material: - lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n"); + lbs_pr_debug(1, "CMD_RESP: KEY_MATERIAL command response\n"); ret = wlan_ret_802_11_key_material(priv, resp); break; @@ -660,19 +687,22 @@ static inline int handle_cmd_response(u16 respcmd, case cmd_ret_802_11_tpc_cfg: spin_lock_irqsave(&adapter->driver_lock, flags); - memmove(adapter->cur_cmd->pdata_buf, &resp->params.tpccfg, + memmove(adapter->cur_cmd->pdata_buf, + &resp->params.tpccfg, sizeof(struct cmd_ds_802_11_tpc_cfg)); spin_unlock_irqrestore(&adapter->driver_lock, flags); break; case cmd_ret_802_11_led_gpio_ctrl: spin_lock_irqsave(&adapter->driver_lock, flags); - memmove(adapter->cur_cmd->pdata_buf, &resp->params.ledgpio, + memmove(adapter->cur_cmd->pdata_buf, + &resp->params.ledgpio, sizeof(struct cmd_ds_802_11_led_ctrl)); spin_unlock_irqrestore(&adapter->driver_lock, flags); break; case cmd_ret_802_11_pwr_cfg: spin_lock_irqsave(&adapter->driver_lock, flags); - memmove(adapter->cur_cmd->pdata_buf, &resp->params.pwrcfg, + memmove(adapter->cur_cmd->pdata_buf, + &resp->params.pwrcfg, sizeof(struct cmd_ds_802_11_pwr_cfg)); spin_unlock_irqrestore(&adapter->driver_lock, flags); @@ -694,21 +724,23 @@ static inline int handle_cmd_response(u16 respcmd, case cmd_ret_fwt_access: spin_lock_irqsave(&adapter->driver_lock, flags); if (adapter->cur_cmd->pdata_buf) - memcpy(adapter->cur_cmd->pdata_buf, &resp->params.fwt, - sizeof(resp->params.fwt)); + memcpy(adapter->cur_cmd->pdata_buf, + &resp->params.fwt, + sizeof(resp->params.fwt)); spin_unlock_irqrestore(&adapter->driver_lock, flags); break; case cmd_ret_mesh_access: if (adapter->cur_cmd->pdata_buf) - memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh, + memcpy(adapter->cur_cmd->pdata_buf, + &resp->params.mesh, sizeof(resp->params.mesh)); break; case cmd_rte_802_11_tx_rate_query: priv->adapter->txrate = resp->params.txrate.txrate; break; default: - lbs_deb_cmd("CMD_RESP: Unknown command response %#x\n", - resp->command); + lbs_pr_debug(1, "CMD_RESP: Unknown command response %#x\n", + resp->command); break; } return ret; @@ -723,9 +755,9 @@ int libertas_process_rx_command(wlan_private * priv) ulong flags; u16 result; - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - lbs_deb_cmd("CMD_RESP: @ %lu\n", jiffies); + lbs_pr_debug(1, "CMD_RESP: @ %lu\n", jiffies); /* Now we got response from FW, cancel the command timer */ del_timer(&adapter->command_timer); @@ -734,7 +766,7 @@ int libertas_process_rx_command(wlan_private * priv) spin_lock_irqsave(&adapter->driver_lock, flags); if (!adapter->cur_cmd) { - lbs_deb_cmd("CMD_RESP: NULL cur_cmd=%p\n", adapter->cur_cmd); + lbs_pr_debug(1, "CMD_RESP: NULL cur_cmd=%p\n", adapter->cur_cmd); ret = -1; spin_unlock_irqrestore(&adapter->driver_lock, flags); goto done; @@ -742,17 +774,17 @@ int libertas_process_rx_command(wlan_private * priv) resp = (struct cmd_ds_command *)(adapter->cur_cmd->bufvirtualaddr); lbs_dbg_hex("CMD_RESP:", adapter->cur_cmd->bufvirtualaddr, - priv->upld_len); + priv->wlan_dev.upld_len); respcmd = le16_to_cpu(resp->command); result = le16_to_cpu(resp->result); - lbs_deb_cmd("CMD_RESP: %x result: %d length: %d\n", respcmd, - result, priv->upld_len); + lbs_pr_debug(1, "CMD_RESP: %x result: %d length: %d\n", respcmd, + result, priv->wlan_dev.upld_len); if (!(respcmd & 0x8000)) { - lbs_deb_cmd("Invalid response to command!"); + lbs_pr_debug(1, "Invalid response to command!"); adapter->cur_cmd_retcode = -1; __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); adapter->nr_cmd_pending--; @@ -763,52 +795,56 @@ int libertas_process_rx_command(wlan_private * priv) } /* Store the response code to cur_cmd_retcode. */ - adapter->cur_cmd_retcode = result;; + adapter->cur_cmd_retcode = le16_to_cpu(resp->result); if (respcmd == cmd_ret_802_11_ps_mode) { - struct cmd_ds_802_11_ps_mode *psmode = &resp->params.psmode; - u16 action = le16_to_cpu(psmode->action); + struct cmd_ds_802_11_ps_mode *psmode; - lbs_deb_cmd( + psmode = &resp->params.psmode; + lbs_pr_debug(1, "CMD_RESP: PS_MODE cmd reply result=%#x action=0x%X\n", - result, action); + resp->result, psmode->action); + psmode->action = cpu_to_le16(psmode->action); if (result) { - lbs_deb_cmd("CMD_RESP: PS command failed- %#x \n", - result); - /* - * We should not re-try enter-ps command in - * ad-hoc mode. It takes place in - * libertas_execute_next_command(). - */ - if (adapter->mode == IW_MODE_ADHOC && - action == cmd_subcmd_enter_ps) - adapter->psmode = wlan802_11powermodecam; - } else if (action == cmd_subcmd_enter_ps) { + lbs_pr_debug(1, "CMD_RESP: PS command failed- %#x \n", + resp->result); + if (adapter->mode == IW_MODE_ADHOC) { + /* + * We should not re-try enter-ps command in + * ad-hoc mode. It takes place in + * libertas_execute_next_command(). + */ + if (psmode->action == cmd_subcmd_enter_ps) + adapter->psmode = + wlan802_11powermodecam; + } + } else if (psmode->action == cmd_subcmd_enter_ps) { adapter->needtowakeup = 0; adapter->psstate = PS_STATE_AWAKE; - lbs_deb_cmd("CMD_RESP: Enter_PS command response\n"); + lbs_pr_debug(1, "CMD_RESP: Enter_PS command response\n"); if (adapter->connect_status != libertas_connected) { /* * When Deauth Event received before Enter_PS command * response, We need to wake up the firmware. */ - lbs_deb_cmd( + lbs_pr_debug(1, "Disconnected, Going to invoke libertas_ps_wakeup\n"); - spin_unlock_irqrestore(&adapter->driver_lock, flags); mutex_unlock(&adapter->lock); + spin_unlock_irqrestore(&adapter->driver_lock, flags); libertas_ps_wakeup(priv, 0); mutex_lock(&adapter->lock); spin_lock_irqsave(&adapter->driver_lock, flags); } - } else if (action == cmd_subcmd_exit_ps) { + } else if (psmode->action == cmd_subcmd_exit_ps) { adapter->needtowakeup = 0; adapter->psstate = PS_STATE_FULL_POWER; - lbs_deb_cmd("CMD_RESP: Exit_PS command response\n"); + lbs_pr_debug(1, "CMD_RESP: Exit_PS command response\n"); } else { - lbs_deb_cmd("CMD_RESP: PS- action=0x%X\n", action); + lbs_pr_debug(1, "CMD_RESP: PS- action=0x%X\n", + psmode->action); } __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); @@ -829,15 +865,15 @@ int libertas_process_rx_command(wlan_private * priv) /* If the command is not successful, cleanup and return failure */ if ((result != 0 || !(respcmd & 0x8000))) { - lbs_deb_cmd("CMD_RESP: command reply %#x result=%#x\n", - respcmd, result); + lbs_pr_debug(1, "CMD_RESP: command reply %#x result=%#x\n", + resp->command, resp->result); /* * Handling errors here */ switch (respcmd) { case cmd_ret_hw_spec_info: case cmd_ret_802_11_reset: - lbs_deb_cmd("CMD_RESP: Reset command failed\n"); + lbs_pr_debug(1, "CMD_RESP: Reset command failed\n"); break; } @@ -867,7 +903,7 @@ int libertas_process_rx_command(wlan_private * priv) done: mutex_unlock(&adapter->lock); - lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); + LEAVE(); return ret; } @@ -881,37 +917,37 @@ int libertas_process_event(wlan_private * priv) eventcause = adapter->eventcause; spin_unlock_irq(&adapter->driver_lock); - lbs_deb_enter(LBS_DEB_CMD); + ENTER(); - lbs_deb_cmd("EVENT Cause %x\n", eventcause); + lbs_pr_debug(1, "EVENT Cause %x\n", eventcause); switch (eventcause >> SBI_EVENT_CAUSE_SHIFT) { case MACREG_INT_CODE_LINK_SENSED: - lbs_deb_cmd("EVENT: MACREG_INT_CODE_LINK_SENSED\n"); + lbs_pr_debug(1, "EVENT: MACREG_INT_CODE_LINK_SENSED\n"); break; case MACREG_INT_CODE_DEAUTHENTICATED: - lbs_deb_cmd("EVENT: Deauthenticated\n"); + lbs_pr_debug(1, "EVENT: Deauthenticated\n"); libertas_mac_event_disconnected(priv); break; case MACREG_INT_CODE_DISASSOCIATED: - lbs_deb_cmd("EVENT: Disassociated\n"); + lbs_pr_debug(1, "EVENT: Disassociated\n"); libertas_mac_event_disconnected(priv); break; case MACREG_INT_CODE_LINK_LOSE_NO_SCAN: - lbs_deb_cmd("EVENT: Link lost\n"); + lbs_pr_debug(1, "EVENT: Link lost\n"); libertas_mac_event_disconnected(priv); break; case MACREG_INT_CODE_PS_SLEEP: - lbs_deb_cmd("EVENT: SLEEP\n"); - lbs_deb_cmd("_"); + lbs_pr_debug(1, "EVENT: SLEEP\n"); + lbs_pr_debug(1, "_"); /* handle unexpected PS SLEEP event */ if (adapter->psstate == PS_STATE_FULL_POWER) { - lbs_deb_cmd( + lbs_pr_debug(1, "EVENT: In FULL POWER mode - ignore PS SLEEP\n"); break; } @@ -922,12 +958,12 @@ int libertas_process_event(wlan_private * priv) break; case MACREG_INT_CODE_PS_AWAKE: - lbs_deb_cmd("EVENT: AWAKE \n"); - lbs_deb_cmd("|"); + lbs_pr_debug(1, "EVENT: AWAKE \n"); + lbs_pr_debug(1, "|"); /* handle unexpected PS AWAKE event */ if (adapter->psstate == PS_STATE_FULL_POWER) { - lbs_deb_cmd( + lbs_pr_debug(1, "EVENT: In FULL POWER mode - ignore PS AWAKE\n"); break; } @@ -941,18 +977,18 @@ int libertas_process_event(wlan_private * priv) * adapter->needtowakeup will be set to FALSE * in libertas_ps_wakeup() */ - lbs_deb_cmd("Waking up...\n"); + lbs_pr_debug(1, "Waking up...\n"); libertas_ps_wakeup(priv, 0); } break; case MACREG_INT_CODE_MIC_ERR_UNICAST: - lbs_deb_cmd("EVENT: UNICAST MIC ERROR\n"); + lbs_pr_debug(1, "EVENT: UNICAST MIC ERROR\n"); handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_UNICAST); break; case MACREG_INT_CODE_MIC_ERR_MULTICAST: - lbs_deb_cmd("EVENT: MULTICAST MIC ERROR\n"); + lbs_pr_debug(1, "EVENT: MULTICAST MIC ERROR\n"); handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_MULTICAST); break; case MACREG_INT_CODE_MIB_CHANGED: @@ -960,7 +996,7 @@ int libertas_process_event(wlan_private * priv) break; case MACREG_INT_CODE_ADHOC_BCN_LOST: - lbs_deb_cmd("EVENT: HWAC - ADHOC BCN LOST\n"); + lbs_pr_debug(1, "EVENT: HWAC - ADHOC BCN LOST\n"); break; case MACREG_INT_CODE_RSSI_LOW: @@ -979,17 +1015,6 @@ int libertas_process_event(wlan_private * priv) lbs_pr_alert( "EVENT: SNR_HIGH\n"); break; - case MACREG_INT_CODE_MESH_AUTO_STARTED: - lbs_pr_alert( "EVENT: MESH_AUTO_STARTED\n"); - adapter->connect_status = libertas_connected ; - if (priv->mesh_open == 1) { - netif_wake_queue(priv->mesh_dev) ; - netif_carrier_on(priv->mesh_dev) ; - } - adapter->mode = IW_MODE_ADHOC ; - schedule_work(&priv->sync_channel); - break; - default: lbs_pr_alert( "EVENT: unknown event id: %#x\n", eventcause >> SBI_EVENT_CAUSE_SHIFT); @@ -999,7 +1024,6 @@ int libertas_process_event(wlan_private * priv) spin_lock_irq(&adapter->driver_lock); adapter->eventcause = 0; spin_unlock_irq(&adapter->driver_lock); - - lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); + LEAVE(); return ret; } diff --git a/trunk/drivers/net/wireless/libertas/debugfs.c b/trunk/drivers/net/wireless/libertas/debugfs.c index 715cbdaa1d4b..7d7bc5e86a56 100644 --- a/trunk/drivers/net/wireless/libertas/debugfs.c +++ b/trunk/drivers/net/wireless/libertas/debugfs.c @@ -4,7 +4,6 @@ #include #include #include - #include "dev.h" #include "decl.h" #include "host.h" @@ -16,9 +15,7 @@ static char *szStates[] = { "Disconnected" }; -#ifdef PROC_DEBUG -static void libertas_debug_init(wlan_private * priv, struct net_device *dev); -#endif +void libertas_debug_init(wlan_private * priv, struct net_device *dev); static int open_file_generic(struct inode *inode, struct file *file) { @@ -63,33 +60,43 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf, int numscansdone = 0, res; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - struct bss_descriptor * iter_bss; + pos += snprintf(buf+pos, len-pos, + "---------------------------------------"); + pos += snprintf(buf+pos, len-pos, + "---------------------------------------\n"); pos += snprintf(buf+pos, len-pos, "# | ch | ss | bssid | cap | TSF | Qual | SSID \n"); + pos += snprintf(buf+pos, len-pos, + "---------------------------------------"); + pos += snprintf(buf+pos, len-pos, + "---------------------------------------\n"); - mutex_lock(&priv->adapter->lock); - list_for_each_entry (iter_bss, &priv->adapter->network_list, list) { + while (numscansdone < priv->adapter->numinscantable) { + struct bss_descriptor *pbssinfo; u16 cap; - memcpy(&cap, &iter_bss->cap, sizeof(cap)); + pbssinfo = &priv->adapter->scantable[numscansdone]; + memcpy(&cap, &pbssinfo->cap, sizeof(cap)); pos += snprintf(buf+pos, len-pos, - "%02u| %03d | %03ld | " MAC_FMT " |", - numscansdone, iter_bss->channel, iter_bss->rssi, - MAC_ARG(iter_bss->bssid)); + "%02u| %03d | %03ld | %02x:%02x:%02x:%02x:%02x:%02x |", + numscansdone, pbssinfo->channel, pbssinfo->rssi, + pbssinfo->macaddress[0], pbssinfo->macaddress[1], + pbssinfo->macaddress[2], pbssinfo->macaddress[3], + pbssinfo->macaddress[4], pbssinfo->macaddress[5]); pos += snprintf(buf+pos, len-pos, " %04x-", cap); pos += snprintf(buf+pos, len-pos, "%c%c%c |", - iter_bss->cap.ibss ? 'A' : 'I', - iter_bss->cap.privacy ? 'P' : ' ', - iter_bss->cap.spectrummgmt ? 'S' : ' '); - pos += snprintf(buf+pos, len-pos, " %08llx |", iter_bss->networktsf); - pos += snprintf(buf+pos, len-pos, " %d |", SCAN_RSSI(iter_bss->rssi)); - pos += snprintf(buf+pos, len-pos, " %s\n", - escape_essid(iter_bss->ssid, iter_bss->ssid_len)); + pbssinfo->cap.ibss ? 'A' : 'I', + pbssinfo->cap.privacy ? 'P' : ' ', + pbssinfo->cap.spectrummgmt ? 'S' : ' '); + pos += snprintf(buf+pos, len-pos, " %08llx |", pbssinfo->networktsf); + pos += snprintf(buf+pos, len-pos, " %d |", + SCAN_RSSI(priv->adapter->scantable[numscansdone].rssi)); + + pos += snprintf(buf+pos, len-pos, " %s\n", pbssinfo->ssid.ssid); numscansdone++; } - mutex_unlock(&priv->adapter->lock); res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); @@ -104,6 +111,7 @@ static ssize_t libertas_sleepparams_write(struct file *file, wlan_private *priv = file->private_data; ssize_t buf_size, res; int p1, p2, p3, p4, p5, p6; + struct sleep_params sp; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -117,12 +125,14 @@ static ssize_t libertas_sleepparams_write(struct file *file, res = -EFAULT; goto out_unlock; } - priv->adapter->sp.sp_error = p1; - priv->adapter->sp.sp_offset = p2; - priv->adapter->sp.sp_stabletime = p3; - priv->adapter->sp.sp_calcontrol = p4; - priv->adapter->sp.sp_extsleepclk = p5; - priv->adapter->sp.sp_reserved = p6; + sp.sp_error = p1; + sp.sp_offset = p2; + sp.sp_stabletime = p3; + sp.sp_calcontrol = p4; + sp.sp_extsleepclk = p5; + sp.sp_reserved = p6; + + memcpy(&priv->adapter->sp, &sp, sizeof(struct sleep_params)); res = libertas_prepare_and_send_command(priv, cmd_802_11_sleep_params, @@ -175,6 +185,7 @@ static ssize_t libertas_extscan(struct file *file, const char __user *userbuf, { wlan_private *priv = file->private_data; ssize_t res, buf_size; + struct WLAN_802_11_SSID extscan_ssid; union iwreq_data wrqu; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -185,10 +196,13 @@ static ssize_t libertas_extscan(struct file *file, const char __user *userbuf, goto out_unlock; } - libertas_send_specific_ssid_scan(priv, buf, strlen(buf)-1, 0); + memcpy(&extscan_ssid.ssid, buf, strlen(buf)-1); + extscan_ssid.ssidlength = strlen(buf)-1; + + libertas_send_specific_SSID_scan(priv, &extscan_ssid, 1); memset(&wrqu, 0, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL); + wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu, NULL); out_unlock: free_page(addr); @@ -237,13 +251,16 @@ static void libertas_parse_bssid(char *buf, size_t count, { char *hold; unsigned int mac[ETH_ALEN]; + int i; hold = strstr(buf, "bssid="); if (!hold) return; hold += 6; - sscanf(hold, MAC_FMT, mac, mac+1, mac+2, mac+3, mac+4, mac+5); - memcpy(scan_cfg->bssid, mac, ETH_ALEN); + sscanf(hold, "%2x:%2x:%2x:%2x:%2x:%2x", mac, mac+1, mac+2, mac+3, + mac+4, mac+5); + for(i=0;ispecificBSSID[i] = mac[i]; } static void libertas_parse_ssid(char *buf, size_t count, @@ -261,26 +278,28 @@ static void libertas_parse_ssid(char *buf, size_t count, end = buf + count - 1; size = min((size_t)IW_ESSID_MAX_SIZE, (size_t) (end - hold)); - strncpy(scan_cfg->ssid, hold, size); + strncpy(scan_cfg->specificSSID, hold, size); return; } -static int libertas_parse_clear(char *buf, size_t count, const char *tag) +static void libertas_parse_keep(char *buf, size_t count, + struct wlan_ioctl_user_scan_cfg *scan_cfg) { char *hold; int val; - hold = strstr(buf, tag); + hold = strstr(buf, "keep="); if (!hold) - return 0; - hold += strlen(tag); + return; + hold += 5; sscanf(hold, "%d", &val); if (val != 0) val = 1; - return val; + scan_cfg->keeppreviousscan = val; + return; } static int libertas_parse_dur(char *buf, size_t count, @@ -363,18 +382,17 @@ static ssize_t libertas_setuserscan(struct file *file, dur = libertas_parse_dur(buf, count, scan_cfg); libertas_parse_chan(buf, count, scan_cfg, dur); libertas_parse_bssid(buf, count, scan_cfg); - scan_cfg->clear_bssid = libertas_parse_clear(buf, count, "clear_bssid="); libertas_parse_ssid(buf, count, scan_cfg); - scan_cfg->clear_ssid = libertas_parse_clear(buf, count, "clear_ssid="); + libertas_parse_keep(buf, count, scan_cfg); libertas_parse_probes(buf, count, scan_cfg); libertas_parse_type(buf, count, scan_cfg); - wlan_scan_networks(priv, scan_cfg, 1); + wlan_scan_networks(priv, scan_cfg); wait_event_interruptible(priv->adapter->cmd_pending, !priv->adapter->nr_cmd_pending); memset(&wrqu, 0x00, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL); + wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu, NULL); out_unlock: free_page(addr); @@ -389,11 +407,11 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf, u16 wait_option = cmd_option_waitforrsp; if (!(*cmdnode = libertas_get_free_cmd_ctrl_node(priv))) { - lbs_deb_debugfs("failed libertas_get_free_cmd_ctrl_node\n"); + lbs_pr_debug(1, "failed libertas_get_free_cmd_ctrl_node\n"); return -ENOMEM; } if (!(*response_buf = kmalloc(3000, GFP_KERNEL))) { - lbs_deb_debugfs("failed to allocate response buffer!\n"); + lbs_pr_debug(1, "failed to allocate response buffer!\n"); return -ENOMEM; } libertas_set_cmd_ctrl_node(priv, *cmdnode, 0, wait_option, NULL); @@ -402,8 +420,8 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf, (*cmdnode)->cmdflags |= CMD_F_HOSTCMD; (*cmdnode)->cmdwaitqwoken = 0; *cmd = (struct cmd_ds_command *)(*cmdnode)->bufvirtualaddr; - (*cmd)->command = cpu_to_le16(cmd_802_11_subscribe_event); - (*cmd)->seqnum = cpu_to_le16(++priv->adapter->seqnum); + (*cmd)->command = cmd_802_11_subscribe_event; + (*cmd)->seqnum = ++priv->adapter->seqnum; (*cmd)->result = 0; return 0; } @@ -429,25 +447,26 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf, } event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_get); - pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); + event->action = cmd_act_get; + pcmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_subscribe_event) + S_DS_GEN); libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -455,17 +474,17 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf, } cmd_len = S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event); - event = (void *)(response_buf + S_DS_GEN); - while (cmd_len < le16_to_cpu(pcmdptr->size)) { - struct mrvlietypesheader *header = (void *)(response_buf + cmd_len); - switch (header->type) { + event = (struct cmd_ds_802_11_subscribe_event *)(response_buf + S_DS_GEN); + while (cmd_len < pcmdptr->size) { + struct mrvlietypesheader *header = (struct mrvlietypesheader *)(response_buf + cmd_len); + switch(header->type) { struct mrvlietypes_rssithreshold *Lowrssi; - case __constant_cpu_to_le16(TLV_TYPE_RSSI_LOW): - Lowrssi = (void *)(response_buf + cmd_len); - pos += snprintf(buf+pos, len-pos, "%d %d %d\n", - Lowrssi->rssivalue, - Lowrssi->rssifreq, - (event->events & cpu_to_le16(0x0001))?1:0); + case TLV_TYPE_RSSI_LOW: + Lowrssi = (struct mrvlietypes_rssithreshold *)(response_buf + cmd_len); + pos += snprintf(buf+pos, len-pos, "%d %d %d\n", + Lowrssi->rssivalue, + Lowrssi->rssifreq, + (event->events & 0x0001)?1:0); default: cmd_len += sizeof(struct mrvlietypes_snrthreshold); break; @@ -493,20 +512,21 @@ static u16 libertas_get_events_bitmap(wlan_private *priv) return res; event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_get); - pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); + event->action = cmd_act_get; + pcmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_subscribe_event) + S_DS_GEN); libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); return 0; } @@ -518,7 +538,7 @@ static u16 libertas_get_events_bitmap(wlan_private *priv) } event = (struct cmd_ds_802_11_subscribe_event *)(response_buf + S_DS_GEN); - event_bitmap = le16_to_cpu(event->events); + event_bitmap = event->events; kfree(response_buf); return event_bitmap; } @@ -559,7 +579,7 @@ static ssize_t libertas_lowrssi_write(struct file *file, goto out_unlock; event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_set); + event->action = cmd_act_set; pcmdptr->size = cpu_to_le16(S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct mrvlietypes_rssithreshold)); @@ -568,30 +588,30 @@ static ssize_t libertas_lowrssi_write(struct file *file, ptr = (u8*) pcmdptr+cmd_len; rssi_threshold = (struct mrvlietypes_rssithreshold *)(ptr); rssi_threshold->header.type = cpu_to_le16(0x0104); - rssi_threshold->header.len = cpu_to_le16(2); - rssi_threshold->rssivalue = value; - rssi_threshold->rssifreq = freq; + rssi_threshold->header.len = 2; + rssi_threshold->rssivalue = cpu_to_le16(value); + rssi_threshold->rssifreq = cpu_to_le16(freq); event_bitmap |= subscribed ? 0x0001 : 0x0; - event->events = cpu_to_le16(event_bitmap); + event->events = event_bitmap; libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -625,26 +645,27 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf, } event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_get); - pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); + event->action = cmd_act_get; + pcmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_subscribe_event) + S_DS_GEN); libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -652,17 +673,17 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf, } cmd_len = S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event); - event = (void *)(response_buf + S_DS_GEN); - while (cmd_len < le16_to_cpu(pcmdptr->size)) { - struct mrvlietypesheader *header = (void *)(response_buf + cmd_len); - switch (header->type) { + event = (struct cmd_ds_802_11_subscribe_event *)(response_buf + S_DS_GEN); + while (cmd_len < pcmdptr->size) { + struct mrvlietypesheader *header = (struct mrvlietypesheader *)(response_buf + cmd_len); + switch(header->type) { struct mrvlietypes_snrthreshold *LowSnr; - case __constant_cpu_to_le16(TLV_TYPE_SNR_LOW): - LowSnr = (void *)(response_buf + cmd_len); - pos += snprintf(buf+pos, len-pos, "%d %d %d\n", - LowSnr->snrvalue, - LowSnr->snrfreq, - (event->events & cpu_to_le16(0x0002))?1:0); + case TLV_TYPE_SNR_LOW: + LowSnr = (struct mrvlietypes_snrthreshold *)(response_buf + cmd_len); + pos += snprintf(buf+pos, len-pos, "%d %d %d\n", + LowSnr->snrvalue, + LowSnr->snrfreq, + (event->events & 0x0002)?1:0); default: cmd_len += sizeof(struct mrvlietypes_snrthreshold); break; @@ -712,7 +733,7 @@ static ssize_t libertas_lowsnr_write(struct file *file, goto out_unlock; event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_set); + event->action = cmd_act_set; pcmdptr->size = cpu_to_le16(S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct mrvlietypes_snrthreshold)); @@ -720,30 +741,30 @@ static ssize_t libertas_lowsnr_write(struct file *file, ptr = (u8*) pcmdptr+cmd_len; snr_threshold = (struct mrvlietypes_snrthreshold *)(ptr); snr_threshold->header.type = cpu_to_le16(TLV_TYPE_SNR_LOW); - snr_threshold->header.len = cpu_to_le16(2); - snr_threshold->snrvalue = value; - snr_threshold->snrfreq = freq; + snr_threshold->header.len = 2; + snr_threshold->snrvalue = cpu_to_le16(value); + snr_threshold->snrfreq = cpu_to_le16(freq); event_bitmap |= subscribed ? 0x0002 : 0x0; - event->events = cpu_to_le16(event_bitmap); + event->events = event_bitmap; libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -778,26 +799,27 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf, } event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_get); - pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); + event->action = cmd_act_get; + pcmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_subscribe_event) + S_DS_GEN); libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -805,17 +827,17 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf, } cmd_len = S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event); - event = (void *)(response_buf + S_DS_GEN); - while (cmd_len < le16_to_cpu(pcmdptr->size)) { - struct mrvlietypesheader *header = (void *)(response_buf + cmd_len); - switch (header->type) { + event = (struct cmd_ds_802_11_subscribe_event *)(response_buf + S_DS_GEN); + while (cmd_len < pcmdptr->size) { + struct mrvlietypesheader *header = (struct mrvlietypesheader *)(response_buf + cmd_len); + switch(header->type) { struct mrvlietypes_failurecount *failcount; - case __constant_cpu_to_le16(TLV_TYPE_FAILCOUNT): - failcount = (void *)(response_buf + cmd_len); - pos += snprintf(buf+pos, len-pos, "%d %d %d\n", - failcount->failvalue, - failcount->Failfreq, - (event->events & cpu_to_le16(0x0004))?1:0); + case TLV_TYPE_FAILCOUNT: + failcount = (struct mrvlietypes_failurecount *)(response_buf + cmd_len); + pos += snprintf(buf+pos, len-pos, "%d %d %d\n", + failcount->failvalue, + failcount->Failfreq, + (event->events & 0x0004)?1:0); default: cmd_len += sizeof(struct mrvlietypes_failurecount); break; @@ -864,7 +886,7 @@ static ssize_t libertas_failcount_write(struct file *file, goto out_unlock; event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_set); + event->action = cmd_act_set; pcmdptr->size = cpu_to_le16(S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct mrvlietypes_failurecount)); @@ -872,30 +894,30 @@ static ssize_t libertas_failcount_write(struct file *file, ptr = (u8*) pcmdptr+cmd_len; failcount = (struct mrvlietypes_failurecount *)(ptr); failcount->header.type = cpu_to_le16(TLV_TYPE_FAILCOUNT); - failcount->header.len = cpu_to_le16(2); - failcount->failvalue = value; - failcount->Failfreq = freq; + failcount->header.len = 2; + failcount->failvalue = cpu_to_le16(value); + failcount->Failfreq = cpu_to_le16(freq); event_bitmap |= subscribed ? 0x0004 : 0x0; - event->events = cpu_to_le16(event_bitmap); + event->events = event_bitmap; libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = (struct cmd_ds_command *)response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -929,26 +951,27 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf, } event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_get); - pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); + event->action = cmd_act_get; + pcmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_subscribe_event) + S_DS_GEN); libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); free_page(addr); kfree(response_buf); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); free_page(addr); kfree(response_buf); @@ -956,16 +979,16 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf, } cmd_len = S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event); - event = (void *)(response_buf + S_DS_GEN); - while (cmd_len < le16_to_cpu(pcmdptr->size)) { - struct mrvlietypesheader *header = (void *)(response_buf + cmd_len); - switch (header->type) { + event = (struct cmd_ds_802_11_subscribe_event *)(response_buf + S_DS_GEN); + while (cmd_len < pcmdptr->size) { + struct mrvlietypesheader *header = (struct mrvlietypesheader *)(response_buf + cmd_len); + switch(header->type) { struct mrvlietypes_beaconsmissed *bcnmiss; - case __constant_cpu_to_le16(TLV_TYPE_BCNMISS): - bcnmiss = (void *)(response_buf + cmd_len); - pos += snprintf(buf+pos, len-pos, "%d N/A %d\n", - bcnmiss->beaconmissed, - (event->events & cpu_to_le16(0x0008))?1:0); + case TLV_TYPE_BCNMISS: + bcnmiss = (struct mrvlietypes_beaconsmissed *)(response_buf + cmd_len); + pos += snprintf(buf+pos, len-pos, "%d N/A %d\n", + bcnmiss->beaconmissed, + (event->events & 0x0008)?1:0); default: cmd_len += sizeof(struct mrvlietypes_beaconsmissed); break; @@ -1015,7 +1038,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file, goto out_unlock; event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_set); + event->action = cmd_act_set; pcmdptr->size = cpu_to_le16(S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct mrvlietypes_beaconsmissed)); @@ -1023,29 +1046,29 @@ static ssize_t libertas_bcnmiss_write(struct file *file, ptr = (u8*) pcmdptr+cmd_len; bcnmiss = (struct mrvlietypes_beaconsmissed *)(ptr); bcnmiss->header.type = cpu_to_le16(TLV_TYPE_BCNMISS); - bcnmiss->header.len = cpu_to_le16(2); - bcnmiss->beaconmissed = value; + bcnmiss->header.len = 2; + bcnmiss->beaconmissed = cpu_to_le16(value); event_bitmap |= subscribed ? 0x0008 : 0x0; - event->events = cpu_to_le16(event_bitmap); + event->events = event_bitmap; libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); free_page(addr); kfree(response_buf); @@ -1079,26 +1102,27 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf, } event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_get); - pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); + event->action = cmd_act_get; + pcmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_subscribe_event) + S_DS_GEN); libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -1106,17 +1130,17 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf, } cmd_len = S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event); - event = (void *)(response_buf + S_DS_GEN); - while (cmd_len < le16_to_cpu(pcmdptr->size)) { - struct mrvlietypesheader *header = (void *)(response_buf + cmd_len); - switch (header->type) { + event = (struct cmd_ds_802_11_subscribe_event *)(response_buf + S_DS_GEN); + while (cmd_len < pcmdptr->size) { + struct mrvlietypesheader *header = (struct mrvlietypesheader *)(response_buf + cmd_len); + switch(header->type) { struct mrvlietypes_rssithreshold *Highrssi; - case __constant_cpu_to_le16(TLV_TYPE_RSSI_HIGH): - Highrssi = (void *)(response_buf + cmd_len); - pos += snprintf(buf+pos, len-pos, "%d %d %d\n", - Highrssi->rssivalue, - Highrssi->rssifreq, - (event->events & cpu_to_le16(0x0010))?1:0); + case TLV_TYPE_RSSI_HIGH: + Highrssi = (struct mrvlietypes_rssithreshold *)(response_buf + cmd_len); + pos += snprintf(buf+pos, len-pos, "%d %d %d\n", + Highrssi->rssivalue, + Highrssi->rssifreq, + (event->events & 0x0010)?1:0); default: cmd_len += sizeof(struct mrvlietypes_snrthreshold); break; @@ -1166,7 +1190,7 @@ static ssize_t libertas_highrssi_write(struct file *file, goto out_unlock; event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_set); + event->action = cmd_act_set; pcmdptr->size = cpu_to_le16(S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct mrvlietypes_rssithreshold)); @@ -1174,29 +1198,29 @@ static ssize_t libertas_highrssi_write(struct file *file, ptr = (u8*) pcmdptr+cmd_len; rssi_threshold = (struct mrvlietypes_rssithreshold *)(ptr); rssi_threshold->header.type = cpu_to_le16(TLV_TYPE_RSSI_HIGH); - rssi_threshold->header.len = cpu_to_le16(2); - rssi_threshold->rssivalue = value; - rssi_threshold->rssifreq = freq; + rssi_threshold->header.len = 2; + rssi_threshold->rssivalue = cpu_to_le16(value); + rssi_threshold->rssifreq = cpu_to_le16(freq); event_bitmap |= subscribed ? 0x0010 : 0x0; - event->events = cpu_to_le16(event_bitmap); + event->events = event_bitmap; libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); return 0; @@ -1229,26 +1253,27 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf, } event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_get); - pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); + event->action = cmd_act_get; + pcmdptr->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_subscribe_event) + S_DS_GEN); libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -1256,17 +1281,17 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf, } cmd_len = S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event); - event = (void *)(response_buf + S_DS_GEN); - while (cmd_len < le16_to_cpu(pcmdptr->size)) { - struct mrvlietypesheader *header = (void *)(response_buf + cmd_len); - switch (header->type) { + event = (struct cmd_ds_802_11_subscribe_event *)(response_buf + S_DS_GEN); + while (cmd_len < pcmdptr->size) { + struct mrvlietypesheader *header = (struct mrvlietypesheader *)(response_buf + cmd_len); + switch(header->type) { struct mrvlietypes_snrthreshold *HighSnr; - case __constant_cpu_to_le16(TLV_TYPE_SNR_HIGH): - HighSnr = (void *)(response_buf + cmd_len); - pos += snprintf(buf+pos, len-pos, "%d %d %d\n", - HighSnr->snrvalue, - HighSnr->snrfreq, - (event->events & cpu_to_le16(0x0020))?1:0); + case TLV_TYPE_SNR_HIGH: + HighSnr = (struct mrvlietypes_snrthreshold *)(response_buf + cmd_len); + pos += snprintf(buf+pos, len-pos, "%d %d %d\n", + HighSnr->snrvalue, + HighSnr->snrfreq, + (event->events & 0x0020)?1:0); default: cmd_len += sizeof(struct mrvlietypes_snrthreshold); break; @@ -1316,7 +1341,7 @@ static ssize_t libertas_highsnr_write(struct file *file, goto out_unlock; event = &pcmdptr->params.subscribe_event; - event->action = cpu_to_le16(cmd_act_set); + event->action = cmd_act_set; pcmdptr->size = cpu_to_le16(S_DS_GEN + sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct mrvlietypes_snrthreshold)); @@ -1324,30 +1349,30 @@ static ssize_t libertas_highsnr_write(struct file *file, ptr = (u8*) pcmdptr+cmd_len; snr_threshold = (struct mrvlietypes_snrthreshold *)(ptr); snr_threshold->header.type = cpu_to_le16(TLV_TYPE_SNR_HIGH); - snr_threshold->header.len = cpu_to_le16(2); - snr_threshold->snrvalue = value; - snr_threshold->snrfreq = freq; + snr_threshold->header.len = 2; + snr_threshold->snrvalue = cpu_to_le16(value); + snr_threshold->snrfreq = cpu_to_le16(freq); event_bitmap |= subscribed ? 0x0020 : 0x0; - event->events = cpu_to_le16(event_bitmap); + event->events = event_bitmap; libertas_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->mainthread.waitq); /* Sleep until response is generated by FW */ wait_event_interruptible(pcmdnode->cmdwait_q, - pcmdnode->cmdwaitqwoken); + pcmdnode->cmdwaitqwoken); pcmdptr = response_buf; if (pcmdptr->result) { - lbs_pr_err("%s: fail, result=%d\n", __func__, - le16_to_cpu(pcmdptr->result)); + lbs_pr_err("%s: fail, result=%d\n", __FUNCTION__, + pcmdptr->result); kfree(response_buf); free_page(addr); return 0; } - if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { + if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { lbs_pr_err("command response incorrect!\n"); kfree(response_buf); free_page(addr); @@ -1735,7 +1760,7 @@ void libertas_debugfs_remove_one(wlan_private *priv) debugfs_remove(priv->regs_dir); - for(i=0; idebugfs_events_files[i]); debugfs_remove(priv->events_dir); @@ -1744,19 +1769,13 @@ void libertas_debugfs_remove_one(wlan_private *priv) #endif for(i=0; idebugfs_files[i]); - debugfs_remove(priv->debugfs_dir); } - - /* debug entry */ -#ifdef PROC_DEBUG - #define item_size(n) (FIELD_SIZEOF(wlan_adapter, n)) #define item_addr(n) (offsetof(wlan_adapter, n)) - struct debug_data { char name[32]; u32 size; @@ -1844,7 +1863,7 @@ static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf, return 0; if (copy_from_user(pdata, buf, cnt)) { - lbs_deb_debugfs("Copy from user failed\n"); + lbs_pr_debug(1, "Copy from user failed\n"); kfree(pdata); return 0; } @@ -1894,7 +1913,7 @@ static struct file_operations libertas_debug_fops = { * @param dev pointer net_device * @return N/A */ -static void libertas_debug_init(wlan_private * priv, struct net_device *dev) +void libertas_debug_init(wlan_private * priv, struct net_device *dev) { int i; @@ -1908,5 +1927,4 @@ static void libertas_debug_init(wlan_private * priv, struct net_device *dev) priv->debugfs_dir, &items[0], &libertas_debug_fops); } -#endif diff --git a/trunk/drivers/net/wireless/libertas/decl.h b/trunk/drivers/net/wireless/libertas/decl.h index 40f56bb1eac8..dfe27642322c 100644 --- a/trunk/drivers/net/wireless/libertas/decl.h +++ b/trunk/drivers/net/wireless/libertas/decl.h @@ -6,8 +6,6 @@ #ifndef _WLAN_DECL_H_ #define _WLAN_DECL_H_ -#include - #include "defs.h" /** Function Prototype Declaration */ @@ -68,24 +66,18 @@ void libertas_ps_wakeup(wlan_private * priv, int wait_option); void libertas_tx_runqueue(wlan_private *priv); -struct chan_freq_power *libertas_find_cfp_by_band_and_channel( +extern struct chan_freq_power *libertas_find_cfp_by_band_and_channel( wlan_adapter * adapter, u8 band, u16 channel); -void libertas_mac_event_disconnected(wlan_private * priv); +extern void libertas_mac_event_disconnected(wlan_private * priv); void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str); -/* fw.c */ -int libertas_init_fw(wlan_private * priv, char *fw_name); - +int reset_device(wlan_private *priv); /* main.c */ -struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, +extern struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, int *cfp_no); -wlan_private *libertas_add_card(void *card, struct device *dmdev); -int libertas_activate_card(wlan_private *priv, char *fw_name); -int libertas_remove_card(wlan_private *priv); -int libertas_add_mesh(wlan_private *priv, struct device *dev); -void libertas_remove_mesh(wlan_private *priv); - +wlan_private *wlan_add_card(void *card); +int wlan_remove_card(void *card); #endif /* _WLAN_DECL_H_ */ diff --git a/trunk/drivers/net/wireless/libertas/defs.h b/trunk/drivers/net/wireless/libertas/defs.h index 4dd43e59bda0..80dd9ea19c8e 100644 --- a/trunk/drivers/net/wireless/libertas/defs.h +++ b/trunk/drivers/net/wireless/libertas/defs.h @@ -7,79 +7,14 @@ #include +extern unsigned int libertas_debug; + #ifdef CONFIG_LIBERTAS_DEBUG #define DEBUG #define PROC_DEBUG #endif -#ifndef DRV_NAME -#define DRV_NAME "libertas" -#endif - - -#define LBS_DEB_ENTER 0x00000001 -#define LBS_DEB_LEAVE 0x00000002 -#define LBS_DEB_MAIN 0x00000004 -#define LBS_DEB_NET 0x00000008 -#define LBS_DEB_MESH 0x00000010 -#define LBS_DEB_WEXT 0x00000020 -#define LBS_DEB_IOCTL 0x00000040 -#define LBS_DEB_SCAN 0x00000080 -#define LBS_DEB_ASSOC 0x00000100 -#define LBS_DEB_JOIN 0x00000200 -#define LBS_DEB_11D 0x00000400 -#define LBS_DEB_DEBUGFS 0x00000800 -#define LBS_DEB_ETHTOOL 0x00001000 -#define LBS_DEB_HOST 0x00002000 -#define LBS_DEB_CMD 0x00004000 -#define LBS_DEB_RX 0x00008000 -#define LBS_DEB_TX 0x00010000 -#define LBS_DEB_USB 0x00020000 -#define LBS_DEB_CS 0x00040000 -#define LBS_DEB_FW 0x00080000 -#define LBS_DEB_THREAD 0x00100000 -#define LBS_DEB_HEX 0x00200000 - -extern unsigned int libertas_debug; - -#ifdef DEBUG -#define LBS_DEB_LL(grp, fmt, args...) \ -do { if ((libertas_debug & (grp)) == (grp)) \ - printk(KERN_DEBUG DRV_NAME "%s: " fmt, \ - in_interrupt() ? " (INT)" : "", ## args); } while (0) -#else -#define LBS_DEB_LL(grp, fmt, args...) do {} while (0) -#endif - -#define lbs_deb_enter(grp) \ - LBS_DEB_LL(grp | LBS_DEB_ENTER, "%s():%d enter\n", __FUNCTION__, __LINE__); -#define lbs_deb_enter_args(grp, fmt, args...) \ - LBS_DEB_LL(grp | LBS_DEB_ENTER, "%s(" fmt "):%d\n", __FUNCTION__, ## args, __LINE__); -#define lbs_deb_leave(grp) \ - LBS_DEB_LL(grp | LBS_DEB_LEAVE, "%s():%d leave\n", __FUNCTION__, __LINE__); -#define lbs_deb_leave_args(grp, fmt, args...) \ - LBS_DEB_LL(grp | LBS_DEB_LEAVE, "%s():%d leave, " fmt "\n", \ - __FUNCTION__, __LINE__, ##args); -#define lbs_deb_main(fmt, args...) LBS_DEB_LL(LBS_DEB_MAIN, fmt, ##args) -#define lbs_deb_net(fmt, args...) LBS_DEB_LL(LBS_DEB_NET, fmt, ##args) -#define lbs_deb_mesh(fmt, args...) LBS_DEB_LL(LBS_DEB_MESH, fmt, ##args) -#define lbs_deb_wext(fmt, args...) LBS_DEB_LL(LBS_DEB_WEXT, fmt, ##args) -#define lbs_deb_ioctl(fmt, args...) LBS_DEB_LL(LBS_DEB_IOCTL, fmt, ##args) -#define lbs_deb_scan(fmt, args...) LBS_DEB_LL(LBS_DEB_SCAN, fmt, ##args) -#define lbs_deb_assoc(fmt, args...) LBS_DEB_LL(LBS_DEB_ASSOC, fmt, ##args) -#define lbs_deb_join(fmt, args...) LBS_DEB_LL(LBS_DEB_JOIN, fmt, ##args) -#define lbs_deb_11d(fmt, args...) LBS_DEB_LL(LBS_DEB_11D, fmt, ##args) -#define lbs_deb_debugfs(fmt, args...) LBS_DEB_LL(LBS_DEB_DEBUGFS, fmt, ##args) -#define lbs_deb_ethtool(fmt, args...) LBS_DEB_LL(LBS_DEB_ETHTOOL, fmt, ##args) -#define lbs_deb_host(fmt, args...) LBS_DEB_LL(LBS_DEB_HOST, fmt, ##args) -#define lbs_deb_cmd(fmt, args...) LBS_DEB_LL(LBS_DEB_CMD, fmt, ##args) -#define lbs_deb_rx(fmt, args...) LBS_DEB_LL(LBS_DEB_RX, fmt, ##args) -#define lbs_deb_tx(fmt, args...) LBS_DEB_LL(LBS_DEB_TX, fmt, ##args) -#define lbs_deb_fw(fmt, args...) LBS_DEB_LL(LBS_DEB_FW, fmt, ##args) -#define lbs_deb_usb(fmt, args...) LBS_DEB_LL(LBS_DEB_USB, fmt, ##args) -#define lbs_deb_usbd(dev, fmt, args...) LBS_DEB_LL(LBS_DEB_USB, "%s:" fmt, (dev)->bus_id, ##args) -#define lbs_deb_cs(fmt, args...) LBS_DEB_LL(LBS_DEB_CS, fmt, ##args) -#define lbs_deb_thread(fmt, args...) LBS_DEB_LL(LBS_DEB_THREAD, fmt, ##args) +#define DRV_NAME "usb8xxx" #define lbs_pr_info(format, args...) \ printk(KERN_INFO DRV_NAME": " format, ## args) @@ -89,25 +24,37 @@ do { if ((libertas_debug & (grp)) == (grp)) \ printk(KERN_ALERT DRV_NAME": " format, ## args) #ifdef DEBUG +#define lbs_pr_debug(level, format, args...) \ + do { if (libertas_debug >= level) \ + printk(KERN_INFO DRV_NAME": " format, ##args); } while (0) +#define lbs_dev_dbg(level, device, format, args...) \ + lbs_pr_debug(level, "%s: " format, \ + (device)->bus_id , ## args) + static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len) { int i = 0; - if (!(libertas_debug & LBS_DEB_HEX)) + if (!libertas_debug) return; printk(KERN_DEBUG "%s: ", prompt); for (i = 1; i <= len; i++) { - printk("%02x ", (u8) * buf); + printk(KERN_DEBUG "%02x ", (u8) * buf); buf++; } printk("\n"); } #else +#define lbs_pr_debug(level, format, args...) do {} while (0) +#define lbs_dev_dbg(level, device, format, args...) do {} while (0) #define lbs_dbg_hex(x,y,z) do {} while (0) #endif - +#define ENTER() lbs_pr_debug(1, "Enter: %s, %s:%i\n", \ + __FUNCTION__, __FILE__, __LINE__) +#define LEAVE() lbs_pr_debug(1, "Leave: %s, %s:%i\n", \ + __FUNCTION__, __FILE__, __LINE__) /** Buffer Constants */ @@ -127,6 +74,7 @@ static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len) #define MRVDRV_NUM_OF_CMD_BUFFER 10 #define MRVDRV_SIZE_OF_CMD_BUFFER (2 * 1024) #define MRVDRV_MAX_CHANNEL_SIZE 14 +#define MRVDRV_MAX_BSSID_LIST 64 #define MRVDRV_ASSOCIATION_TIME_OUT 255 #define MRVDRV_SNAP_HEADER_LEN 8 @@ -156,13 +104,6 @@ static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len) #define MRVDRV_MAX_BEACON_INTERVAL 1000 #define MRVDRV_BEACON_INTERVAL 100 -/** INT status Bit Definition*/ -#define his_cmddnldrdy 0x01 -#define his_cardevent 0x02 -#define his_cmdupldrdy 0x04 - -#define SBI_EVENT_CAUSE_SHIFT 3 - /** TxPD status */ /* Station firmware use TxPD status field to report final Tx transmit @@ -264,6 +205,8 @@ typedef struct _wlan_adapter wlan_adapter; extern const char libertas_driver_version[]; extern u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE]; +extern u8 libertas_wlan_data_rates[WLAN_SUPPORTED_RATES]; + extern u8 libertas_supported_rates[G_SUPPORTED_RATES]; extern u8 libertas_adhoc_rates_g[G_SUPPORTED_RATES]; @@ -373,8 +316,6 @@ enum SNMP_MIB_VALUE_e { /* Default values for fwt commands. */ #define FWT_DEFAULT_METRIC 0 #define FWT_DEFAULT_DIR 1 -/* Default Rate, 11Mbps */ -#define FWT_DEFAULT_RATE 3 #define FWT_DEFAULT_SSN 0xffffffff #define FWT_DEFAULT_DSN 0 #define FWT_DEFAULT_HOPCOUNT 0 diff --git a/trunk/drivers/net/wireless/libertas/dev.h b/trunk/drivers/net/wireless/libertas/dev.h index 785192b884bc..e8b9020f9bd6 100644 --- a/trunk/drivers/net/wireless/libertas/dev.h +++ b/trunk/drivers/net/wireless/libertas/dev.h @@ -63,11 +63,11 @@ struct wlan_802_11_security { /** Current Basic Service Set State Structure */ struct current_bss_params { + struct bss_descriptor bssdescriptor; /** bssid */ u8 bssid[ETH_ALEN]; /** ssid */ - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len; + struct WLAN_802_11_SSID ssid; /** band */ u8 band; @@ -89,6 +89,31 @@ struct sleep_params { u16 sp_reserved; }; +/** Data structure for the Marvell WLAN device */ +typedef struct _wlan_dev { + /** device name */ + char name[DEV_NAME_LEN]; + /** card pointer */ + void *card; + /** IO port */ + u32 ioport; + /** Upload received */ + u32 upld_rcv; + /** Upload type */ + u32 upld_typ; + /** Upload length */ + u32 upld_len; + /** netdev pointer */ + struct net_device *netdev; + /* Upload buffer */ + u8 upld_buf[WLAN_UPLD_SIZE]; + /* Download sent: + bit0 1/0=data_sent/data_tx_done, + bit1 1/0=cmd_sent/cmd_tx_done, + all other bits reserved 0 */ + u8 dnld_sent; +} wlan_dev_t, *pwlan_dev_t; + /* Mesh statistics */ struct wlan_mesh_stats { u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */ @@ -98,7 +123,6 @@ struct wlan_mesh_stats { u32 fwd_drop_noroute; /* Fwd: No route to Destination */ u32 fwd_drop_nobuf; /* Fwd: Run out of internal buffers */ u32 drop_blind; /* Rx: Dropped by blinding table */ - u32 tx_failed_cnt; /* Tx: Failed transmissions */ }; /** Private structure for the MV device */ @@ -107,11 +131,8 @@ struct _wlan_private { int mesh_open; int infra_open; - char name[DEV_NAME_LEN]; - - void *card; wlan_adapter *adapter; - struct net_device *dev; + wlan_dev_t wlan_dev; struct net_device_stats stats; struct net_device *mesh_dev ; /* Virtual device */ @@ -132,16 +153,6 @@ struct _wlan_private { u32 bbp_offset; u32 rf_offset; - /** Upload length */ - u32 upld_len; - /* Upload buffer */ - u8 upld_buf[WLAN_UPLD_SIZE]; - /* Download sent: - bit0 1/0=data_sent/data_tx_done, - bit1 1/0=cmd_sent/cmd_tx_done, - all other bits reserved 0 */ - u8 dnld_sent; - const struct firmware *firmware; struct device *hotplug_device; @@ -150,15 +161,6 @@ struct _wlan_private { struct delayed_work assoc_work; struct workqueue_struct *assoc_thread; - struct work_struct sync_channel; - - /** Hardware access */ - int (*hw_register_dev) (wlan_private * priv); - int (*hw_unregister_dev) (wlan_private *); - int (*hw_prog_firmware) (wlan_private *); - int (*hw_host_to_card) (wlan_private * priv, u8 type, u8 * payload, u16 nb); - int (*hw_get_int_status) (wlan_private * priv, u8 *); - int (*hw_read_event_cause) (wlan_private *); }; /** Association request @@ -169,21 +171,18 @@ struct _wlan_private { struct assoc_request { #define ASSOC_FLAG_SSID 1 #define ASSOC_FLAG_CHANNEL 2 -#define ASSOC_FLAG_BAND 3 -#define ASSOC_FLAG_MODE 4 -#define ASSOC_FLAG_BSSID 5 -#define ASSOC_FLAG_WEP_KEYS 6 -#define ASSOC_FLAG_WEP_TX_KEYIDX 7 -#define ASSOC_FLAG_WPA_MCAST_KEY 8 -#define ASSOC_FLAG_WPA_UCAST_KEY 9 -#define ASSOC_FLAG_SECINFO 10 -#define ASSOC_FLAG_WPA_IE 11 +#define ASSOC_FLAG_MODE 3 +#define ASSOC_FLAG_BSSID 4 +#define ASSOC_FLAG_WEP_KEYS 5 +#define ASSOC_FLAG_WEP_TX_KEYIDX 6 +#define ASSOC_FLAG_WPA_MCAST_KEY 7 +#define ASSOC_FLAG_WPA_UCAST_KEY 8 +#define ASSOC_FLAG_SECINFO 9 +#define ASSOC_FLAG_WPA_IE 10 unsigned long flags; - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len; + struct WLAN_802_11_SSID ssid; u8 channel; - u8 band; u8 mode; u8 bssid[ETH_ALEN]; @@ -200,15 +199,12 @@ struct assoc_request { /** WPA Information Elements*/ u8 wpa_ie[MAX_WPA_IE_LEN]; u8 wpa_ie_len; - - /* BSS to associate with for infrastructure of Ad-Hoc join */ - struct bss_descriptor bss; }; /** Wlan adapter data structure*/ struct _wlan_adapter { /** STATUS variables */ - u8 fwreleasenumber[4]; + u32 fwreleasenumber; u32 fwcapinfo; /* protected with big lock */ @@ -259,14 +255,13 @@ struct _wlan_adapter { /* IW_MODE_* */ u8 mode; - u8 prev_ssid[IW_ESSID_MAX_SIZE + 1]; - u8 prev_ssid_len; - u8 prev_bssid[ETH_ALEN]; + struct bss_descriptor *pattemptedbssdesc; + + struct WLAN_802_11_SSID previousssid; + u8 previousbssid[ETH_ALEN]; - /* Scan results list */ - struct list_head network_list; - struct list_head network_free_list; - struct bss_descriptor *networks; + struct bss_descriptor *scantable; + u32 numinscantable; u8 scantype; u32 scanmode; @@ -293,6 +288,7 @@ struct _wlan_adapter { u32 txantenna; u32 rxantenna; + u8 adhocchannel; u32 fragthsd; u32 rtsthsd; @@ -328,8 +324,7 @@ struct _wlan_adapter { u16 locallisteninterval; u16 nullpktinterval; - struct assoc_request * pending_assoc_req; - struct assoc_request * in_progress_assoc_req; + struct assoc_request * assoc_req; /** Encryption parameter */ struct wlan_802_11_security secinfo; @@ -401,8 +396,6 @@ struct _wlan_adapter { u32 radiomode; u32 debugmode; u8 fw_ready; - - u8 last_scanned_channel; }; #endif /* _WLAN_DEV_H_ */ diff --git a/trunk/drivers/net/wireless/libertas/ethtool.c b/trunk/drivers/net/wireless/libertas/ethtool.c index 96f1974685d4..0064de542963 100644 --- a/trunk/drivers/net/wireless/libertas/ethtool.c +++ b/trunk/drivers/net/wireless/libertas/ethtool.c @@ -1,8 +1,10 @@ + #include #include #include #include "host.h" +#include "sbi.h" #include "decl.h" #include "defs.h" #include "dev.h" @@ -15,8 +17,7 @@ static const char * mesh_stat_strings[]= { "drop_no_buffers", "fwded_unicast_cnt", "fwded_bcast_cnt", - "drop_blind_table", - "tx_failed_cnt" + "drop_blind_table" }; static void libertas_ethtool_get_drvinfo(struct net_device *dev, @@ -68,7 +69,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, /* +14 is for action, offset, and NOB in * response */ - lbs_deb_ethtool("action:%d offset: %x NOB: %02x\n", + lbs_pr_debug(1, "action:%d offset: %x NOB: %02x\n", regctrl.action, regctrl.offset, regctrl.NOB); ret = libertas_prepare_and_send_command(priv, @@ -80,7 +81,8 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, if (ret) { if (adapter->prdeeprom) kfree(adapter->prdeeprom); - goto done; + LEAVE(); + return ret; } mdelay(10); @@ -99,11 +101,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, kfree(adapter->prdeeprom); // mutex_unlock(&priv->mutex); - ret = 0; - -done: - lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret); - return ret; + return 0; } static void libertas_ethtool_get_stats(struct net_device * dev, @@ -111,7 +109,7 @@ static void libertas_ethtool_get_stats(struct net_device * dev, { wlan_private *priv = dev->priv; - lbs_deb_enter(LBS_DEB_ETHTOOL); + ENTER(); stats->cmd = ETHTOOL_GSTATS; BUG_ON(stats->n_stats != MESH_STATS_NUM); @@ -123,9 +121,8 @@ static void libertas_ethtool_get_stats(struct net_device * dev, data[4] = priv->mstats.fwd_unicast_cnt; data[5] = priv->mstats.fwd_bcast_cnt; data[6] = priv->mstats.drop_blind; - data[7] = priv->mstats.tx_failed_cnt; - lbs_deb_enter(LBS_DEB_ETHTOOL); + LEAVE(); } static int libertas_ethtool_get_stats_count(struct net_device * dev) @@ -134,32 +131,27 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev) wlan_private *priv = dev->priv; struct cmd_ds_mesh_access mesh_access; - lbs_deb_enter(LBS_DEB_ETHTOOL); - + ENTER(); /* Get Mesh Statistics */ ret = libertas_prepare_and_send_command(priv, cmd_mesh_access, cmd_act_mesh_get_stats, cmd_option_waitforrsp, 0, &mesh_access); if (ret) { - ret = 0; - goto done; + LEAVE(); + return 0; } - priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]); - priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]); - priv->mstats.fwd_drop_noroute = le32_to_cpu(mesh_access.data[2]); - priv->mstats.fwd_drop_nobuf = le32_to_cpu(mesh_access.data[3]); - priv->mstats.fwd_unicast_cnt = le32_to_cpu(mesh_access.data[4]); - priv->mstats.fwd_bcast_cnt = le32_to_cpu(mesh_access.data[5]); - priv->mstats.drop_blind = le32_to_cpu(mesh_access.data[6]); - priv->mstats.tx_failed_cnt = le32_to_cpu(mesh_access.data[7]); + priv->mstats.fwd_drop_rbt = mesh_access.data[0]; + priv->mstats.fwd_drop_ttl = mesh_access.data[1]; + priv->mstats.fwd_drop_noroute = mesh_access.data[2]; + priv->mstats.fwd_drop_nobuf = mesh_access.data[3]; + priv->mstats.fwd_unicast_cnt = mesh_access.data[4]; + priv->mstats.fwd_bcast_cnt = mesh_access.data[5]; + priv->mstats.drop_blind = mesh_access.data[6]; - ret = MESH_STATS_NUM; - -done: - lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret); - return ret; + LEAVE(); + return MESH_STATS_NUM; } static void libertas_ethtool_get_strings (struct net_device * dev, @@ -168,8 +160,7 @@ static void libertas_ethtool_get_strings (struct net_device * dev, { int i; - lbs_deb_enter(LBS_DEB_ETHTOOL); - + ENTER(); switch (stringset) { case ETH_SS_STATS: for (i=0; i < MESH_STATS_NUM; i++) { @@ -179,7 +170,7 @@ static void libertas_ethtool_get_strings (struct net_device * dev, } break; } - lbs_deb_enter(LBS_DEB_ETHTOOL); + LEAVE(); } struct ethtool_ops libertas_ethtool_ops = { diff --git a/trunk/drivers/net/wireless/libertas/fw.c b/trunk/drivers/net/wireless/libertas/fw.c index 2dc84ff7a54a..5c63c9b1659c 100644 --- a/trunk/drivers/net/wireless/libertas/fw.c +++ b/trunk/drivers/net/wireless/libertas/fw.c @@ -1,15 +1,28 @@ /** * This file contains the initialization for FW and HW */ +#include +#include + +#include #include +#include #include "host.h" +#include "sbi.h" #include "defs.h" #include "decl.h" #include "dev.h" +#include "fw.h" #include "wext.h" #include "if_usb.h" +char *libertas_fw_name = NULL; +module_param_named(fw_name, libertas_fw_name, charp, 0644); + +unsigned int libertas_debug = 0; +module_param(libertas_debug, int, 0); + /** * @brief This function checks the validity of Boot2/FW image. * @@ -19,7 +32,7 @@ */ static int check_fwfile_format(u8 *data, u32 totlen) { - u32 bincmd, exit; + u8 bincmd, exit; u32 blksize, offset, len; int ret; @@ -27,10 +40,8 @@ static int check_fwfile_format(u8 *data, u32 totlen) exit = len = 0; do { - struct fwheader *fwh = (void *)data; - - bincmd = le32_to_cpu(fwh->dnldcmd); - blksize = le32_to_cpu(fwh->datalength); + bincmd = *data; + blksize = *(u32*)(data + offsetof(struct fwheader, datalength)); switch (bincmd) { case FW_HAS_DATA_TO_RECV: offset = sizeof(struct fwheader) + blksize; @@ -50,9 +61,9 @@ static int check_fwfile_format(u8 *data, u32 totlen) } while (!exit); if (ret) - lbs_pr_err("firmware file format check FAIL\n"); + lbs_pr_err("bin file format check FAIL...\n"); else - lbs_deb_fw("firmware file format check PASS\n"); + lbs_pr_debug(1, "bin file format check PASS...\n"); return ret; } @@ -65,31 +76,32 @@ static int check_fwfile_format(u8 *data, u32 totlen) * @param priv A pointer to wlan_private structure * @return 0 or -1 */ -static int wlan_setup_station_hw(wlan_private * priv, char *fw_name) +static int wlan_setup_station_hw(wlan_private * priv) { int ret = -1; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_FW); + ENTER(); - if ((ret = request_firmware(&priv->firmware, fw_name, + if ((ret = request_firmware(&priv->firmware, libertas_fw_name, priv->hotplug_device)) < 0) { - lbs_pr_err("request_firmware() failed with %#x\n", ret); - lbs_pr_err("firmware %s not found\n", fw_name); + lbs_pr_err("request_firmware() failed, error code = %#x\n", + ret); + lbs_pr_err("%s not found in /lib/firmware\n", libertas_fw_name); goto done; } - if (check_fwfile_format(priv->firmware->data, priv->firmware->size)) { + if(check_fwfile_format(priv->firmware->data, priv->firmware->size)) { release_firmware(priv->firmware); goto done; } - ret = priv->hw_prog_firmware(priv); + ret = libertas_sbi_prog_firmware(priv); release_firmware(priv->firmware); if (ret) { - lbs_deb_fw("bootloader in invalid state\n"); + lbs_pr_debug(1, "Bootloader in invalid state!\n"); ret = -1; goto done; } @@ -121,24 +133,28 @@ static int wlan_setup_station_hw(wlan_private * priv, char *fw_name) ret = 0; done: - lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); - return ret; + LEAVE(); + + return (ret); } static int wlan_allocate_adapter(wlan_private * priv) { - size_t bufsize; + u32 ulbufsize; wlan_adapter *adapter = priv->adapter; + struct bss_descriptor *ptempscantable; + /* Allocate buffer to store the BSSID list */ - bufsize = MAX_NETWORK_COUNT * sizeof(struct bss_descriptor); - adapter->networks = kzalloc(bufsize, GFP_KERNEL); - if (!adapter->networks) { - lbs_pr_err("Out of memory allocating beacons\n"); + ulbufsize = sizeof(struct bss_descriptor) * MRVDRV_MAX_BSSID_LIST; + if (!(ptempscantable = kmalloc(ulbufsize, GFP_KERNEL))) { libertas_free_adapter(priv); - return -ENOMEM; + return -1; } + adapter->scantable = ptempscantable; + memset(adapter->scantable, 0, ulbufsize); + /* Allocate the command buffers */ libertas_allocate_cmd_buffer(priv); @@ -186,23 +202,15 @@ static void wlan_init_adapter(wlan_private * priv) adapter->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; adapter->mode = IW_MODE_INFRA; - adapter->pending_assoc_req = NULL; - adapter->in_progress_assoc_req = NULL; - - /* Initialize scan result lists */ - INIT_LIST_HEAD(&adapter->network_free_list); - INIT_LIST_HEAD(&adapter->network_list); - for (i = 0; i < MAX_NETWORK_COUNT; i++) { - list_add_tail(&adapter->networks[i].list, - &adapter->network_free_list); - } + adapter->assoc_req = NULL; + adapter->numinscantable = 0; + adapter->pattemptedbssdesc = NULL; mutex_init(&adapter->lock); adapter->prescan = 1; memset(&adapter->curbssparams, 0, sizeof(adapter->curbssparams)); - adapter->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; /* PnP and power profile */ adapter->surpriseremoved = 0; @@ -222,6 +230,8 @@ static void wlan_init_adapter(wlan_private * priv) memset(&adapter->capinfo, 0, sizeof(adapter->capinfo)); adapter->capinfo.shortpreamble = SHORT_PREAMBLE_ALLOWED; + adapter->adhocchannel = DEFAULT_AD_HOC_CHANNEL; + adapter->psmode = wlan802_11powermodecam; adapter->multipledtim = MRVDRV_DEFAULT_MULTIPLE_DTIM; @@ -249,12 +259,12 @@ static void wlan_init_adapter(wlan_private * priv) static void command_timer_fn(unsigned long data); -int libertas_init_fw(wlan_private * priv, char *fw_name) +int libertas_init_fw(wlan_private * priv) { int ret = -1; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_FW); + ENTER(); /* Allocate adapter structure */ if ((ret = wlan_allocate_adapter(priv)) != 0) @@ -268,7 +278,7 @@ int libertas_init_fw(wlan_private * priv, char *fw_name) (unsigned long)priv); /* download fimrware etc. */ - if ((ret = wlan_setup_station_hw(priv, fw_name)) != 0) { + if ((ret = wlan_setup_station_hw(priv)) != 0) { del_timer_sync(&adapter->command_timer); goto done; } @@ -278,7 +288,7 @@ int libertas_init_fw(wlan_private * priv, char *fw_name) ret = 0; done: - lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); + LEAVE(); return ret; } @@ -287,22 +297,25 @@ void libertas_free_adapter(wlan_private * priv) wlan_adapter *adapter = priv->adapter; if (!adapter) { - lbs_deb_fw("why double free adapter?\n"); + lbs_pr_debug(1, "Why double free adapter?:)\n"); return; } - lbs_deb_fw("free command buffer\n"); + lbs_pr_debug(1, "Free command buffer\n"); libertas_free_cmd_buffer(priv); - lbs_deb_fw("free command_timer\n"); + lbs_pr_debug(1, "Free commandTimer\n"); del_timer(&adapter->command_timer); - lbs_deb_fw("free scan results table\n"); - kfree(adapter->networks); - adapter->networks = NULL; + lbs_pr_debug(1, "Free scantable\n"); + if (adapter->scantable) { + kfree(adapter->scantable); + adapter->scantable = NULL; + } + + lbs_pr_debug(1, "Free adapter\n"); /* Free the adapter object itself */ - lbs_deb_fw("free adapter\n"); kfree(adapter); priv->adapter = NULL; } @@ -321,17 +334,17 @@ static void command_timer_fn(unsigned long data) ptempnode = adapter->cur_cmd; if (ptempnode == NULL) { - lbs_deb_fw("ptempnode empty\n"); + lbs_pr_debug(1, "PTempnode Empty\n"); return; } cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr; if (!cmd) { - lbs_deb_fw("cmd is NULL\n"); + lbs_pr_debug(1, "cmd is NULL\n"); return; } - lbs_deb_fw("command_timer_fn fired, cmd %x\n", cmd->command); + lbs_pr_info("command_timer_fn fired (%x)\n", cmd->command); if (!adapter->fw_ready) return; @@ -340,7 +353,7 @@ static void command_timer_fn(unsigned long data) adapter->cur_cmd = NULL; spin_unlock_irqrestore(&adapter->driver_lock, flags); - lbs_deb_fw("re-sending same command because of timeout\n"); + lbs_pr_debug(1, "Re-sending same command as it timeout...!\n"); libertas_queue_cmd(adapter, ptempnode, 0); wake_up_interruptible(&priv->mainthread.waitq); diff --git a/trunk/drivers/net/wireless/libertas/fw.h b/trunk/drivers/net/wireless/libertas/fw.h new file mode 100644 index 000000000000..1f9ae267a9e0 --- /dev/null +++ b/trunk/drivers/net/wireless/libertas/fw.h @@ -0,0 +1,13 @@ +/** + * This header file contains FW interface related definitions. + */ +#ifndef _WLAN_FW_H_ +#define _WLAN_FW_H_ + +#ifndef DEV_NAME_LEN +#define DEV_NAME_LEN 32 +#endif + +int libertas_init_fw(wlan_private * priv); + +#endif /* _WLAN_FW_H_ */ diff --git a/trunk/drivers/net/wireless/libertas/host.h b/trunk/drivers/net/wireless/libertas/host.h index 7509cc10af3c..c0faaecaf5be 100644 --- a/trunk/drivers/net/wireless/libertas/host.h +++ b/trunk/drivers/net/wireless/libertas/host.h @@ -99,11 +99,11 @@ #define cmd_bt_access 0x0087 #define cmd_ret_bt_access 0x8087 -#define cmd_fwt_access 0x0095 -#define cmd_ret_fwt_access 0x8095 +#define cmd_fwt_access 0x0088 +#define cmd_ret_fwt_access 0x8088 -#define cmd_mesh_access 0x009b -#define cmd_ret_mesh_access 0x809b +#define cmd_mesh_access 0x0090 +#define cmd_ret_mesh_access 0x8090 /* For the IEEE Power Save */ #define cmd_subcmd_enter_ps 0x0030 @@ -287,9 +287,7 @@ enum cmd_bt_access_opts { cmd_act_bt_access_add = 5, cmd_act_bt_access_del, cmd_act_bt_access_list, - cmd_act_bt_access_reset, - cmd_act_bt_access_set_invert, - cmd_act_bt_access_get_invert + cmd_act_bt_access_reset }; /* Define action or option for cmd_fwt_access */ @@ -310,8 +308,8 @@ enum cmd_mesh_access_opts { cmd_act_mesh_get_ttl = 1, cmd_act_mesh_set_ttl, cmd_act_mesh_get_stats, - cmd_act_mesh_get_anycast, - cmd_act_mesh_set_anycast, + cmd_act_mesh_get_mpp, + cmd_act_mesh_set_mpp, }; /** Card Event definition */ @@ -336,6 +334,5 @@ enum cmd_mesh_access_opts { #define MACREG_INT_CODE_MAX_FAIL 0x0000001b #define MACREG_INT_CODE_RSSI_HIGH 0x0000001c #define MACREG_INT_CODE_SNR_HIGH 0x0000001d -#define MACREG_INT_CODE_MESH_AUTO_STARTED 0x00000023 #endif /* _HOST_H_ */ diff --git a/trunk/drivers/net/wireless/libertas/hostcmd.h b/trunk/drivers/net/wireless/libertas/hostcmd.h index 3acf93988125..f239e5d2435b 100644 --- a/trunk/drivers/net/wireless/libertas/hostcmd.h +++ b/trunk/drivers/net/wireless/libertas/hostcmd.h @@ -14,12 +14,12 @@ /* TxPD descriptor */ struct txpd { /* Current Tx packet status */ - __le32 tx_status; + u32 tx_status; /* Tx control */ - __le32 tx_control; - __le32 tx_packet_location; + u32 tx_control; + u32 tx_packet_location; /* Tx packet length */ - __le16 tx_packet_length; + u16 tx_packet_length; /* First 2 byte of destination MAC address */ u8 tx_dest_addr_high[2]; /* Last 4 byte of destination MAC address */ @@ -37,7 +37,7 @@ struct txpd { /* RxPD Descriptor */ struct rxpd { /* Current Rx packet status */ - __le16 status; + u16 status; /* SNR */ u8 snr; @@ -46,7 +46,7 @@ struct rxpd { u8 rx_control; /* Pkt length */ - __le16 pkt_len; + u16 pkt_len; /* Noise Floor */ u8 nf; @@ -55,10 +55,10 @@ struct rxpd { u8 rx_rate; /* Pkt addr */ - __le32 pkt_ptr; + u32 pkt_ptr; /* Next Rx RxPD addr */ - __le32 next_rxpd_ptr; + u32 next_rxpd_ptr; /* Pkt Priority */ u8 priority; @@ -89,17 +89,30 @@ struct cmd_ctrl_node { * is determined from the keylength field. */ struct WLAN_802_11_KEY { - __le32 len; - __le32 flags; /* KEY_INFO_* from wlan_defs.h */ + u32 len; + u32 flags; /* KEY_INFO_* from wlan_defs.h */ u8 key[MRVL_MAX_KEY_WPA_KEY_LENGTH]; - __le16 type; /* KEY_TYPE_* from wlan_defs.h */ + u16 type; /* KEY_TYPE_* from wlan_defs.h */ }; struct IE_WPA { u8 elementid; u8 len; u8 oui[4]; - __le16 version; + u16 version; +}; + +struct WLAN_802_11_SSID { + /* SSID length */ + u32 ssidlength; + + /* SSID information field */ + u8 ssid[IW_ESSID_MAX_SIZE]; +}; + +struct WPA_SUPPLICANT { + u8 wpa_ie[256]; + u8 wpa_ie_len; }; /* wlan_offset_value */ @@ -109,9 +122,9 @@ struct wlan_offset_value { }; struct WLAN_802_11_FIXED_IEs { - __le64 timestamp; - __le16 beaconinterval; - u16 capabilities; /* Actually struct ieeetypes_capinfo */ + u8 timestamp[8]; + u16 beaconinterval; + u16 capabilities; }; struct WLAN_802_11_VARIABLE_IEs { @@ -123,10 +136,10 @@ struct WLAN_802_11_VARIABLE_IEs { /* Define general data structure */ /* cmd_DS_GEN */ struct cmd_ds_gen { - __le16 command; - __le16 size; - __le16 seqnum; - __le16 result; + u16 command; + u16 size; + u16 seqnum; + u16 result; }; #define S_DS_GEN sizeof(struct cmd_ds_gen) @@ -136,44 +149,44 @@ struct cmd_ds_gen { */ struct cmd_ds_get_hw_spec { /* HW Interface version number */ - __le16 hwifversion; + u16 hwifversion; /* HW version number */ - __le16 version; + u16 version; /* Max number of TxPD FW can handle */ - __le16 nr_txpd; + u16 nr_txpd; /* Max no of Multicast address */ - __le16 nr_mcast_adr; + u16 nr_mcast_adr; /* MAC address */ u8 permanentaddr[6]; /* region Code */ - __le16 regioncode; + u16 regioncode; /* Number of antenna used */ - __le16 nr_antenna; + u16 nr_antenna; - /* FW release number, example 1,2,3,4 = 3.2.1p4 */ - u8 fwreleasenumber[4]; + /* FW release number, example 0x1234=1.2.3.4 */ + u32 fwreleasenumber; /* Base Address of TxPD queue */ - __le32 wcb_base; + u32 wcb_base; /* Read Pointer of RxPd queue */ - __le32 rxpd_rdptr; + u32 rxpd_rdptr; /* Write Pointer of RxPd queue */ - __le32 rxpd_wrptr; + u32 rxpd_wrptr; /*FW/HW capability */ - __le32 fwcapinfo; + u32 fwcapinfo; } __attribute__ ((packed)); struct cmd_ds_802_11_reset { - __le16 action; + u16 action; }; struct cmd_ds_802_11_subscribe_event { - __le16 action; - __le16 events; + u16 action; + u16 events; }; /* @@ -192,35 +205,35 @@ struct cmd_ds_802_11_scan { }; struct cmd_ds_802_11_scan_rsp { - __le16 bssdescriptsize; + u16 bssdescriptsize; u8 nr_sets; u8 bssdesc_and_tlvbuffer[1]; }; struct cmd_ds_802_11_get_log { - __le32 mcasttxframe; - __le32 failed; - __le32 retry; - __le32 multiretry; - __le32 framedup; - __le32 rtssuccess; - __le32 rtsfailure; - __le32 ackfailure; - __le32 rxfrag; - __le32 mcastrxframe; - __le32 fcserror; - __le32 txframe; - __le32 wepundecryptable; + u32 mcasttxframe; + u32 failed; + u32 retry; + u32 multiretry; + u32 framedup; + u32 rtssuccess; + u32 rtsfailure; + u32 ackfailure; + u32 rxfrag; + u32 mcastrxframe; + u32 fcserror; + u32 txframe; + u32 wepundecryptable; }; struct cmd_ds_mac_control { - __le16 action; - __le16 reserved; + u16 action; + u16 reserved; }; struct cmd_ds_mac_multicast_adr { - __le16 action; - __le16 nr_of_adrs; + u16 action; + u16 nr_of_adrs; u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE]; }; @@ -232,14 +245,14 @@ struct cmd_ds_802_11_authenticate { struct cmd_ds_802_11_deauthenticate { u8 macaddr[6]; - __le16 reasoncode; + u16 reasoncode; }; struct cmd_ds_802_11_associate { u8 peerstaaddr[6]; struct ieeetypes_capinfo capinfo; - __le16 listeninterval; - __le16 bcnperiod; + u16 listeninterval; + u16 bcnperiod; u8 dtimperiod; #if 0 @@ -252,7 +265,7 @@ struct cmd_ds_802_11_associate { struct cmd_ds_802_11_disassociate { u8 destmacaddr[6]; - __le16 reasoncode; + u16 reasoncode; }; struct cmd_ds_802_11_associate_rsp { @@ -266,10 +279,10 @@ struct cmd_ds_802_11_ad_hoc_result { struct cmd_ds_802_11_set_wep { /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */ - __le16 action; + u16 action; /* key Index selected for Tx */ - __le16 keyindex; + u16 keyindex; /* 40, 128bit or TXWEP */ u8 keytype[4]; @@ -277,96 +290,96 @@ struct cmd_ds_802_11_set_wep { }; struct cmd_ds_802_3_get_stat { - __le32 xmitok; - __le32 rcvok; - __le32 xmiterror; - __le32 rcverror; - __le32 rcvnobuffer; - __le32 rcvcrcerror; + u32 xmitok; + u32 rcvok; + u32 xmiterror; + u32 rcverror; + u32 rcvnobuffer; + u32 rcvcrcerror; }; struct cmd_ds_802_11_get_stat { - __le32 txfragmentcnt; - __le32 mcasttxframecnt; - __le32 failedcnt; - __le32 retrycnt; - __le32 Multipleretrycnt; - __le32 rtssuccesscnt; - __le32 rtsfailurecnt; - __le32 ackfailurecnt; - __le32 frameduplicatecnt; - __le32 rxfragmentcnt; - __le32 mcastrxframecnt; - __le32 fcserrorcnt; - __le32 bcasttxframecnt; - __le32 bcastrxframecnt; - __le32 txbeacon; - __le32 rxbeacon; - __le32 wepundecryptable; + u32 txfragmentcnt; + u32 mcasttxframecnt; + u32 failedcnt; + u32 retrycnt; + u32 Multipleretrycnt; + u32 rtssuccesscnt; + u32 rtsfailurecnt; + u32 ackfailurecnt; + u32 frameduplicatecnt; + u32 rxfragmentcnt; + u32 mcastrxframecnt; + u32 fcserrorcnt; + u32 bcasttxframecnt; + u32 bcastrxframecnt; + u32 txbeacon; + u32 rxbeacon; + u32 wepundecryptable; }; struct cmd_ds_802_11_snmp_mib { - __le16 querytype; - __le16 oid; - __le16 bufsize; + u16 querytype; + u16 oid; + u16 bufsize; u8 value[128]; }; struct cmd_ds_mac_reg_map { - __le16 buffersize; + u16 buffersize; u8 regmap[128]; - __le16 reserved; + u16 reserved; }; struct cmd_ds_bbp_reg_map { - __le16 buffersize; + u16 buffersize; u8 regmap[128]; - __le16 reserved; + u16 reserved; }; struct cmd_ds_rf_reg_map { - __le16 buffersize; + u16 buffersize; u8 regmap[64]; - __le16 reserved; + u16 reserved; }; struct cmd_ds_mac_reg_access { - __le16 action; - __le16 offset; - __le32 value; + u16 action; + u16 offset; + u32 value; }; struct cmd_ds_bbp_reg_access { - __le16 action; - __le16 offset; + u16 action; + u16 offset; u8 value; u8 reserved[3]; }; struct cmd_ds_rf_reg_access { - __le16 action; - __le16 offset; + u16 action; + u16 offset; u8 value; u8 reserved[3]; }; struct cmd_ds_802_11_radio_control { - __le16 action; - __le16 control; + u16 action; + u16 control; }; struct cmd_ds_802_11_sleep_params { /* ACT_GET/ACT_SET */ - __le16 action; + u16 action; /* Sleep clock error in ppm */ - __le16 error; + u16 error; /* Wakeup offset in usec */ - __le16 offset; + u16 offset; /* Clock stabilization time in usec */ - __le16 stabletime; + u16 stabletime; /* control periodic calibration */ u8 calcontrol; @@ -375,100 +388,100 @@ struct cmd_ds_802_11_sleep_params { u8 externalsleepclk; /* reserved field, should be set to zero */ - __le16 reserved; + u16 reserved; }; struct cmd_ds_802_11_inactivity_timeout { /* ACT_GET/ACT_SET */ - __le16 action; + u16 action; /* Inactivity timeout in msec */ - __le16 timeout; + u16 timeout; }; struct cmd_ds_802_11_rf_channel { - __le16 action; - __le16 currentchannel; - __le16 rftype; - __le16 reserved; + u16 action; + u16 currentchannel; + u16 rftype; + u16 reserved; u8 channellist[32]; }; struct cmd_ds_802_11_rssi { /* weighting factor */ - __le16 N; + u16 N; - __le16 reserved_0; - __le16 reserved_1; - __le16 reserved_2; + u16 reserved_0; + u16 reserved_1; + u16 reserved_2; }; struct cmd_ds_802_11_rssi_rsp { - __le16 SNR; - __le16 noisefloor; - __le16 avgSNR; - __le16 avgnoisefloor; + u16 SNR; + u16 noisefloor; + u16 avgSNR; + u16 avgnoisefloor; }; struct cmd_ds_802_11_mac_address { - __le16 action; + u16 action; u8 macadd[ETH_ALEN]; }; struct cmd_ds_802_11_rf_tx_power { - __le16 action; - __le16 currentlevel; + u16 action; + u16 currentlevel; }; struct cmd_ds_802_11_rf_antenna { - __le16 action; + u16 action; /* Number of antennas or 0xffff(diversity) */ - __le16 antennamode; + u16 antennamode; }; struct cmd_ds_802_11_ps_mode { - __le16 action; - __le16 nullpktinterval; - __le16 multipledtim; - __le16 reserved; - __le16 locallisteninterval; + u16 action; + u16 nullpktinterval; + u16 multipledtim; + u16 reserved; + u16 locallisteninterval; }; struct PS_CMD_ConfirmSleep { - __le16 command; - __le16 size; - __le16 seqnum; - __le16 result; + u16 command; + u16 size; + u16 seqnum; + u16 result; - __le16 action; - __le16 reserved1; - __le16 multipledtim; - __le16 reserved; - __le16 locallisteninterval; + u16 action; + u16 reserved1; + u16 multipledtim; + u16 reserved; + u16 locallisteninterval; }; struct cmd_ds_802_11_data_rate { - __le16 action; - __le16 reserverd; + u16 action; + u16 reserverd; u8 datarate[G_SUPPORTED_RATES]; }; struct cmd_ds_802_11_rate_adapt_rateset { - __le16 action; - __le16 enablehwauto; - __le16 bitmap; + u16 action; + u16 enablehwauto; + u16 bitmap; }; struct cmd_ds_802_11_ad_hoc_start { u8 SSID[IW_ESSID_MAX_SIZE]; u8 bsstype; - __le16 beaconperiod; + u16 beaconperiod; u8 dtimperiod; union IEEEtypes_ssparamset ssparamset; union ieeetypes_phyparamset phyparamset; - __le16 probedelay; + u16 probedelay; struct ieeetypes_capinfo cap; u8 datarate[G_SUPPORTED_RATES]; u8 tlv_memory_size_pad[100]; @@ -478,10 +491,10 @@ struct adhoc_bssdesc { u8 BSSID[6]; u8 SSID[32]; u8 bsstype; - __le16 beaconperiod; + u16 beaconperiod; u8 dtimperiod; - __le64 timestamp; - __le64 localtime; + u8 timestamp[8]; + u8 localtime[8]; union ieeetypes_phyparamset phyparamset; union IEEEtypes_ssparamset ssparamset; struct ieeetypes_capinfo cap; @@ -495,52 +508,52 @@ struct adhoc_bssdesc { struct cmd_ds_802_11_ad_hoc_join { struct adhoc_bssdesc bssdescriptor; - __le16 failtimeout; - __le16 probedelay; + u16 failtimeout; + u16 probedelay; } __attribute__ ((packed)); struct cmd_ds_802_11_enable_rsn { - __le16 action; - __le16 enable; + u16 action; + u16 enable; }; struct MrvlIEtype_keyParamSet { /* type ID */ - __le16 type; + u16 type; /* length of Payload */ - __le16 length; + u16 length; /* type of key: WEP=0, TKIP=1, AES=2 */ - __le16 keytypeid; + u16 keytypeid; /* key control Info specific to a keytypeid */ - __le16 keyinfo; + u16 keyinfo; /* length of key */ - __le16 keylen; + u16 keylen; /* key material of size keylen */ u8 key[32]; }; struct cmd_ds_802_11_key_material { - __le16 action; + u16 action; struct MrvlIEtype_keyParamSet keyParamSet[2]; } __attribute__ ((packed)); struct cmd_ds_802_11_eeprom_access { - __le16 action; + u16 action; /* multiple 4 */ - __le16 offset; - __le16 bytecount; + u16 offset; + u16 bytecount; u8 value; } __attribute__ ((packed)); struct cmd_ds_802_11_tpc_cfg { - __le16 action; + u16 action; u8 enable; s8 P0; s8 P1; @@ -549,13 +562,13 @@ struct cmd_ds_802_11_tpc_cfg { } __attribute__ ((packed)); struct cmd_ds_802_11_led_ctrl { - __le16 action; - __le16 numled; + u16 action; + u16 numled; u8 data[256]; } __attribute__ ((packed)); struct cmd_ds_802_11_pwr_cfg { - __le16 action; + u16 action; u8 enable; s8 PA_P0; s8 PA_P1; @@ -563,21 +576,21 @@ struct cmd_ds_802_11_pwr_cfg { } __attribute__ ((packed)); struct cmd_ds_802_11_afc { - __le16 afc_auto; + u16 afc_auto; union { struct { - __le16 threshold; - __le16 period; + u16 threshold; + u16 period; }; struct { - __le16 timing_offset; /* signed */ - __le16 carrier_offset; /* signed */ + s16 timing_offset; + s16 carrier_offset; }; }; } __attribute__ ((packed)); struct cmd_tx_rate_query { - __le16 txrate; + u16 txrate; } __attribute__ ((packed)); struct cmd_ds_get_tsf { @@ -585,46 +598,41 @@ struct cmd_ds_get_tsf { } __attribute__ ((packed)); struct cmd_ds_bt_access { - __le16 action; - __le32 id; + u16 action; + u32 id; u8 addr1[ETH_ALEN]; u8 addr2[ETH_ALEN]; } __attribute__ ((packed)); struct cmd_ds_fwt_access { - __le16 action; - __le32 id; - u8 valid; + u16 action; + u32 id; u8 da[ETH_ALEN]; u8 dir; u8 ra[ETH_ALEN]; - __le32 ssn; - __le32 dsn; - __le32 metric; - u8 rate; + u32 ssn; + u32 dsn; + u32 metric; u8 hopcount; u8 ttl; - __le32 expiration; + u32 expiration; u8 sleepmode; - __le32 snr; - __le32 references; - u8 prec[ETH_ALEN]; + u32 snr; + u32 references; } __attribute__ ((packed)); +#define MESH_STATS_NUM 7 struct cmd_ds_mesh_access { - __le16 action; - __le32 data[32]; /* last position reserved */ + u16 action; + u32 data[MESH_STATS_NUM + 1]; /* last position reserved */ } __attribute__ ((packed)); -/* Number of stats counters returned by the firmware */ -#define MESH_STATS_NUM 8 - struct cmd_ds_command { /* command header */ - __le16 command; - __le16 size; - __le16 seqnum; - __le16 result; + u16 command; + u16 size; + u16 seqnum; + u16 result; /* command Body */ union { diff --git a/trunk/drivers/net/wireless/libertas/if_bootcmd.c b/trunk/drivers/net/wireless/libertas/if_bootcmd.c index 8bca306ffad9..567000c3e87b 100644 --- a/trunk/drivers/net/wireless/libertas/if_bootcmd.c +++ b/trunk/drivers/net/wireless/libertas/if_bootcmd.c @@ -8,8 +8,6 @@ #include #include -#define DRV_NAME "usb8xxx" - #include "defs.h" #include "dev.h" #include "if_usb.h" @@ -22,12 +20,12 @@ */ int if_usb_issue_boot_command(wlan_private *priv, int ivalue) { - struct usb_card_rec *cardp = priv->card; + struct usb_card_rec *cardp = priv->wlan_dev.card; struct bootcmdstr sbootcmd; int i; /* Prepare command */ - sbootcmd.u32magicnumber = cpu_to_le32(BOOT_CMD_MAGIC_NUMBER); + sbootcmd.u32magicnumber = BOOT_CMD_MAGIC_NUMBER; sbootcmd.u8cmd_tag = ivalue; for (i=0; i<11; i++) sbootcmd.au8dumy[i]=0x00; diff --git a/trunk/drivers/net/wireless/libertas/if_usb.c b/trunk/drivers/net/wireless/libertas/if_usb.c index 998317571ec2..ae6f72a6cdf3 100644 --- a/trunk/drivers/net/wireless/libertas/if_usb.c +++ b/trunk/drivers/net/wireless/libertas/if_usb.c @@ -2,15 +2,12 @@ * This file contains functions used in USB interface module. */ #include -#include #include #include -#include #include -#define DRV_NAME "usb8xxx" - #include "host.h" +#include "sbi.h" #include "decl.h" #include "defs.h" #include "dev.h" @@ -19,24 +16,15 @@ #define MESSAGE_HEADER_LEN 4 static const char usbdriver_name[] = "usb8xxx"; -static u8 *default_fw_name = "usb8388.bin"; - -char *libertas_fw_name = NULL; -module_param_named(fw_name, libertas_fw_name, charp, 0644); - -/* - * We need to send a RESET command to all USB devices before - * we tear down the USB connection. Otherwise we would not - * be able to re-init device the device if the module gets - * loaded again. This is a list of all initialized USB devices, - * for the reset code see if_usb_reset_device() -*/ -static LIST_HEAD(usb_devices); static struct usb_device_id if_usb_table[] = { /* Enter the device signature inside */ - { USB_DEVICE(0x1286, 0x2001) }, - { USB_DEVICE(0x05a3, 0x8388) }, + { + USB_DEVICE(USB8388_VID_1, USB8388_PID_1), + }, + { + USB_DEVICE(USB8388_VID_2, USB8388_PID_2), + }, {} /* Terminating entry */ }; @@ -44,13 +32,6 @@ MODULE_DEVICE_TABLE(usb, if_usb_table); static void if_usb_receive(struct urb *urb); static void if_usb_receive_fwload(struct urb *urb); -static int if_usb_reset_device(wlan_private *priv); -static int if_usb_register_dev(wlan_private * priv); -static int if_usb_unregister_dev(wlan_private *); -static int if_usb_prog_firmware(wlan_private *); -static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb); -static int if_usb_get_int_status(wlan_private * priv, u8 *); -static int if_usb_read_event_cause(wlan_private *); /** * @brief call back function to handle the status of the URB @@ -61,27 +42,23 @@ static void if_usb_write_bulk_callback(struct urb *urb) { wlan_private *priv = (wlan_private *) (urb->context); wlan_adapter *adapter = priv->adapter; - struct net_device *dev = priv->dev; + struct net_device *dev = priv->wlan_dev.netdev; /* handle the transmission complete validations */ if (urb->status != 0) { /* print the failure status number for debug */ - lbs_pr_info("URB in failure status: %d\n", urb->status); + lbs_pr_info("URB in failure status\n"); } else { - /* - lbs_deb_usbd(&urb->dev->dev, "URB status is successfull\n"); - lbs_deb_usbd(&urb->dev->dev, "Actual length transmitted %d\n", + lbs_dev_dbg(2, &urb->dev->dev, "URB status is successfull\n"); + lbs_dev_dbg(2, &urb->dev->dev, "Actual length transmitted %d\n", urb->actual_length); - */ - priv->dnld_sent = DNLD_RES_RECEIVED; + priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; /* Wake main thread if commands are pending */ if (!adapter->cur_cmd) wake_up_interruptible(&priv->mainthread.waitq); - if ((adapter->connect_status == libertas_connected)) { + if ((adapter->connect_status == libertas_connected)) netif_wake_queue(dev); - netif_wake_queue(priv->mesh_dev); - } } return; @@ -94,7 +71,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) */ void if_usb_free(struct usb_card_rec *cardp) { - lbs_deb_enter(LBS_DEB_USB); + ENTER(); /* Unlink tx & rx urb */ usb_kill_urb(cardp->tx_urb); @@ -109,7 +86,8 @@ void if_usb_free(struct usb_card_rec *cardp) kfree(cardp->bulk_out_buffer); cardp->bulk_out_buffer = NULL; - lbs_deb_leave(LBS_DEB_USB); + LEAVE(); + return; } /** @@ -124,27 +102,27 @@ static int if_usb_probe(struct usb_interface *intf, struct usb_device *udev; struct usb_host_interface *iface_desc; struct usb_endpoint_descriptor *endpoint; - wlan_private *priv; - struct usb_card_rec *cardp; + wlan_private *pwlanpriv; + struct usb_card_rec *usb_cardp; int i; udev = interface_to_usbdev(intf); - cardp = kzalloc(sizeof(struct usb_card_rec), GFP_KERNEL); - if (!cardp) { + usb_cardp = kzalloc(sizeof(struct usb_card_rec), GFP_KERNEL); + if (!usb_cardp) { lbs_pr_err("Out of memory allocating private data.\n"); goto error; } - cardp->udev = udev; + usb_cardp->udev = udev; iface_desc = intf->cur_altsetting; - lbs_deb_usbd(&udev->dev, "bcdUSB = 0x%X bDeviceClass = 0x%X" + lbs_dev_dbg(1, &udev->dev, "bcdUSB = 0x%X bDeviceClass = 0x%X" " bDeviceSubClass = 0x%X, bDeviceProtocol = 0x%X\n", - le16_to_cpu(udev->descriptor.bcdUSB), - udev->descriptor.bDeviceClass, - udev->descriptor.bDeviceSubClass, - udev->descriptor.bDeviceProtocol); + udev->descriptor.bcdUSB, + udev->descriptor.bDeviceClass, + udev->descriptor.bDeviceSubClass, + udev->descriptor.bDeviceProtocol); for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { endpoint = &iface_desc->endpoint[i].desc; @@ -152,21 +130,23 @@ static int if_usb_probe(struct usb_interface *intf, && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK)) { /* we found a bulk in endpoint */ - lbs_deb_usbd(&udev->dev, "Bulk in size is %d\n", - le16_to_cpu(endpoint->wMaxPacketSize)); - if (!(cardp->rx_urb = usb_alloc_urb(0, GFP_KERNEL))) { - lbs_deb_usbd(&udev->dev, + lbs_dev_dbg(1, &udev->dev, "Bulk in size is %d\n", + endpoint->wMaxPacketSize); + if (! + (usb_cardp->rx_urb = + usb_alloc_urb(0, GFP_KERNEL))) { + lbs_dev_dbg(1, &udev->dev, "Rx URB allocation failed\n"); goto dealloc; } - cardp->rx_urb_recall = 0; + usb_cardp->rx_urb_recall = 0; - cardp->bulk_in_size = - le16_to_cpu(endpoint->wMaxPacketSize); - cardp->bulk_in_endpointAddr = + usb_cardp->bulk_in_size = + endpoint->wMaxPacketSize; + usb_cardp->bulk_in_endpointAddr = (endpoint-> bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); - lbs_deb_usbd(&udev->dev, "in_endpoint = %d\n", + lbs_dev_dbg(1, &udev->dev, "in_endpoint = %d\n", endpoint->bEndpointAddress); } @@ -176,63 +156,55 @@ static int if_usb_probe(struct usb_interface *intf, && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK)) { /* We found bulk out endpoint */ - if (!(cardp->tx_urb = usb_alloc_urb(0, GFP_KERNEL))) { - lbs_deb_usbd(&udev->dev, + if (! + (usb_cardp->tx_urb = + usb_alloc_urb(0, GFP_KERNEL))) { + lbs_dev_dbg(1,&udev->dev, "Tx URB allocation failed\n"); goto dealloc; } - cardp->bulk_out_size = - le16_to_cpu(endpoint->wMaxPacketSize); - lbs_deb_usbd(&udev->dev, - "Bulk out size is %d\n", - le16_to_cpu(endpoint->wMaxPacketSize)); - cardp->bulk_out_endpointAddr = + usb_cardp->bulk_out_size = + endpoint->wMaxPacketSize; + lbs_dev_dbg(1, &udev->dev, + "Bulk out size is %d\n", + endpoint->wMaxPacketSize); + usb_cardp->bulk_out_endpointAddr = endpoint->bEndpointAddress; - lbs_deb_usbd(&udev->dev, "out_endpoint = %d\n", + lbs_dev_dbg(1, &udev->dev, "out_endpoint = %d\n", endpoint->bEndpointAddress); - cardp->bulk_out_buffer = + usb_cardp->bulk_out_buffer = kmalloc(MRVDRV_ETH_TX_PACKET_BUFFER_SIZE, GFP_KERNEL); - if (!cardp->bulk_out_buffer) { - lbs_deb_usbd(&udev->dev, + if (!usb_cardp->bulk_out_buffer) { + lbs_dev_dbg(1, &udev->dev, "Could not allocate buffer\n"); goto dealloc; } } } - if (!(priv = libertas_add_card(cardp, &udev->dev))) - goto dealloc; - - if (libertas_add_mesh(priv, &udev->dev)) - goto err_add_mesh; - - priv->hw_register_dev = if_usb_register_dev; - priv->hw_unregister_dev = if_usb_unregister_dev; - priv->hw_prog_firmware = if_usb_prog_firmware; - priv->hw_host_to_card = if_usb_host_to_card; - priv->hw_get_int_status = if_usb_get_int_status; - priv->hw_read_event_cause = if_usb_read_event_cause; - - if (libertas_activate_card(priv, libertas_fw_name)) - goto err_activate_card; - list_add_tail(&cardp->list, &usb_devices); + /* At this point wlan_add_card() will be called. Don't worry + * about keeping pwlanpriv around since it will be set on our + * usb device data in -> add() -> libertas_sbi_register_dev(). + */ + if (!(pwlanpriv = wlan_add_card(usb_cardp))) + goto dealloc; usb_get_dev(udev); - usb_set_intfdata(intf, cardp); + usb_set_intfdata(intf, usb_cardp); + /* + * return card structure, which can be got back in the + * diconnect function as the ptr + * argument. + */ return 0; -err_activate_card: - libertas_remove_mesh(priv); -err_add_mesh: - free_netdev(priv->dev); - kfree(priv->adapter); dealloc: - if_usb_free(cardp); + if_usb_free(usb_cardp); error: return -ENOMEM; @@ -240,7 +212,8 @@ static int if_usb_probe(struct usb_interface *intf, /** * @brief free resource and cleanup - * @param intf USB interface structure + * @param udev pointer to usb_device + * @param ptr pointer to usb_cardp * @return N/A */ static void if_usb_disconnect(struct usb_interface *intf) @@ -256,12 +229,9 @@ static void if_usb_disconnect(struct usb_interface *intf) */ adapter->surpriseremoved = 1; - list_del(&cardp->list); - /* card is removed and we can call wlan_remove_card */ - lbs_deb_usbd(&cardp->udev->dev, "call remove card\n"); - libertas_remove_mesh(priv); - libertas_remove_card(priv); + lbs_dev_dbg(1, &cardp->udev->dev, "call remove card\n"); + wlan_remove_card(cardp); /* Unlink and free urb */ if_usb_free(cardp); @@ -279,7 +249,7 @@ static void if_usb_disconnect(struct usb_interface *intf) */ static int if_prog_firmware(wlan_private * priv) { - struct usb_card_rec *cardp = priv->card; + struct usb_card_rec *cardp = priv->wlan_dev.card; struct FWData *fwdata; struct fwheader *fwheader; u8 *firmware = priv->firmware->data; @@ -296,10 +266,8 @@ static int if_prog_firmware(wlan_private * priv) cardp->fwseqnum = cardp->lastseqnum - 1; } - /* - lbs_deb_usbd(&cardp->udev->dev, "totalbytes = %d\n", + lbs_dev_dbg(2, &cardp->udev->dev, "totalbytes = %d\n", cardp->totalbytes); - */ memcpy(fwheader, &firmware[cardp->totalbytes], sizeof(struct fwheader)); @@ -307,48 +275,40 @@ static int if_prog_firmware(wlan_private * priv) cardp->fwlastblksent = cardp->totalbytes; cardp->totalbytes += sizeof(struct fwheader); - /* lbs_deb_usbd(&cardp->udev->dev,"Copy Data\n"); */ + lbs_dev_dbg(2, &cardp->udev->dev,"Copy Data\n"); memcpy(fwdata->data, &firmware[cardp->totalbytes], - le32_to_cpu(fwdata->fwheader.datalength)); + fwdata->fwheader.datalength); - /* - lbs_deb_usbd(&cardp->udev->dev, - "Data length = %d\n", le32_to_cpu(fwdata->fwheader.datalength)); - */ + lbs_dev_dbg(2, &cardp->udev->dev, + "Data length = %d\n", fwdata->fwheader.datalength); cardp->fwseqnum = cardp->fwseqnum + 1; - fwdata->seqnum = cpu_to_le32(cardp->fwseqnum); - cardp->lastseqnum = cardp->fwseqnum; - cardp->totalbytes += le32_to_cpu(fwdata->fwheader.datalength); + fwdata->seqnum = cardp->fwseqnum; + cardp->lastseqnum = fwdata->seqnum; + cardp->totalbytes += fwdata->fwheader.datalength; - if (fwheader->dnldcmd == cpu_to_le32(FW_HAS_DATA_TO_RECV)) { - /* - lbs_deb_usbd(&cardp->udev->dev, "There are data to follow\n"); - lbs_deb_usbd(&cardp->udev->dev, + if (fwheader->dnldcmd == FW_HAS_DATA_TO_RECV) { + lbs_dev_dbg(2, &cardp->udev->dev, "There is data to follow\n"); + lbs_dev_dbg(2, &cardp->udev->dev, "seqnum = %d totalbytes = %d\n", cardp->fwseqnum, cardp->totalbytes); - */ memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE); usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE); - } else if (fwdata->fwheader.dnldcmd == cpu_to_le32(FW_HAS_LAST_BLOCK)) { - /* - lbs_deb_usbd(&cardp->udev->dev, + } else if (fwdata->fwheader.dnldcmd == FW_HAS_LAST_BLOCK) { + lbs_dev_dbg(2, &cardp->udev->dev, "Host has finished FW downloading\n"); - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(2, &cardp->udev->dev, "Donwloading FW JUMP BLOCK\n"); - */ memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE); usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE); cardp->fwfinalblk = 1; } - /* - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(2, &cardp->udev->dev, "The firmware download is done size is %d\n", cardp->totalbytes); - */ kfree(fwdata); @@ -358,19 +318,14 @@ static int if_prog_firmware(wlan_private * priv) static int libertas_do_reset(wlan_private *priv) { int ret; - struct usb_card_rec *cardp = priv->card; - - lbs_deb_enter(LBS_DEB_USB); + struct usb_card_rec *cardp = priv->wlan_dev.card; ret = usb_reset_device(cardp->udev); if (!ret) { msleep(10); - if_usb_reset_device(priv); + reset_device(priv); msleep(10); } - - lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret); - return ret; } @@ -384,12 +339,12 @@ static int libertas_do_reset(wlan_private *priv) int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb) { /* pointer to card structure */ - struct usb_card_rec *cardp = priv->card; + struct usb_card_rec *cardp = priv->wlan_dev.card; int ret = -1; /* check if device is removed */ if (priv->adapter->surpriseremoved) { - lbs_deb_usbd(&cardp->udev->dev, "Device removed\n"); + lbs_dev_dbg(1, &cardp->udev->dev, "Device removed\n"); goto tx_ret; } @@ -402,10 +357,10 @@ int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb) if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) { /* transfer failed */ - lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed\n"); + lbs_dev_dbg(1, &cardp->udev->dev, "usb_submit_urb failed\n"); ret = -1; } else { - /* lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb success\n"); */ + lbs_dev_dbg(2, &cardp->udev->dev, "usb_submit_urb success\n"); ret = 0; } @@ -417,7 +372,7 @@ static int __if_usb_submit_rx_urb(wlan_private * priv, void (*callbackfn) (struct urb *urb)) { - struct usb_card_rec *cardp = priv->card; + struct usb_card_rec *cardp = priv->wlan_dev.card; struct sk_buff *skb; struct read_cb_info *rinfo = &cardp->rinfo; int ret = -1; @@ -439,13 +394,13 @@ static int __if_usb_submit_rx_urb(wlan_private * priv, cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET; - /* lbs_deb_usbd(&cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb); */ + lbs_dev_dbg(2, &cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb); if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) { /* handle failure conditions */ - lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed\n"); + lbs_dev_dbg(1, &cardp->udev->dev, "Submit Rx URB failed\n"); ret = -1; } else { - /* lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB success\n"); */ + lbs_dev_dbg(2, &cardp->udev->dev, "Submit Rx URB success\n"); ret = 0; } @@ -468,12 +423,12 @@ static void if_usb_receive_fwload(struct urb *urb) struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; wlan_private *priv = rinfo->priv; struct sk_buff *skb = rinfo->skb; - struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; + struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; struct fwsyncheader *syncfwheader; struct bootcmdrespStr bootcmdresp; if (urb->status) { - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "URB status is failed during fw load\n"); kfree_skb(skb); return; @@ -482,18 +437,18 @@ static void if_usb_receive_fwload(struct urb *urb) if (cardp->bootcmdresp == 0) { memcpy (&bootcmdresp, skb->data + IPFIELD_ALIGN_OFFSET, sizeof(bootcmdresp)); - if (le16_to_cpu(cardp->udev->descriptor.bcdDevice) < 0x3106) { + if (cardp->udev->descriptor.bcdDevice < 0x3106) { kfree_skb(skb); if_usb_submit_rx_urb_fwload(priv); cardp->bootcmdresp = 1; - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "Received valid boot command response\n"); return; } - if (bootcmdresp.u32magicnumber != cpu_to_le32(BOOT_CMD_MAGIC_NUMBER)) { + if (bootcmdresp.u32magicnumber != BOOT_CMD_MAGIC_NUMBER) { lbs_pr_info( "boot cmd response wrong magic number (0x%x)\n", - le32_to_cpu(bootcmdresp.u32magicnumber)); + bootcmdresp.u32magicnumber); } else if (bootcmdresp.u8cmd_tag != BOOT_CMD_FW_BY_USB) { lbs_pr_info( "boot cmd response cmd_tag error (%d)\n", @@ -504,7 +459,7 @@ static void if_usb_receive_fwload(struct urb *urb) bootcmdresp.u8result); } else { cardp->bootcmdresp = 1; - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "Received valid boot command response\n"); } kfree_skb(skb); @@ -514,7 +469,7 @@ static void if_usb_receive_fwload(struct urb *urb) syncfwheader = kmalloc(sizeof(struct fwsyncheader), GFP_ATOMIC); if (!syncfwheader) { - lbs_deb_usbd(&cardp->udev->dev, "Failure to allocate syncfwheader\n"); + lbs_dev_dbg(1, &cardp->udev->dev, "Failure to allocate syncfwheader\n"); kfree_skb(skb); return; } @@ -523,16 +478,14 @@ static void if_usb_receive_fwload(struct urb *urb) sizeof(struct fwsyncheader)); if (!syncfwheader->cmd) { - /* - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(2, &cardp->udev->dev, "FW received Blk with correct CRC\n"); - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(2, &cardp->udev->dev, "FW received Blk seqnum = %d\n", syncfwheader->seqnum); - */ cardp->CRC_OK = 1; } else { - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "FW received Blk with CRC error\n"); cardp->CRC_OK = 0; } @@ -562,7 +515,7 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, { if (recvlength > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + MESSAGE_HEADER_LEN || recvlength < MRVDRV_MIN_PKT_LEN) { - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "Packet length is Invalid\n"); kfree_skb(skb); return; @@ -572,7 +525,7 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, skb_put(skb, recvlength); skb_pull(skb, MESSAGE_HEADER_LEN); libertas_process_rxed_packet(priv, skb); - priv->upld_len = (recvlength - MESSAGE_HEADER_LEN); + priv->wlan_dev.upld_len = (recvlength - MESSAGE_HEADER_LEN); } static inline void process_cmdrequest(int recvlength, u8 *recvbuff, @@ -582,7 +535,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff, { u8 *cmdbuf; if (recvlength > MRVDRV_SIZE_OF_CMD_BUFFER) { - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "The receive buffer is too large\n"); kfree_skb(skb); return; @@ -595,21 +548,21 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff, /* take care of cur_cmd = NULL case by reading the * data to clear the interrupt */ if (!priv->adapter->cur_cmd) { - cmdbuf = priv->upld_buf; + cmdbuf = priv->wlan_dev.upld_buf; priv->adapter->hisregcpy &= ~his_cmdupldrdy; } else cmdbuf = priv->adapter->cur_cmd->bufvirtualaddr; cardp->usb_int_cause |= his_cmdupldrdy; - priv->upld_len = (recvlength - MESSAGE_HEADER_LEN); + priv->wlan_dev.upld_len = (recvlength - MESSAGE_HEADER_LEN); memcpy(cmdbuf, recvbuff + MESSAGE_HEADER_LEN, - priv->upld_len); + priv->wlan_dev.upld_len); kfree_skb(skb); - libertas_interrupt(priv->dev); + libertas_interrupt(priv->wlan_dev.netdev); spin_unlock(&priv->adapter->driver_lock); - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "Wake up main thread to handle cmd response\n"); return; @@ -627,17 +580,17 @@ static void if_usb_receive(struct urb *urb) struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; wlan_private *priv = rinfo->priv; struct sk_buff *skb = rinfo->skb; - struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; + struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; int recvlength = urb->actual_length; u8 *recvbuff = NULL; u32 recvtype; - lbs_deb_enter(LBS_DEB_USB); + ENTER(); if (recvlength) { if (urb->status) { - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "URB status is failed\n"); kfree_skb(skb); goto setup_for_next; @@ -645,12 +598,12 @@ static void if_usb_receive(struct urb *urb) recvbuff = skb->data + IPFIELD_ALIGN_OFFSET; memcpy(&recvtype, recvbuff, sizeof(u32)); - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "Recv length = 0x%x\n", recvlength); - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "Receive type = 0x%X\n", recvtype); recvtype = le32_to_cpu(recvtype); - lbs_deb_usbd(&cardp->udev->dev, + lbs_dev_dbg(1, &cardp->udev->dev, "Receive type after = 0x%X\n", recvtype); } else if (urb->status) goto rx_exit; @@ -668,18 +621,18 @@ static void if_usb_receive(struct urb *urb) case CMD_TYPE_INDICATION: /* Event cause handling */ spin_lock(&priv->adapter->driver_lock); - cardp->usb_event_cause = le32_to_cpu(*(__le32 *) (recvbuff + MESSAGE_HEADER_LEN)); - lbs_deb_usbd(&cardp->udev->dev,"**EVENT** 0x%X\n", + cardp->usb_event_cause = *(u32 *) (recvbuff + MESSAGE_HEADER_LEN); + lbs_dev_dbg(1, &cardp->udev->dev,"**EVENT** 0x%X\n", cardp->usb_event_cause); if (cardp->usb_event_cause & 0xffff0000) { libertas_send_tx_feedback(priv); spin_unlock(&priv->adapter->driver_lock); break; } - cardp->usb_event_cause <<= 3; + cardp->usb_event_cause = le32_to_cpu(cardp->usb_event_cause) << 3; cardp->usb_int_cause |= his_cardevent; kfree_skb(skb); - libertas_interrupt(priv->dev); + libertas_interrupt(priv->wlan_dev.netdev); spin_unlock(&priv->adapter->driver_lock); goto rx_exit; default: @@ -690,7 +643,8 @@ static void if_usb_receive(struct urb *urb) setup_for_next: if_usb_submit_rx_urb(priv); rx_exit: - lbs_deb_leave(LBS_DEB_USB); + LEAVE(); + return; } /** @@ -701,24 +655,24 @@ static void if_usb_receive(struct urb *urb) * @param len number of bytes * @return 0 or -1 */ -static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb) +int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb) { int ret = -1; u32 tmp; - struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; + struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; - lbs_deb_usbd(&cardp->udev->dev,"*** type = %u\n", type); - lbs_deb_usbd(&cardp->udev->dev,"size after = %d\n", nb); + lbs_dev_dbg(1, &cardp->udev->dev,"*** type = %u\n", type); + lbs_dev_dbg(1, &cardp->udev->dev,"size after = %d\n", nb); if (type == MVMS_CMD) { tmp = cpu_to_le32(CMD_TYPE_REQUEST); - priv->dnld_sent = DNLD_CMD_SENT; + priv->wlan_dev.dnld_sent = DNLD_CMD_SENT; memcpy(cardp->bulk_out_buffer, (u8 *) & tmp, MESSAGE_HEADER_LEN); } else { tmp = cpu_to_le32(CMD_TYPE_DATA); - priv->dnld_sent = DNLD_DATA_SENT; + priv->wlan_dev.dnld_sent = DNLD_DATA_SENT; memcpy(cardp->bulk_out_buffer, (u8 *) & tmp, MESSAGE_HEADER_LEN); } @@ -732,41 +686,39 @@ static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 n } /* called with adapter->driver_lock held */ -static int if_usb_get_int_status(wlan_private * priv, u8 * ireg) +int libertas_sbi_get_int_status(wlan_private * priv, u8 * ireg) { - struct usb_card_rec *cardp = priv->card; + struct usb_card_rec *cardp = priv->wlan_dev.card; *ireg = cardp->usb_int_cause; cardp->usb_int_cause = 0; - lbs_deb_usbd(&cardp->udev->dev,"Int cause is 0x%X\n", *ireg); + lbs_dev_dbg(1, &cardp->udev->dev,"Int cause is 0x%X\n", *ireg); return 0; } -static int if_usb_read_event_cause(wlan_private * priv) +int libertas_sbi_read_event_cause(wlan_private * priv) { - struct usb_card_rec *cardp = priv->card; + struct usb_card_rec *cardp = priv->wlan_dev.card; priv->adapter->eventcause = cardp->usb_event_cause; /* Re-submit rx urb here to avoid event lost issue */ if_usb_submit_rx_urb(priv); return 0; } -static int if_usb_reset_device(wlan_private *priv) +int reset_device(wlan_private *priv) { int ret; - lbs_deb_enter(LBS_DEB_USB); ret = libertas_prepare_and_send_command(priv, cmd_802_11_reset, cmd_act_halt, 0, 0, NULL); msleep_interruptible(10); - lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret); return ret; } -static int if_usb_unregister_dev(wlan_private * priv) +int libertas_sbi_unregister_dev(wlan_private * priv) { int ret = 0; @@ -775,7 +727,7 @@ static int if_usb_unregister_dev(wlan_private * priv) * again. */ if (priv) - if_usb_reset_device(priv); + reset_device(priv); return ret; } @@ -786,41 +738,42 @@ static int if_usb_unregister_dev(wlan_private * priv) * @param priv pointer to wlan_private * @return 0 or -1 */ -static int if_usb_register_dev(wlan_private * priv) +int libertas_sbi_register_dev(wlan_private * priv) { - struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; - lbs_deb_enter(LBS_DEB_USB); + struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; + ENTER(); cardp->priv = priv; - cardp->eth_dev = priv->dev; + cardp->eth_dev = priv->wlan_dev.netdev; priv->hotplug_device = &(cardp->udev->dev); - lbs_deb_usbd(&cardp->udev->dev, "udev pointer is at %p\n", + SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev)); + + lbs_dev_dbg(1, &cardp->udev->dev, "udev pointer is at %p\n", cardp->udev); - lbs_deb_leave(LBS_DEB_USB); + LEAVE(); return 0; } -static int if_usb_prog_firmware(wlan_private * priv) +int libertas_sbi_prog_firmware(wlan_private * priv) { - struct usb_card_rec *cardp = priv->card; + struct usb_card_rec *cardp = priv->wlan_dev.card; int i = 0; static int reset_count = 10; - int ret = 0; - lbs_deb_enter(LBS_DEB_USB); + ENTER(); cardp->rinfo.priv = priv; restart: if (if_usb_submit_rx_urb_fwload(priv) < 0) { - lbs_deb_usbd(&cardp->udev->dev, "URB submission is failed\n"); - ret = -1; - goto done; + lbs_dev_dbg(1, &cardp->udev->dev, "URB submission is failed\n"); + LEAVE(); + return -1; } cardp->bootcmdresp = 0; @@ -858,7 +811,7 @@ static int if_usb_prog_firmware(wlan_private * priv) if_prog_firmware(priv); do { - lbs_deb_usbd(&cardp->udev->dev,"Wlan sched timeout\n"); + lbs_dev_dbg(1, &cardp->udev->dev,"Wlan sched timeout\n"); i++; msleep_interruptible(100); if (priv->adapter->surpriseremoved || i >= 20) @@ -873,8 +826,8 @@ static int if_usb_prog_firmware(wlan_private * priv) } lbs_pr_info("FW download failure, time = %d ms\n", i * 100); - ret = -1; - goto done; + LEAVE(); + return -1; } if_usb_submit_rx_urb(priv); @@ -884,24 +837,45 @@ static int if_usb_prog_firmware(wlan_private * priv) priv->adapter->fw_ready = 1; -done: - lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret); - return ret; + LEAVE(); + return 0; +} + +/** + * @brief Given a usb_card_rec return its wlan_private + * @param card pointer to a usb_card_rec + * @return pointer to wlan_private + */ +wlan_private *libertas_sbi_get_priv(void *card) +{ + struct usb_card_rec *cardp = card; + return cardp->priv; } +#ifdef ENABLE_PM +int libertas_sbi_suspend(wlan_private * priv) +{ + return 0; +} + +int libertas_sbi_resume(wlan_private * priv) +{ + return 0; +} +#endif + #ifdef CONFIG_PM static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) { struct usb_card_rec *cardp = usb_get_intfdata(intf); wlan_private *priv = cardp->priv; - lbs_deb_enter(LBS_DEB_USB); + ENTER(); if (priv->adapter->psstate != PS_STATE_FULL_POWER) return -1; netif_device_detach(cardp->eth_dev); - netif_device_detach(priv->mesh_dev); /* Unlink tx & rx urb */ usb_kill_urb(cardp->tx_urb); @@ -909,25 +883,23 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) cardp->rx_urb_recall = 1; - lbs_deb_leave(LBS_DEB_USB); + LEAVE(); return 0; } static int if_usb_resume(struct usb_interface *intf) { struct usb_card_rec *cardp = usb_get_intfdata(intf); - wlan_private *priv = cardp->priv; - lbs_deb_enter(LBS_DEB_USB); + ENTER(); cardp->rx_urb_recall = 0; if_usb_submit_rx_urb(cardp->priv); netif_device_attach(cardp->eth_dev); - netif_device_attach(priv->mesh_dev); - lbs_deb_leave(LBS_DEB_USB); + LEAVE(); return 0; } #else @@ -948,40 +920,32 @@ static struct usb_driver if_usb_driver = { .resume = if_usb_resume, }; -static int if_usb_init_module(void) +/** + * @brief This function registers driver. + * @param add pointer to add_card callback function + * @param remove pointer to remove card callback function + * @param arg pointer to call back function parameter + * @return dummy success variable + */ +int libertas_sbi_register(void) { - int ret = 0; - - lbs_deb_enter(LBS_DEB_MAIN); - - if (libertas_fw_name == NULL) { - libertas_fw_name = default_fw_name; - } - - ret = usb_register(&if_usb_driver); + /* + * API registers the Marvell USB driver + * to the USB system + */ + usb_register(&if_usb_driver); - lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); - return ret; + /* Return success to wlan layer */ + return 0; } -static void if_usb_exit_module(void) +/** + * @brief This function removes usb driver. + * @return N/A + */ +void libertas_sbi_unregister(void) { - struct usb_card_rec *cardp, *cardp_temp; - - lbs_deb_enter(LBS_DEB_MAIN); - - list_for_each_entry_safe(cardp, cardp_temp, &usb_devices, list) - if_usb_reset_device((wlan_private *) cardp->priv); - /* API unregisters the driver from USB subsystem */ usb_deregister(&if_usb_driver); - - lbs_deb_leave(LBS_DEB_MAIN); + return; } - -module_init(if_usb_init_module); -module_exit(if_usb_exit_module); - -MODULE_DESCRIPTION("8388 USB WLAN Driver"); -MODULE_AUTHOR("Marvell International Ltd."); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/net/wireless/libertas/if_usb.h b/trunk/drivers/net/wireless/libertas/if_usb.h index 156bb485e1a6..170dfe6809f5 100644 --- a/trunk/drivers/net/wireless/libertas/if_usb.h +++ b/trunk/drivers/net/wireless/libertas/if_usb.h @@ -1,8 +1,3 @@ -#ifndef _LIBERTAS_IF_USB_H -#define _LIBERTAS_IF_USB_H - -#include - /** * This file contains definition for USB interface. */ @@ -12,6 +7,11 @@ #define IPFIELD_ALIGN_OFFSET 2 +#define USB8388_VID_1 0x1286 +#define USB8388_PID_1 0x2001 +#define USB8388_VID_2 0x05a3 +#define USB8388_PID_2 0x8388 + #define BOOT_CMD_FW_BY_USB 0x01 #define BOOT_CMD_FW_IN_EEPROM 0x02 #define BOOT_CMD_UPDATE_BOOT2 0x03 @@ -20,7 +20,7 @@ struct bootcmdstr { - __le32 u32magicnumber; + u32 u32magicnumber; u8 u8cmd_tag; u8 au8dumy[11]; }; @@ -30,7 +30,7 @@ struct bootcmdstr struct bootcmdrespStr { - __le32 u32magicnumber; + u32 u32magicnumber; u8 u8cmd_tag; u8 u8result; u8 au8dumy[2]; @@ -44,7 +44,6 @@ struct read_cb_info { /** USB card description structure*/ struct usb_card_rec { - struct list_head list; struct net_device *eth_dev; struct usb_device *udev; struct urb *rx_urb, *tx_urb; @@ -76,34 +75,33 @@ struct usb_card_rec { /** fwheader */ struct fwheader { - __le32 dnldcmd; - __le32 baseaddr; - __le32 datalength; - __le32 CRC; + u32 dnldcmd; + u32 baseaddr; + u32 datalength; + u32 CRC; }; #define FW_MAX_DATA_BLK_SIZE 600 /** FWData */ struct FWData { struct fwheader fwheader; - __le32 seqnum; + u32 seqnum; u8 data[FW_MAX_DATA_BLK_SIZE]; }; /** fwsyncheader */ struct fwsyncheader { - __le32 cmd; - __le32 seqnum; + u32 cmd; + u32 seqnum; }; #define FW_HAS_DATA_TO_RECV 0x00000001 #define FW_HAS_LAST_BLOCK 0x00000004 #define FW_DATA_XMIT_SIZE \ - sizeof(struct fwheader) + le32_to_cpu(fwdata->fwheader.datalength) + sizeof(u32) + sizeof(struct fwheader) + fwdata->fwheader.datalength + sizeof(u32) int usb_tx_block(wlan_private *priv, u8 *payload, u16 nb); void if_usb_free(struct usb_card_rec *cardp); int if_usb_issue_boot_command(wlan_private *priv, int ivalue); -#endif diff --git a/trunk/drivers/net/wireless/libertas/ioctl.c b/trunk/drivers/net/wireless/libertas/ioctl.c index f41081585564..a8f76c358992 100644 --- a/trunk/drivers/net/wireless/libertas/ioctl.c +++ b/trunk/drivers/net/wireless/libertas/ioctl.c @@ -30,7 +30,6 @@ static int wlan_set_region(wlan_private * priv, u16 region_code) { int i; - int ret = 0; for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { // use the region code to search for the index @@ -43,18 +42,17 @@ static int wlan_set_region(wlan_private * priv, u16 region_code) // if it's unidentified region code if (i >= MRVDRV_MAX_REGION_CODE) { - lbs_deb_ioctl("region Code not identified\n"); - ret = -1; - goto done; + lbs_pr_debug(1, "region Code not identified\n"); + LEAVE(); + return -1; } if (libertas_set_regiontable(priv, priv->adapter->regioncode, 0)) { - ret = -EINVAL; + LEAVE(); + return -EINVAL; } -done: - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); - return ret; + return 0; } static inline int hex2int(char c) @@ -127,10 +125,8 @@ static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req) char ethaddrs_str[18]; char *pos; u8 ethaddr[ETH_ALEN]; - int ret; - - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); if (copy_from_user(ethaddrs_str, wrq->u.data.pointer, sizeof(ethaddrs_str))) return -EFAULT; @@ -140,12 +136,11 @@ static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req) return -EINVAL; } - lbs_deb_ioctl("BT: adding %s\n", ethaddrs_str); - ret = libertas_prepare_and_send_command(priv, cmd_bt_access, + lbs_pr_debug(1, "BT: adding %s\n", ethaddrs_str); + LEAVE(); + return (libertas_prepare_and_send_command(priv, cmd_bt_access, cmd_act_bt_access_add, - cmd_option_waitforrsp, 0, ethaddr); - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); - return ret; + cmd_option_waitforrsp, 0, ethaddr)); } /** @@ -161,8 +156,7 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) u8 ethaddr[ETH_ALEN]; char *pos; - lbs_deb_enter(LBS_DEB_IOCTL); - + ENTER(); if (copy_from_user(ethaddrs_str, wrq->u.data.pointer, sizeof(ethaddrs_str))) return -EFAULT; @@ -172,14 +166,13 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) return -EINVAL; } - lbs_deb_ioctl("BT: deleting %s\n", ethaddrs_str); + lbs_pr_debug(1, "BT: deleting %s\n", ethaddrs_str); return (libertas_prepare_and_send_command(priv, cmd_bt_access, cmd_act_bt_access_del, cmd_option_waitforrsp, 0, ethaddr)); - - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -190,7 +183,7 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) */ static int wlan_bt_reset_ioctl(wlan_private * priv) { - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); lbs_pr_alert( "BT: resetting\n"); @@ -199,7 +192,7 @@ static int wlan_bt_reset_ioctl(wlan_private * priv) cmd_act_bt_access_reset, cmd_option_waitforrsp, 0, NULL)); - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -216,17 +209,17 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) struct iwreq *wrq = (struct iwreq *)req; /* used to pass id and store the bt entry returned by the FW */ union { - u32 id; + int id; char addr1addr2[2 * ETH_ALEN]; } param; static char outstr[64]; char *pbuf = outstr; int ret; - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); if (copy_from_user(outstr, wrq->u.data.pointer, sizeof(outstr))) { - lbs_deb_ioctl("Copy from user failed\n"); + lbs_pr_debug(1, "Copy from user failed\n"); return -1; } param.id = simple_strtoul(outstr, NULL, 10); @@ -241,7 +234,7 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) if (ret == 0) { addr1 = param.addr1addr2; - pos = sprintf(pbuf, "BT includes node "); + pos = sprintf(pbuf, "ignoring traffic from "); pbuf += pos; pos = eth_addr2str(addr1, pbuf); pbuf += pos; @@ -253,70 +246,11 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) wrq->u.data.length = strlen(outstr); if (copy_to_user(wrq->u.data.pointer, (char *)outstr, wrq->u.data.length)) { - lbs_deb_ioctl("BT_LIST: Copy to user failed!\n"); + lbs_pr_debug(1, "BT_LIST: Copy to user failed!\n"); return -EFAULT; } - lbs_deb_leave(LBS_DEB_IOCTL); - return 0 ; -} - -/** - * @brief Sets inverted state of blacklist (non-zero if inverted) - * @param priv A pointer to wlan_private structure - * @param req A pointer to ifreq structure - * @return 0 --success, otherwise fail - */ -static int wlan_bt_set_invert_ioctl(wlan_private * priv, struct ifreq *req) -{ - int ret; - struct iwreq *wrq = (struct iwreq *)req; - union { - u32 id; - char addr1addr2[2 * ETH_ALEN]; - } param; - - lbs_deb_enter(LBS_DEB_IOCTL); - - param.id = SUBCMD_DATA(wrq) ; - ret = libertas_prepare_and_send_command(priv, cmd_bt_access, - cmd_act_bt_access_set_invert, - cmd_option_waitforrsp, 0, - (char *)¶m); - if (ret != 0) - return -EFAULT; - lbs_deb_leave(LBS_DEB_IOCTL); - return 0; -} - -/** - * @brief Gets inverted state of blacklist (non-zero if inverted) - * @param priv A pointer to wlan_private structure - * @param req A pointer to ifreq structure - * @return 0 --success, otherwise fail - */ -static int wlan_bt_get_invert_ioctl(wlan_private * priv, struct ifreq *req) -{ - struct iwreq *wrq = (struct iwreq *)req; - int ret; - union { - u32 id; - char addr1addr2[2 * ETH_ALEN]; - } param; - - lbs_deb_enter(LBS_DEB_IOCTL); - - ret = libertas_prepare_and_send_command(priv, cmd_bt_access, - cmd_act_bt_access_get_invert, - cmd_option_waitforrsp, 0, - (char *)¶m); - - if (ret == 0) - wrq->u.param.value = le32_to_cpu(param.id); - else - return -EFAULT; - - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -344,10 +278,8 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) char in_str[128]; static struct cmd_ds_fwt_access fwt_access; char *ptr; - int ret; - - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) return -EFAULT; @@ -365,29 +297,24 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) fwt_access.metric = cpu_to_le32(simple_strtoul(ptr, &ptr, 10)); else - fwt_access.metric = cpu_to_le32(FWT_DEFAULT_METRIC); + fwt_access.metric = FWT_DEFAULT_METRIC; if ((ptr = next_param(ptr))) fwt_access.dir = (u8)simple_strtoul(ptr, &ptr, 10); else fwt_access.dir = FWT_DEFAULT_DIR; - if ((ptr = next_param(ptr))) - fwt_access.rate = (u8) simple_strtoul(ptr, &ptr, 10); - else - fwt_access.rate = FWT_DEFAULT_RATE; - if ((ptr = next_param(ptr))) fwt_access.ssn = cpu_to_le32(simple_strtoul(ptr, &ptr, 10)); else - fwt_access.ssn = cpu_to_le32(FWT_DEFAULT_SSN); + fwt_access.ssn = FWT_DEFAULT_SSN; if ((ptr = next_param(ptr))) fwt_access.dsn = cpu_to_le32(simple_strtoul(ptr, &ptr, 10)); else - fwt_access.dsn = cpu_to_le32(FWT_DEFAULT_DSN); + fwt_access.dsn = FWT_DEFAULT_DSN; if ((ptr = next_param(ptr))) fwt_access.hopcount = simple_strtoul(ptr, &ptr, 10); @@ -403,7 +330,7 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) fwt_access.expiration = cpu_to_le32(simple_strtoul(ptr, &ptr, 10)); else - fwt_access.expiration = cpu_to_le32(FWT_DEFAULT_EXPIRATION); + fwt_access.expiration = FWT_DEFAULT_EXPIRATION; if ((ptr = next_param(ptr))) fwt_access.sleepmode = (u8)simple_strtoul(ptr, &ptr, 10); @@ -414,29 +341,27 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) fwt_access.snr = cpu_to_le32(simple_strtoul(ptr, &ptr, 10)); else - fwt_access.snr = cpu_to_le32(FWT_DEFAULT_SNR); + fwt_access.snr = FWT_DEFAULT_SNR; #ifdef DEBUG { char ethaddr1_str[18], ethaddr2_str[18]; eth_addr2str(fwt_access.da, ethaddr1_str); eth_addr2str(fwt_access.ra, ethaddr2_str); - lbs_deb_ioctl("FWT_ADD: adding (da:%s,%i,ra:%s)\n", ethaddr1_str, + lbs_pr_debug(1, "FWT_ADD: adding (da:%s,%i,ra:%s)\n", ethaddr1_str, fwt_access.dir, ethaddr2_str); - lbs_deb_ioctl("FWT_ADD: ssn:%u dsn:%u met:%u hop:%u ttl:%u exp:%u slp:%u snr:%u\n", + lbs_pr_debug(1, "FWT_ADD: ssn:%u dsn:%u met:%u hop:%u ttl:%u exp:%u slp:%u snr:%u\n", fwt_access.ssn, fwt_access.dsn, fwt_access.metric, fwt_access.hopcount, fwt_access.ttl, fwt_access.expiration, fwt_access.sleepmode, fwt_access.snr); } #endif - ret = libertas_prepare_and_send_command(priv, cmd_fwt_access, - cmd_act_fwt_access_add, - cmd_option_waitforrsp, 0, - (void *)&fwt_access); - - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); - return ret; + LEAVE(); + return (libertas_prepare_and_send_command(priv, cmd_fwt_access, + cmd_act_fwt_access_add, + cmd_option_waitforrsp, 0, + (void *)&fwt_access)); } /** @@ -451,10 +376,8 @@ static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req) char in_str[64]; static struct cmd_ds_fwt_access fwt_access; char *ptr; - int ret; - - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) return -EFAULT; @@ -476,21 +399,20 @@ static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req) #ifdef DEBUG { char ethaddr1_str[18], ethaddr2_str[18]; - lbs_deb_ioctl("FWT_DEL: line is %s\n", in_str); + lbs_pr_debug(1, "FWT_DEL: line is %s\n", in_str); eth_addr2str(fwt_access.da, ethaddr1_str); eth_addr2str(fwt_access.ra, ethaddr2_str); - lbs_deb_ioctl("FWT_DEL: removing (da:%s,ra:%s,dir:%d)\n", ethaddr1_str, + lbs_pr_debug(1, "FWT_DEL: removing (da:%s,ra:%s,dir:%d)\n", ethaddr1_str, ethaddr2_str, fwt_access.dir); } #endif - ret = libertas_prepare_and_send_command(priv, - cmd_fwt_access, - cmd_act_fwt_access_del, - cmd_option_waitforrsp, 0, - (void *)&fwt_access); - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); - return ret; + LEAVE(); + return (libertas_prepare_and_send_command(priv, + cmd_fwt_access, + cmd_act_fwt_access_del, + cmd_option_waitforrsp, 0, + (void *)&fwt_access)); } @@ -505,18 +427,15 @@ static void print_route(struct cmd_ds_fwt_access fwt_access, char *buf) buf += eth_addr2str(fwt_access.da, buf); buf += sprintf(buf, " "); buf += eth_addr2str(fwt_access.ra, buf); - buf += sprintf(buf, " %u", fwt_access.valid); buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.metric)); buf += sprintf(buf, " %u", fwt_access.dir); - buf += sprintf(buf, " %u", fwt_access.rate); buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.ssn)); buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.dsn)); buf += sprintf(buf, " %u", fwt_access.hopcount); buf += sprintf(buf, " %u", fwt_access.ttl); buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.expiration)); buf += sprintf(buf, " %u", fwt_access.sleepmode); - buf += sprintf(buf, " %u ", le32_to_cpu(fwt_access.snr)); - buf += eth_addr2str(fwt_access.prec, buf); + buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.snr)); } /** @@ -534,8 +453,7 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) static char out_str[128]; int ret; - lbs_deb_enter(LBS_DEB_IOCTL); - + ENTER(); if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) return -EFAULT; @@ -547,9 +465,9 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) #ifdef DEBUG { char ethaddr1_str[18]; - lbs_deb_ioctl("FWT_LOOKUP: line is %s\n", in_str); + lbs_pr_debug(1, "FWT_LOOKUP: line is %s\n", in_str); eth_addr2str(fwt_access.da, ethaddr1_str); - lbs_deb_ioctl("FWT_LOOKUP: looking for (da:%s)\n", ethaddr1_str); + lbs_pr_debug(1, "FWT_LOOKUP: looking for (da:%s)\n", ethaddr1_str); } #endif @@ -567,11 +485,11 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) wrq->u.data.length = strlen(out_str); if (copy_to_user(wrq->u.data.pointer, (char *)out_str, wrq->u.data.length)) { - lbs_deb_ioctl("FWT_LOOKUP: Copy to user failed!\n"); + lbs_pr_debug(1, "FWT_LOOKUP: Copy to user failed!\n"); return -EFAULT; } - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -582,7 +500,7 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) */ static int wlan_fwt_reset_ioctl(wlan_private * priv) { - lbs_deb_ioctl("FWT: resetting\n"); + lbs_pr_debug(1, "FWT: resetting\n"); return (libertas_prepare_and_send_command(priv, cmd_fwt_access, @@ -604,21 +522,18 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req) char *ptr = in_str; static char out_str[128]; char *pbuf = out_str; - int ret = 0; - - lbs_deb_enter(LBS_DEB_IOCTL); + int ret; - if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) { - ret = -EFAULT; - goto out; - } + ENTER(); + if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) + return -EFAULT; fwt_access.id = cpu_to_le32(simple_strtoul(ptr, &ptr, 10)); #ifdef DEBUG { - lbs_deb_ioctl("FWT_LIST: line is %s\n", in_str); - lbs_deb_ioctl("FWT_LIST: listing id:%i\n", le32_to_cpu(fwt_access.id)); + lbs_pr_debug(1, "FWT_LIST: line is %s\n", in_str); + lbs_pr_debug(1, "FWT_LIST: listing id:%i\n", le32_to_cpu(fwt_access.id)); } #endif @@ -634,16 +549,12 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req) wrq->u.data.length = strlen(out_str); if (copy_to_user(wrq->u.data.pointer, (char *)out_str, wrq->u.data.length)) { - lbs_deb_ioctl("FWT_LIST: Copy to user failed!\n"); - ret = -EFAULT; - goto out; + lbs_pr_debug(1, "FWT_LIST: Copy to user failed!\n"); + return -EFAULT; } - ret = 0; - -out: - lbs_deb_leave(LBS_DEB_IOCTL); - return ret; + LEAVE(); + return 0; } /** @@ -662,8 +573,7 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) char *pbuf = out_str; int ret; - lbs_deb_enter(LBS_DEB_IOCTL); - + ENTER(); if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) return -EFAULT; @@ -671,8 +581,8 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) #ifdef DEBUG { - lbs_deb_ioctl("FWT_LIST_ROUTE: line is %s\n", in_str); - lbs_deb_ioctl("FWT_LIST_ROUTE: listing id:%i\n", le32_to_cpu(fwt_access.id)); + lbs_pr_debug(1, "FWT_LIST_ROUTE: line is %s\n", in_str); + lbs_pr_debug(1, "FWT_LIST_ROUTE: listing id:%i\n", le32_to_cpu(fwt_access.id)); } #endif @@ -681,18 +591,28 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) cmd_option_waitforrsp, 0, (void *)&fwt_access); if (ret == 0) { - print_route(fwt_access, pbuf); + pbuf += sprintf(pbuf, " "); + pbuf += eth_addr2str(fwt_access.da, pbuf); + pbuf += sprintf(pbuf, " %u", le32_to_cpu(fwt_access.metric)); + pbuf += sprintf(pbuf, " %u", fwt_access.dir); + /* note that the firmware returns the nid in the id field */ + pbuf += sprintf(pbuf, " %u", le32_to_cpu(fwt_access.id)); + pbuf += sprintf(pbuf, " %u", le32_to_cpu(fwt_access.ssn)); + pbuf += sprintf(pbuf, " %u", le32_to_cpu(fwt_access.dsn)); + pbuf += sprintf(pbuf, " hop %u", fwt_access.hopcount); + pbuf += sprintf(pbuf, " ttl %u", fwt_access.ttl); + pbuf += sprintf(pbuf, " %u", le32_to_cpu(fwt_access.expiration)); } else pbuf += sprintf(pbuf, " (null)"); wrq->u.data.length = strlen(out_str); if (copy_to_user(wrq->u.data.pointer, (char *)out_str, wrq->u.data.length)) { - lbs_deb_ioctl("FWT_LIST_ROUTE: Copy to user failed!\n"); + lbs_pr_debug(1, "FWT_LIST_ROUTE: Copy to user failed!\n"); return -EFAULT; } - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -712,8 +632,7 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) char *pbuf = out_str; int ret; - lbs_deb_enter(LBS_DEB_IOCTL); - + ENTER(); if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) return -EFAULT; @@ -722,8 +641,8 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) #ifdef DEBUG { - lbs_deb_ioctl("FWT_LIST_NEIGHBOR: line is %s\n", in_str); - lbs_deb_ioctl("FWT_LIST_NEIGHBOR: listing id:%i\n", le32_to_cpu(fwt_access.id)); + lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: line is %s\n", in_str); + lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: listing id:%i\n", le32_to_cpu(fwt_access.id)); } #endif @@ -744,11 +663,11 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) wrq->u.data.length = strlen(out_str); if (copy_to_user(wrq->u.data.pointer, (char *)out_str, wrq->u.data.length)) { - lbs_deb_ioctl("FWT_LIST_NEIGHBOR: Copy to user failed!\n"); + lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: Copy to user failed!\n"); return -EFAULT; } - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -765,9 +684,9 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) static struct cmd_ds_fwt_access fwt_access; int ret; - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); - lbs_deb_ioctl("FWT: cleaning up\n"); + lbs_pr_debug(1, "FWT: cleaning up\n"); memset(&fwt_access, 0, sizeof(fwt_access)); @@ -781,7 +700,7 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) else return -EFAULT; - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -797,9 +716,9 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) static struct cmd_ds_fwt_access fwt_access; int ret; - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); - lbs_deb_ioctl("FWT: getting time\n"); + lbs_pr_debug(1, "FWT: getting time\n"); memset(&fwt_access, 0, sizeof(fwt_access)); @@ -813,7 +732,7 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) else return -EFAULT; - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -829,7 +748,7 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) struct cmd_ds_mesh_access mesh_access; int ret; - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); memset(&mesh_access, 0, sizeof(mesh_access)); @@ -843,7 +762,7 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) else return -EFAULT; - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return 0; } @@ -858,13 +777,13 @@ static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl) struct cmd_ds_mesh_access mesh_access; int ret; - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); if( (ttl > 0xff) || (ttl < 0) ) return -EINVAL; memset(&mesh_access, 0, sizeof(mesh_access)); - mesh_access.data[0] = cpu_to_le32(ttl); + mesh_access.data[0] = ttl; ret = libertas_prepare_and_send_command(priv, cmd_mesh_access, cmd_act_mesh_set_ttl, @@ -874,7 +793,7 @@ static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl) if (ret != 0) ret = -EFAULT; - lbs_deb_leave(LBS_DEB_IOCTL); + LEAVE(); return ret; } @@ -896,9 +815,9 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) wlan_adapter *adapter = priv->adapter; struct iwreq *wrq = (struct iwreq *)req; - lbs_deb_enter(LBS_DEB_IOCTL); + ENTER(); - lbs_deb_ioctl("libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd); + lbs_pr_debug(1, "libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd); switch (cmd) { case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */ switch (wrq->u.data.flags) { @@ -929,10 +848,6 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ret = wlan_mesh_set_ttl_ioctl(priv, idata); break; - case WLAN_SUBCMD_BT_SET_INVERT: - ret = wlan_bt_set_invert_ioctl(priv, req); - break ; - default: ret = -EOPNOTSUPP; break; @@ -990,10 +905,6 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ret = wlan_mesh_get_ttl_ioctl(priv, req); break; - case WLAN_SUBCMD_BT_GET_INVERT: - ret = wlan_bt_get_invert_ioctl(priv, req); - break ; - default: ret = -EOPNOTSUPP; @@ -1026,7 +937,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) (data, wrq->u.data.pointer, sizeof(int) * wrq->u.data.length)) { - lbs_deb_ioctl( + lbs_pr_debug(1, "Copy from user failed\n"); return -EFAULT; } @@ -1059,7 +970,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) if (copy_to_user(wrq->u.data.pointer, data, sizeof(int) * gpio->header.len)) { - lbs_deb_ioctl("Copy to user failed\n"); + lbs_pr_debug(1, "Copy to user failed\n"); return -EFAULT; } @@ -1073,8 +984,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ret = -EINVAL; break; } - - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); + LEAVE(); return ret; } diff --git a/trunk/drivers/net/wireless/libertas/join.c b/trunk/drivers/net/wireless/libertas/join.c index 78ac3064a0bd..d4926b83e145 100644 --- a/trunk/drivers/net/wireless/libertas/join.c +++ b/trunk/drivers/net/wireless/libertas/join.c @@ -7,7 +7,6 @@ #include #include #include -#include #include @@ -15,7 +14,6 @@ #include "decl.h" #include "join.h" #include "dev.h" -#include "assoc.h" #define AD_HOC_CAP_PRIVACY_ON 1 @@ -62,7 +60,7 @@ static int get_common_rates(wlan_adapter * adapter, u8 * rate1, lbs_dbg_hex("rate1 (AP) rates:", tmp, sizeof(tmp)); lbs_dbg_hex("rate2 (Card) rates:", rate2, rate2_size); lbs_dbg_hex("Common rates:", ptr, rate1_size); - lbs_deb_join("Tx datarate is set to 0x%X\n", adapter->datarate); + lbs_pr_debug(1, "Tx datarate is set to 0x%X\n", adapter->datarate); if (!adapter->is_datarate_auto) { while (*ptr) { @@ -106,22 +104,24 @@ int libertas_send_deauth(wlan_private * priv) * * @return 0-success, otherwise fail */ -int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req) +int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc) { wlan_adapter *adapter = priv->adapter; int ret; - lbs_deb_enter(LBS_DEB_JOIN); + ENTER(); ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate, 0, cmd_option_waitforrsp, - 0, assoc_req->bss.bssid); + 0, pbssdesc->macaddress); - if (ret) - goto done; + if (ret) { + LEAVE(); + return ret; + } /* set preamble to firmware */ - if (adapter->capinfo.shortpreamble && assoc_req->bss.cap.shortpreamble) + if (adapter->capinfo.shortpreamble && pbssdesc->cap.shortpreamble) adapter->preamble = cmd_type_short_preamble; else adapter->preamble = cmd_type_long_preamble; @@ -129,10 +129,9 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req) libertas_set_radio_control(priv); ret = libertas_prepare_and_send_command(priv, cmd_802_11_associate, - 0, cmd_option_waitforrsp, 0, assoc_req); + 0, cmd_option_waitforrsp, 0, pbssdesc); -done: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); + LEAVE(); return ret; } @@ -143,7 +142,7 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req) * @param adhocssid The ssid of the Adhoc Network * @return 0--success, -1--fail */ -int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * assoc_req) +int libertas_start_adhoc_network(wlan_private * priv, struct WLAN_802_11_SSID *adhocssid) { wlan_adapter *adapter = priv->adapter; int ret = 0; @@ -151,20 +150,22 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass adapter->adhoccreate = 1; if (!adapter->capinfo.shortpreamble) { - lbs_deb_join("AdhocStart: Long preamble\n"); + lbs_pr_debug(1, "AdhocStart: Long preamble\n"); adapter->preamble = cmd_type_long_preamble; } else { - lbs_deb_join("AdhocStart: Short preamble\n"); + lbs_pr_debug(1, "AdhocStart: Short preamble\n"); adapter->preamble = cmd_type_short_preamble; } libertas_set_radio_control(priv); - lbs_deb_join("AdhocStart: channel = %d\n", assoc_req->channel); - lbs_deb_join("AdhocStart: band = %d\n", assoc_req->band); + lbs_pr_debug(1, "Adhoc channel = %d\n", adapter->adhocchannel); + lbs_pr_debug(1, "curbssparams.channel = %d\n", + adapter->curbssparams.channel); + lbs_pr_debug(1, "curbssparams.band = %d\n", adapter->curbssparams.band); ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_start, - 0, cmd_option_waitforrsp, 0, assoc_req); + 0, cmd_option_waitforrsp, 0, adhocssid); return ret; } @@ -178,53 +179,52 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass * * @return 0--success, -1--fail */ -int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * assoc_req) +int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbssdesc) { wlan_adapter *adapter = priv->adapter; - struct bss_descriptor * bss = &assoc_req->bss; int ret = 0; - lbs_deb_join("%s: Current SSID '%s', ssid length %u\n", - __func__, - escape_essid(adapter->curbssparams.ssid, - adapter->curbssparams.ssid_len), - adapter->curbssparams.ssid_len); - lbs_deb_join("%s: requested ssid '%s', ssid length %u\n", - __func__, escape_essid(bss->ssid, bss->ssid_len), - bss->ssid_len); + lbs_pr_debug(1, "libertas_join_adhoc_network: CurBss.ssid =%s\n", + adapter->curbssparams.ssid.ssid); + lbs_pr_debug(1, "libertas_join_adhoc_network: CurBss.ssid_len =%u\n", + adapter->curbssparams.ssid.ssidlength); + lbs_pr_debug(1, "libertas_join_adhoc_network: ssid =%s\n", pbssdesc->ssid.ssid); + lbs_pr_debug(1, "libertas_join_adhoc_network: ssid len =%u\n", + pbssdesc->ssid.ssidlength); /* check if the requested SSID is already joined */ - if (adapter->curbssparams.ssid_len - && !libertas_ssid_cmp(adapter->curbssparams.ssid, - adapter->curbssparams.ssid_len, - bss->ssid, bss->ssid_len) + if (adapter->curbssparams.ssid.ssidlength + && !libertas_SSID_cmp(&pbssdesc->ssid, &adapter->curbssparams.ssid) && (adapter->mode == IW_MODE_ADHOC)) { - lbs_deb_join( + + lbs_pr_debug(1, "ADHOC_J_CMD: New ad-hoc SSID is the same as current, " "not attempting to re-join"); + return -1; } /*Use shortpreamble only when both creator and card supports short preamble */ - if (!bss->cap.shortpreamble || !adapter->capinfo.shortpreamble) { - lbs_deb_join("AdhocJoin: Long preamble\n"); + if (!pbssdesc->cap.shortpreamble || !adapter->capinfo.shortpreamble) { + lbs_pr_debug(1, "AdhocJoin: Long preamble\n"); adapter->preamble = cmd_type_long_preamble; } else { - lbs_deb_join("AdhocJoin: Short preamble\n"); + lbs_pr_debug(1, "AdhocJoin: Short preamble\n"); adapter->preamble = cmd_type_short_preamble; } libertas_set_radio_control(priv); - lbs_deb_join("AdhocJoin: channel = %d\n", assoc_req->channel); - lbs_deb_join("AdhocJoin: band = %c\n", assoc_req->band); + lbs_pr_debug(1, "curbssparams.channel = %d\n", + adapter->curbssparams.channel); + lbs_pr_debug(1, "curbssparams.band = %c\n", adapter->curbssparams.band); adapter->adhoccreate = 0; ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_join, 0, cmd_option_waitforrsp, - OID_802_11_SSID, assoc_req); + OID_802_11_SSID, pbssdesc); return ret; } @@ -265,8 +265,6 @@ int libertas_cmd_80211_authenticate(wlan_private * priv, int ret = -1; u8 *bssid = pdata_buf; - lbs_deb_enter(LBS_DEB_JOIN); - cmd->command = cpu_to_le16(cmd_802_11_authenticate); cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate) + S_DS_GEN); @@ -283,19 +281,18 @@ int libertas_cmd_80211_authenticate(wlan_private * priv, pauthenticate->authtype = 0x80; break; default: - lbs_deb_join("AUTH_CMD: invalid auth alg 0x%X\n", + lbs_pr_debug(1, "AUTH_CMD: invalid auth alg 0x%X\n", adapter->secinfo.auth_mode); goto out; } memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); - lbs_deb_join("AUTH_CMD: BSSID is : " MAC_FMT " auth=0x%X\n", - MAC_ARG(bssid), pauthenticate->authtype); + lbs_pr_debug(1, "AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n", + bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]); ret = 0; out: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); return ret; } @@ -305,20 +302,22 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv, wlan_adapter *adapter = priv->adapter; struct cmd_ds_802_11_deauthenticate *dauth = &cmd->params.deauth; - lbs_deb_enter(LBS_DEB_JOIN); + ENTER(); cmd->command = cpu_to_le16(cmd_802_11_deauthenticate); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_deauthenticate) + + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_deauthenticate) + S_DS_GEN); /* set AP MAC address */ - memmove(dauth->macaddr, adapter->curbssparams.bssid, ETH_ALEN); + memmove(dauth->macaddr, adapter->curbssparams.bssid, + ETH_ALEN); /* Reason code 3 = Station is leaving */ #define REASON_CODE_STA_LEAVING 3 dauth->reasoncode = cpu_to_le16(REASON_CODE_STA_LEAVING); - lbs_deb_leave(LBS_DEB_JOIN); + LEAVE(); return 0; } @@ -328,20 +327,20 @@ int libertas_cmd_80211_associate(wlan_private * priv, wlan_adapter *adapter = priv->adapter; struct cmd_ds_802_11_associate *passo = &cmd->params.associate; int ret = 0; - struct assoc_request * assoc_req = pdata_buf; - struct bss_descriptor * bss = &assoc_req->bss; + struct bss_descriptor *pbssdesc; u8 *card_rates; u8 *pos; int card_rates_size; - u16 tmpcap, tmplen; + u16 tmpcap; struct mrvlietypes_ssidparamset *ssid; struct mrvlietypes_phyparamset *phy; struct mrvlietypes_ssparamset *ss; struct mrvlietypes_ratesparamset *rates; struct mrvlietypes_rsnparamset *rsn; - lbs_deb_enter(LBS_DEB_JOIN); + ENTER(); + pbssdesc = pdata_buf; pos = (u8 *) passo; if (!adapter) { @@ -351,11 +350,15 @@ int libertas_cmd_80211_associate(wlan_private * priv, cmd->command = cpu_to_le16(cmd_802_11_associate); - memcpy(passo->peerstaaddr, bss->bssid, sizeof(passo->peerstaaddr)); + /* Save so we know which BSS Desc to use in the response handler */ + adapter->pattemptedbssdesc = pbssdesc; + + memcpy(passo->peerstaaddr, + pbssdesc->macaddress, sizeof(passo->peerstaaddr)); pos += sizeof(passo->peerstaaddr); /* set the listen interval */ - passo->listeninterval = cpu_to_le16(adapter->listeninterval); + passo->listeninterval = adapter->listeninterval; pos += sizeof(passo->capinfo); pos += sizeof(passo->listeninterval); @@ -364,30 +367,30 @@ int libertas_cmd_80211_associate(wlan_private * priv, ssid = (struct mrvlietypes_ssidparamset *) pos; ssid->header.type = cpu_to_le16(TLV_TYPE_SSID); - tmplen = bss->ssid_len; - ssid->header.len = cpu_to_le16(tmplen); - memcpy(ssid->ssid, bss->ssid, tmplen); - pos += sizeof(ssid->header) + tmplen; + ssid->header.len = pbssdesc->ssid.ssidlength; + memcpy(ssid->ssid, pbssdesc->ssid.ssid, ssid->header.len); + pos += sizeof(ssid->header) + ssid->header.len; + ssid->header.len = cpu_to_le16(ssid->header.len); phy = (struct mrvlietypes_phyparamset *) pos; phy->header.type = cpu_to_le16(TLV_TYPE_PHY_DS); - tmplen = sizeof(phy->fh_ds.dsparamset); - phy->header.len = cpu_to_le16(tmplen); + phy->header.len = sizeof(phy->fh_ds.dsparamset); memcpy(&phy->fh_ds.dsparamset, - &bss->phyparamset.dsparamset.currentchan, - tmplen); - pos += sizeof(phy->header) + tmplen; + &pbssdesc->phyparamset.dsparamset.currentchan, + sizeof(phy->fh_ds.dsparamset)); + pos += sizeof(phy->header) + phy->header.len; + phy->header.len = cpu_to_le16(phy->header.len); ss = (struct mrvlietypes_ssparamset *) pos; ss->header.type = cpu_to_le16(TLV_TYPE_CF); - tmplen = sizeof(ss->cf_ibss.cfparamset); - ss->header.len = cpu_to_le16(tmplen); - pos += sizeof(ss->header) + tmplen; + ss->header.len = sizeof(ss->cf_ibss.cfparamset); + pos += sizeof(ss->header) + ss->header.len; + ss->header.len = cpu_to_le16(ss->header.len); rates = (struct mrvlietypes_ratesparamset *) pos; rates->header.type = cpu_to_le16(TLV_TYPE_RATES); - memcpy(&rates->rates, &bss->libertas_supported_rates, WLAN_SUPPORTED_RATES); + memcpy(&rates->rates, &pbssdesc->libertas_supported_rates, WLAN_SUPPORTED_RATES); card_rates = libertas_supported_rates; card_rates_size = sizeof(libertas_supported_rates); @@ -398,42 +401,41 @@ int libertas_cmd_80211_associate(wlan_private * priv, goto done; } - tmplen = min_t(size_t, strlen(rates->rates), WLAN_SUPPORTED_RATES); - adapter->curbssparams.numofrates = tmplen; + rates->header.len = min_t(size_t, strlen(rates->rates), WLAN_SUPPORTED_RATES); + adapter->curbssparams.numofrates = rates->header.len; - pos += sizeof(rates->header) + tmplen; - rates->header.len = cpu_to_le16(tmplen); + pos += sizeof(rates->header) + rates->header.len; + rates->header.len = cpu_to_le16(rates->header.len); - if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { + if (adapter->secinfo.WPAenabled || adapter->secinfo.WPA2enabled) { rsn = (struct mrvlietypes_rsnparamset *) pos; - /* WPA_IE or WPA2_IE */ - rsn->header.type = cpu_to_le16((u16) assoc_req->wpa_ie[0]); - tmplen = (u16) assoc_req->wpa_ie[1]; - rsn->header.len = cpu_to_le16(tmplen); - memcpy(rsn->rsnie, &assoc_req->wpa_ie[2], tmplen); + rsn->header.type = (u16) adapter->wpa_ie[0]; /* WPA_IE or WPA2_IE */ + rsn->header.type = cpu_to_le16(rsn->header.type); + rsn->header.len = (u16) adapter->wpa_ie[1]; + memcpy(rsn->rsnie, &adapter->wpa_ie[2], rsn->header.len); lbs_dbg_hex("ASSOC_CMD: RSN IE", (u8 *) rsn, - sizeof(rsn->header) + tmplen); - pos += sizeof(rsn->header) + tmplen; + sizeof(rsn->header) + rsn->header.len); + pos += sizeof(rsn->header) + rsn->header.len; + rsn->header.len = cpu_to_le16(rsn->header.len); } /* update curbssparams */ - adapter->curbssparams.channel = bss->phyparamset.dsparamset.currentchan; + adapter->curbssparams.channel = + (pbssdesc->phyparamset.dsparamset.currentchan); /* Copy the infra. association rates into Current BSS state structure */ memcpy(&adapter->curbssparams.datarates, &rates->rates, - min_t(size_t, sizeof(adapter->curbssparams.datarates), - cpu_to_le16(rates->header.len))); + min_t(size_t, sizeof(adapter->curbssparams.datarates), rates->header.len)); - lbs_deb_join("ASSOC_CMD: rates->header.len = %d\n", - cpu_to_le16(rates->header.len)); + lbs_pr_debug(1, "ASSOC_CMD: rates->header.len = %d\n", rates->header.len); /* set IBSS field */ - if (bss->mode == IW_MODE_INFRA) { + if (pbssdesc->mode == IW_MODE_INFRA) { #define CAPINFO_ESS_MODE 1 passo->capinfo.ess = CAPINFO_ESS_MODE; } - if (libertas_parse_dnld_countryinfo_11d(priv, bss)) { + if (libertas_parse_dnld_countryinfo_11d(priv)) { ret = -1; goto done; } @@ -441,28 +443,31 @@ int libertas_cmd_80211_associate(wlan_private * priv, cmd->size = cpu_to_le16((u16) (pos - (u8 *) passo) + S_DS_GEN); /* set the capability info at last */ - memcpy(&tmpcap, &bss->cap, sizeof(passo->capinfo)); + memcpy(&tmpcap, &pbssdesc->cap, sizeof(passo->capinfo)); tmpcap &= CAPINFO_MASK; - lbs_deb_join("ASSOC_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", - tmpcap, CAPINFO_MASK); + lbs_pr_debug(1, "ASSOC_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", + tmpcap, CAPINFO_MASK); + tmpcap = cpu_to_le16(tmpcap); memcpy(&passo->capinfo, &tmpcap, sizeof(passo->capinfo)); -done: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); + done: + LEAVE(); return ret; } int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, - struct cmd_ds_command *cmd, void *pdata_buf) + struct cmd_ds_command *cmd, void *pssid) { wlan_adapter *adapter = priv->adapter; struct cmd_ds_802_11_ad_hoc_start *adhs = &cmd->params.ads; int ret = 0; int cmdappendsize = 0; int i; - struct assoc_request * assoc_req = pdata_buf; + u16 tmpcap; + struct bss_descriptor *pbssdesc; + struct WLAN_802_11_SSID *ssid = pssid; - lbs_deb_enter(LBS_DEB_JOIN); + ENTER(); if (!adapter) { ret = -1; @@ -471,6 +476,9 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, cmd->command = cpu_to_le16(cmd_802_11_ad_hoc_start); + pbssdesc = &adapter->curbssparams.bssdescriptor; + adapter->pattemptedbssdesc = pbssdesc; + /* * Fill in the parameters for 2 data structures: * 1. cmd_ds_802_11_ad_hoc_start command @@ -484,16 +492,20 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, */ memset(adhs->SSID, 0, IW_ESSID_MAX_SIZE); - memcpy(adhs->SSID, assoc_req->ssid, assoc_req->ssid_len); - lbs_deb_join("ADHOC_S_CMD: SSID '%s', ssid length %u\n", - escape_essid(assoc_req->ssid, assoc_req->ssid_len), - assoc_req->ssid_len); + memcpy(adhs->SSID, ssid->ssid, ssid->ssidlength); + + lbs_pr_debug(1, "ADHOC_S_CMD: SSID = %s\n", adhs->SSID); + + memset(pbssdesc->ssid.ssid, 0, IW_ESSID_MAX_SIZE); + memcpy(pbssdesc->ssid.ssid, ssid->ssid, ssid->ssidlength); + + pbssdesc->ssid.ssidlength = ssid->ssidlength; /* set the BSS type */ adhs->bsstype = cmd_bss_type_ibss; - adapter->mode = IW_MODE_ADHOC; - adhs->beaconperiod = cpu_to_le16(adapter->beaconperiod); + pbssdesc->mode = IW_MODE_ADHOC; + adhs->beaconperiod = adapter->beaconperiod; /* set Physical param set */ #define DS_PARA_IE_ID 3 @@ -502,12 +514,18 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, adhs->phyparamset.dsparamset.elementid = DS_PARA_IE_ID; adhs->phyparamset.dsparamset.len = DS_PARA_IE_LEN; - WARN_ON(!assoc_req->channel); + WARN_ON(!adapter->adhocchannel); - lbs_deb_join("ADHOC_S_CMD: Creating ADHOC on channel %d\n", - assoc_req->channel); + lbs_pr_debug(1, "ADHOC_S_CMD: Creating ADHOC on channel %d\n", + adapter->adhocchannel); - adhs->phyparamset.dsparamset.currentchan = assoc_req->channel; + adapter->curbssparams.channel = adapter->adhocchannel; + + pbssdesc->channel = adapter->adhocchannel; + adhs->phyparamset.dsparamset.currentchan = adapter->adhocchannel; + + memcpy(&pbssdesc->phyparamset, + &adhs->phyparamset, sizeof(union ieeetypes_phyparamset)); /* set IBSS param set */ #define IBSS_PARA_IE_ID 6 @@ -515,21 +533,26 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, adhs->ssparamset.ibssparamset.elementid = IBSS_PARA_IE_ID; adhs->ssparamset.ibssparamset.len = IBSS_PARA_IE_LEN; - adhs->ssparamset.ibssparamset.atimwindow = cpu_to_le16(adapter->atimwindow); + adhs->ssparamset.ibssparamset.atimwindow = adapter->atimwindow; + memcpy(&pbssdesc->ssparamset, + &adhs->ssparamset, sizeof(union IEEEtypes_ssparamset)); /* set capability info */ adhs->cap.ess = 0; adhs->cap.ibss = 1; + pbssdesc->cap.ibss = 1; /* probedelay */ adhs->probedelay = cpu_to_le16(cmd_scan_probe_delay_time); /* set up privacy in adapter->scantable[i] */ - if (assoc_req->secinfo.wep_enabled) { - lbs_deb_join("ADHOC_S_CMD: WEP enabled, setting privacy on\n"); + if (adapter->secinfo.wep_enabled) { + lbs_pr_debug(1, "ADHOC_S_CMD: WEP enabled, setting privacy on\n"); + pbssdesc->privacy = wlan802_11privfilter8021xWEP; adhs->cap.privacy = AD_HOC_CAP_PRIVACY_ON; } else { - lbs_deb_join("ADHOC_S_CMD: WEP disabled, setting privacy off\n"); + lbs_pr_debug(1, "ADHOC_S_CMD: WEP disabled, setting privacy off\n"); + pbssdesc->privacy = wlan802_11privfilteracceptall; } memset(adhs->datarate, 0, sizeof(adhs->datarate)); @@ -551,24 +574,29 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, memcpy(&adapter->curbssparams.datarates, &adhs->datarate, adapter->curbssparams.numofrates); - lbs_deb_join("ADHOC_S_CMD: rates=%02x %02x %02x %02x \n", + lbs_pr_debug(1, "ADHOC_S_CMD: rates=%02x %02x %02x %02x \n", adhs->datarate[0], adhs->datarate[1], adhs->datarate[2], adhs->datarate[3]); - lbs_deb_join("ADHOC_S_CMD: AD HOC Start command is ready\n"); + lbs_pr_debug(1, "ADHOC_S_CMD: AD HOC Start command is ready\n"); if (libertas_create_dnld_countryinfo_11d(priv)) { - lbs_deb_join("ADHOC_S_CMD: dnld_countryinfo_11d failed\n"); + lbs_pr_debug(1, "ADHOC_S_CMD: dnld_countryinfo_11d failed\n"); ret = -1; goto done; } - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ad_hoc_start) + - S_DS_GEN + cmdappendsize); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_ad_hoc_start) + + S_DS_GEN + cmdappendsize); + + memcpy(&tmpcap, &adhs->cap, sizeof(u16)); + tmpcap = cpu_to_le16(tmpcap); + memcpy(&adhs->cap, &tmpcap, sizeof(u16)); ret = 0; done: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); + LEAVE(); return ret; } @@ -586,8 +614,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, { wlan_adapter *adapter = priv->adapter; struct cmd_ds_802_11_ad_hoc_join *padhocjoin = &cmd->params.adj; - struct assoc_request * assoc_req = pdata_buf; - struct bss_descriptor *bss = &assoc_req->bss; + struct bss_descriptor *pbssdesc = pdata_buf; int cmdappendsize = 0; int ret = 0; u8 *card_rates; @@ -595,59 +622,70 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, u16 tmpcap; int i; - lbs_deb_enter(LBS_DEB_JOIN); + ENTER(); + + adapter->pattemptedbssdesc = pbssdesc; cmd->command = cpu_to_le16(cmd_802_11_ad_hoc_join); padhocjoin->bssdescriptor.bsstype = cmd_bss_type_ibss; - padhocjoin->bssdescriptor.beaconperiod = cpu_to_le16(bss->beaconperiod); + padhocjoin->bssdescriptor.beaconperiod = pbssdesc->beaconperiod; + + memcpy(&padhocjoin->bssdescriptor.BSSID, + &pbssdesc->macaddress, ETH_ALEN); - memcpy(&padhocjoin->bssdescriptor.BSSID, &bss->bssid, ETH_ALEN); - memcpy(&padhocjoin->bssdescriptor.SSID, &bss->ssid, bss->ssid_len); + memcpy(&padhocjoin->bssdescriptor.SSID, + &pbssdesc->ssid.ssid, pbssdesc->ssid.ssidlength); memcpy(&padhocjoin->bssdescriptor.phyparamset, - &bss->phyparamset, sizeof(union ieeetypes_phyparamset)); + &pbssdesc->phyparamset, sizeof(union ieeetypes_phyparamset)); memcpy(&padhocjoin->bssdescriptor.ssparamset, - &bss->ssparamset, sizeof(union IEEEtypes_ssparamset)); + &pbssdesc->ssparamset, sizeof(union IEEEtypes_ssparamset)); - memcpy(&tmpcap, &bss->cap, sizeof(struct ieeetypes_capinfo)); + memcpy(&tmpcap, &pbssdesc->cap, sizeof(struct ieeetypes_capinfo)); tmpcap &= CAPINFO_MASK; - lbs_deb_join("ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", + lbs_pr_debug(1, "ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", tmpcap, CAPINFO_MASK); memcpy(&padhocjoin->bssdescriptor.cap, &tmpcap, sizeof(struct ieeetypes_capinfo)); /* information on BSSID descriptor passed to FW */ - lbs_deb_join( - "ADHOC_J_CMD: BSSID = " MAC_FMT ", SSID = '%s'\n", - MAC_ARG(padhocjoin->bssdescriptor.BSSID), + lbs_pr_debug(1, + "ADHOC_J_CMD: BSSID = %2x-%2x-%2x-%2x-%2x-%2x, SSID = %s\n", + padhocjoin->bssdescriptor.BSSID[0], + padhocjoin->bssdescriptor.BSSID[1], + padhocjoin->bssdescriptor.BSSID[2], + padhocjoin->bssdescriptor.BSSID[3], + padhocjoin->bssdescriptor.BSSID[4], + padhocjoin->bssdescriptor.BSSID[5], padhocjoin->bssdescriptor.SSID); /* failtimeout */ padhocjoin->failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT); /* probedelay */ - padhocjoin->probedelay = cpu_to_le16(cmd_scan_probe_delay_time); + padhocjoin->probedelay = + cpu_to_le16(cmd_scan_probe_delay_time); /* Copy Data rates from the rates recorded in scan response */ memset(padhocjoin->bssdescriptor.datarates, 0, sizeof(padhocjoin->bssdescriptor.datarates)); - memcpy(padhocjoin->bssdescriptor.datarates, bss->datarates, + memcpy(padhocjoin->bssdescriptor.datarates, pbssdesc->datarates, min(sizeof(padhocjoin->bssdescriptor.datarates), - sizeof(bss->datarates))); + sizeof(pbssdesc->datarates))); card_rates = libertas_supported_rates; card_rates_size = sizeof(libertas_supported_rates); - adapter->curbssparams.channel = bss->channel; + adapter->curbssparams.channel = pbssdesc->channel; if (get_common_rates(adapter, padhocjoin->bssdescriptor.datarates, sizeof(padhocjoin->bssdescriptor.datarates), card_rates, card_rates_size)) { - lbs_deb_join("ADHOC_J_CMD: get_common_rates returns error.\n"); + lbs_pr_debug(1, "ADHOC_J_CMD: get_common_rates returns error.\n"); ret = -1; goto done; } @@ -666,17 +704,17 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, adapter->curbssparams.numofrates); padhocjoin->bssdescriptor.ssparamset.ibssparamset.atimwindow = - cpu_to_le16(bss->atimwindow); + cpu_to_le16(pbssdesc->atimwindow); - if (assoc_req->secinfo.wep_enabled) { + if (adapter->secinfo.wep_enabled) { padhocjoin->bssdescriptor.cap.privacy = AD_HOC_CAP_PRIVACY_ON; } if (adapter->psmode == wlan802_11powermodemax_psp) { /* wake up first */ - __le32 Localpsmode; + enum WLAN_802_11_POWER_MODE Localpsmode; - Localpsmode = cpu_to_le32(wlan802_11powermodecam); + Localpsmode = wlan802_11powermodecam; ret = libertas_prepare_and_send_command(priv, cmd_802_11_ps_mode, cmd_act_set, @@ -688,16 +726,24 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, } } - if (libertas_parse_dnld_countryinfo_11d(priv, bss)) { + if (libertas_parse_dnld_countryinfo_11d(priv)) { ret = -1; goto done; } - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ad_hoc_join) + - S_DS_GEN + cmdappendsize); + cmd->size = + cpu_to_le16(sizeof(struct cmd_ds_802_11_ad_hoc_join) + + S_DS_GEN + cmdappendsize); -done: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); + memcpy(&tmpcap, &padhocjoin->bssdescriptor.cap, + sizeof(struct ieeetypes_capinfo)); + tmpcap = cpu_to_le16(tmpcap); + + memcpy(&padhocjoin->bssdescriptor.cap, + &tmpcap, sizeof(struct ieeetypes_capinfo)); + + done: + LEAVE(); return ret; } @@ -708,24 +754,19 @@ int libertas_ret_80211_associate(wlan_private * priv, int ret = 0; union iwreq_data wrqu; struct ieeetypes_assocrsp *passocrsp; - struct bss_descriptor * bss; + struct bss_descriptor *pbssdesc; - lbs_deb_enter(LBS_DEB_JOIN); - - if (!adapter->in_progress_assoc_req) { - lbs_deb_join("ASSOC_RESP: no in-progress association request\n"); - ret = -1; - goto done; - } - bss = &adapter->in_progress_assoc_req->bss; + ENTER(); passocrsp = (struct ieeetypes_assocrsp *) & resp->params; - if (le16_to_cpu(passocrsp->statuscode)) { + if (passocrsp->statuscode) { + libertas_mac_event_disconnected(priv); - lbs_deb_join("ASSOC_RESP: Association failed, status code = %d\n", - le16_to_cpu(passocrsp->statuscode)); + lbs_pr_debug(1, + "ASSOC_RESP: Association failed, status code = %d\n", + passocrsp->statuscode); ret = -1; goto done; @@ -737,15 +778,24 @@ int libertas_ret_80211_associate(wlan_private * priv, /* Send a Media Connected event, according to the Spec */ adapter->connect_status = libertas_connected; - lbs_deb_join("ASSOC_RESP: assocated to '%s'\n", - escape_essid(bss->ssid, bss->ssid_len)); + /* Set the attempted BSSID Index to current */ + pbssdesc = adapter->pattemptedbssdesc; + + lbs_pr_debug(1, "ASSOC_RESP: %s\n", pbssdesc->ssid.ssid); - /* Update current SSID and BSSID */ - memcpy(&adapter->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE); - adapter->curbssparams.ssid_len = bss->ssid_len; - memcpy(adapter->curbssparams.bssid, bss->bssid, ETH_ALEN); + /* Set the new SSID to current SSID */ + memcpy(&adapter->curbssparams.ssid, + &pbssdesc->ssid, sizeof(struct WLAN_802_11_SSID)); + + /* Set the new BSSID (AP's MAC address) to current BSSID */ + memcpy(adapter->curbssparams.bssid, + pbssdesc->macaddress, ETH_ALEN); + + /* Make a copy of current BSSID descriptor */ + memcpy(&adapter->curbssparams.bssdescriptor, + pbssdesc, sizeof(struct bss_descriptor)); - lbs_deb_join("ASSOC_RESP: currentpacketfilter is %x\n", + lbs_pr_debug(1, "ASSOC_RESP: currentpacketfilter is %x\n", adapter->currentpacketfilter); adapter->SNR[TYPE_RXPD][TYPE_AVG] = 0; @@ -756,31 +806,28 @@ int libertas_ret_80211_associate(wlan_private * priv, adapter->nextSNRNF = 0; adapter->numSNRNF = 0; - netif_carrier_on(priv->dev); - netif_wake_queue(priv->dev); + netif_carrier_on(priv->wlan_dev.netdev); + netif_wake_queue(priv->wlan_dev.netdev); - netif_carrier_on(priv->mesh_dev); - netif_wake_queue(priv->mesh_dev); - - lbs_deb_join("ASSOC_RESP: Associated \n"); + lbs_pr_debug(1, "ASSOC_RESP: Associated \n"); memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN); wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); + wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); -done: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); + done: + LEAVE(); return ret; } int libertas_ret_80211_disassociate(wlan_private * priv, struct cmd_ds_command *resp) { - lbs_deb_enter(LBS_DEB_JOIN); + ENTER(); libertas_mac_event_disconnected(priv); - lbs_deb_leave(LBS_DEB_JOIN); + LEAVE(); return 0; } @@ -793,85 +840,90 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, u16 result = le16_to_cpu(resp->result); struct cmd_ds_802_11_ad_hoc_result *padhocresult; union iwreq_data wrqu; - struct bss_descriptor *bss; + struct bss_descriptor *pbssdesc; - lbs_deb_enter(LBS_DEB_JOIN); + ENTER(); padhocresult = &resp->params.result; - lbs_deb_join("ADHOC_RESP: size = %d\n", le16_to_cpu(resp->size)); - lbs_deb_join("ADHOC_RESP: command = %x\n", command); - lbs_deb_join("ADHOC_RESP: result = %x\n", result); + lbs_pr_debug(1, "ADHOC_S_RESP: size = %d\n", le16_to_cpu(resp->size)); + lbs_pr_debug(1, "ADHOC_S_RESP: command = %x\n", command); + lbs_pr_debug(1, "ADHOC_S_RESP: result = %x\n", result); - if (!adapter->in_progress_assoc_req) { - lbs_deb_join("ADHOC_RESP: no in-progress association request\n"); - ret = -1; - goto done; - } - bss = &adapter->in_progress_assoc_req->bss; + pbssdesc = adapter->pattemptedbssdesc; /* * Join result code 0 --> SUCCESS */ if (result) { - lbs_deb_join("ADHOC_RESP: failed\n"); + lbs_pr_debug(1, "ADHOC_RESP failed\n"); if (adapter->connect_status == libertas_connected) { libertas_mac_event_disconnected(priv); } - ret = -1; - goto done; + + memset(&adapter->curbssparams.bssdescriptor, + 0x00, sizeof(adapter->curbssparams.bssdescriptor)); + + LEAVE(); + return -1; } /* * Now the join cmd should be successful * If BSSID has changed use SSID to compare instead of BSSID */ - lbs_deb_join("ADHOC_RESP: associated to '%s'\n", - escape_essid(bss->ssid, bss->ssid_len)); + lbs_pr_debug(1, "ADHOC_J_RESP %s\n", pbssdesc->ssid.ssid); /* Send a Media Connected event, according to the Spec */ adapter->connect_status = libertas_connected; if (command == cmd_ret_802_11_ad_hoc_start) { /* Update the created network descriptor with the new BSSID */ - memcpy(bss->bssid, padhocresult->BSSID, ETH_ALEN); + memcpy(pbssdesc->macaddress, + padhocresult->BSSID, ETH_ALEN); + } else { + + /* Make a copy of current BSSID descriptor, only needed for join since + * the current descriptor is already being used for adhoc start + */ + memmove(&adapter->curbssparams.bssdescriptor, + pbssdesc, sizeof(struct bss_descriptor)); } /* Set the BSSID from the joined/started descriptor */ - memcpy(&adapter->curbssparams.bssid, bss->bssid, ETH_ALEN); + memcpy(&adapter->curbssparams.bssid, + pbssdesc->macaddress, ETH_ALEN); /* Set the new SSID to current SSID */ - memcpy(&adapter->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE); - adapter->curbssparams.ssid_len = bss->ssid_len; + memcpy(&adapter->curbssparams.ssid, + &pbssdesc->ssid, sizeof(struct WLAN_802_11_SSID)); - netif_carrier_on(priv->dev); - netif_wake_queue(priv->dev); - - netif_carrier_on(priv->mesh_dev); - netif_wake_queue(priv->mesh_dev); + netif_carrier_on(priv->wlan_dev.netdev); + netif_wake_queue(priv->wlan_dev.netdev); memset(&wrqu, 0, sizeof(wrqu)); memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN); wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); + wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); - lbs_deb_join("ADHOC_RESP: - Joined/Started Ad Hoc\n"); - lbs_deb_join("ADHOC_RESP: channel = %d\n", adapter->curbssparams.channel); - lbs_deb_join("ADHOC_RESP: BSSID = " MAC_FMT "\n", - MAC_ARG(padhocresult->BSSID)); + lbs_pr_debug(1, "ADHOC_RESP: - Joined/Started Ad Hoc\n"); + lbs_pr_debug(1, "ADHOC_RESP: channel = %d\n", adapter->adhocchannel); + lbs_pr_debug(1, "ADHOC_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n", + padhocresult->BSSID[0], padhocresult->BSSID[1], + padhocresult->BSSID[2], padhocresult->BSSID[3], + padhocresult->BSSID[4], padhocresult->BSSID[5]); -done: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); + LEAVE(); return ret; } int libertas_ret_80211_ad_hoc_stop(wlan_private * priv, struct cmd_ds_command *resp) { - lbs_deb_enter(LBS_DEB_JOIN); + ENTER(); libertas_mac_event_disconnected(priv); - lbs_deb_leave(LBS_DEB_JOIN); + LEAVE(); return 0; } diff --git a/trunk/drivers/net/wireless/libertas/join.h b/trunk/drivers/net/wireless/libertas/join.h index d522630ff8cf..115f5a8ba346 100644 --- a/trunk/drivers/net/wireless/libertas/join.h +++ b/trunk/drivers/net/wireless/libertas/join.h @@ -9,7 +9,6 @@ #define _WLAN_JOIN_H #include "defs.h" -#include "dev.h" struct cmd_ds_command; extern int libertas_cmd_80211_authenticate(wlan_private * priv, @@ -22,7 +21,7 @@ extern int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv, struct cmd_ds_command *cmd); extern int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, struct cmd_ds_command *cmd, - void *pdata_buf); + void *pssid); extern int libertas_cmd_80211_deauthenticate(wlan_private * priv, struct cmd_ds_command *cmd); extern int libertas_cmd_80211_associate(wlan_private * priv, @@ -40,10 +39,12 @@ extern int libertas_ret_80211_associate(wlan_private * priv, extern int libertas_reassociation_thread(void *data); +struct WLAN_802_11_SSID; +struct bss_descriptor; + extern int libertas_start_adhoc_network(wlan_private * priv, - struct assoc_request * assoc_req); -extern int libertas_join_adhoc_network(wlan_private * priv, - struct assoc_request * assoc_req); + struct WLAN_802_11_SSID *adhocssid); +extern int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor *pbssdesc); extern int libertas_stop_adhoc_network(wlan_private * priv); extern int libertas_send_deauthentication(wlan_private * priv); @@ -51,6 +52,6 @@ extern int libertas_send_deauth(wlan_private * priv); extern int libertas_do_adhocstop_ioctl(wlan_private * priv); -int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req); +int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc); #endif diff --git a/trunk/drivers/net/wireless/libertas/main.c b/trunk/drivers/net/wireless/libertas/main.c index 623ab4b16973..b9b25ce65919 100644 --- a/trunk/drivers/net/wireless/libertas/main.c +++ b/trunk/drivers/net/wireless/libertas/main.c @@ -4,7 +4,6 @@ * thread etc.. */ -#include #include #include #include @@ -12,28 +11,26 @@ #include #include -#include #include "host.h" +#include "sbi.h" #include "decl.h" #include "dev.h" +#include "fw.h" #include "wext.h" #include "debugfs.h" #include "assoc.h" -#define DRIVER_RELEASE_VERSION "322.p0" +#define DRIVER_RELEASE_VERSION "320.p0" const char libertas_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION #ifdef DEBUG "-dbg" #endif ""; - -/* Module parameters */ -unsigned int libertas_debug = 0; -module_param(libertas_debug, int, 0644); -EXPORT_SYMBOL_GPL(libertas_debug); - +#ifdef ENABLE_PM +static struct pm_dev *wlan_pm_dev = NULL; +#endif #define WLAN_TX_PWR_DEFAULT 20 /*100mW */ #define WLAN_TX_PWR_US_DEFAULT 20 /*100mW */ @@ -148,6 +145,14 @@ static struct region_cfp_table region_cfp_table[] = { /*Add new region here */ }; +/** + * the rates supported by the card + */ +u8 libertas_wlan_data_rates[WLAN_SUPPORTED_RATES] = + { 0x02, 0x04, 0x0B, 0x16, 0x00, 0x0C, 0x12, + 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x00 +}; + /** * the rates supported */ @@ -167,56 +172,67 @@ u8 libertas_adhoc_rates_g[G_SUPPORTED_RATES] = */ u8 libertas_adhoc_rates_b[4] = { 0x82, 0x84, 0x8b, 0x96 }; +/** + * the global variable of a pointer to wlan_private + * structure variable + */ +static wlan_private *wlanpriv = NULL; + +#define MAX_DEVS 5 +static struct net_device *libertas_devs[MAX_DEVS]; +static int libertas_found = 0; + /** * the table to keep region code */ u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE] = { 0x10, 0x20, 0x30, 0x31, 0x32, 0x40 }; +static u8 *default_fw_name = "usb8388.bin"; + /** * Attributes exported through sysfs */ /** - * @brief Get function for sysfs attribute anycast_mask + * @brief Get function for sysfs attribute libertas_mpp */ -static ssize_t libertas_anycast_get(struct device * dev, +static ssize_t libertas_mpp_get(struct device * dev, struct device_attribute *attr, char * buf) { struct cmd_ds_mesh_access mesh_access; memset(&mesh_access, 0, sizeof(mesh_access)); libertas_prepare_and_send_command(to_net_dev(dev)->priv, cmd_mesh_access, - cmd_act_mesh_get_anycast, + cmd_act_mesh_get_mpp, cmd_option_waitforrsp, 0, (void *)&mesh_access); - return snprintf(buf, 12, "0x%X\n", le32_to_cpu(mesh_access.data[0])); + return snprintf(buf, 3, "%d\n", mesh_access.data[0]); } /** - * @brief Set function for sysfs attribute anycast_mask + * @brief Set function for sysfs attribute libertas_mpp */ -static ssize_t libertas_anycast_set(struct device * dev, +static ssize_t libertas_mpp_set(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) { struct cmd_ds_mesh_access mesh_access; - uint32_t datum; - memset(&mesh_access, 0, sizeof(mesh_access)); - sscanf(buf, "%x", &datum); - mesh_access.data[0] = cpu_to_le32(datum); + memset(&mesh_access, 0, sizeof(mesh_access)); + sscanf(buf, "%d", &(mesh_access.data[0])); libertas_prepare_and_send_command((to_net_dev(dev))->priv, cmd_mesh_access, - cmd_act_mesh_set_anycast, + cmd_act_mesh_set_mpp, cmd_option_waitforrsp, 0, (void *)&mesh_access); return strlen(buf); } /** - * anycast_mask attribute to be exported per mshX interface - * through sysfs (/sys/class/net/mshX/anycast_mask) + * libertas_mpp attribute to be exported per mshX interface + * through sysfs (/sys/class/net/mshX/libertas-mpp) */ -static DEVICE_ATTR(anycast_mask, 0644, libertas_anycast_get, libertas_anycast_set); +static DEVICE_ATTR(libertas_mpp, 0644, libertas_mpp_get, + libertas_mpp_set ); /** * @brief Check if the device can be open and wait if necessary. @@ -229,8 +245,7 @@ static DEVICE_ATTR(anycast_mask, 0644, libertas_anycast_get, libertas_anycast_se * function to work around the issue. * */ -static int pre_open_check(struct net_device *dev) -{ +static int pre_open_check(struct net_device *dev) { wlan_private *priv = (wlan_private *) dev->priv; wlan_adapter *adapter = priv->adapter; int i = 0; @@ -240,7 +255,8 @@ static int pre_open_check(struct net_device *dev) msleep_interruptible(100); } if (!adapter->fw_ready) { - lbs_pr_err("firmware not ready\n"); + lbs_pr_info("FW not ready, pre_open_check() return failure\n"); + LEAVE(); return -1; } @@ -258,19 +274,17 @@ static int wlan_dev_open(struct net_device *dev) wlan_private *priv = (wlan_private *) dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_NET); + ENTER(); + priv->open = 1; if (adapter->connect_status == libertas_connected) { - netif_carrier_on(priv->dev); - netif_carrier_on(priv->mesh_dev); - } else { - netif_carrier_off(priv->dev); - netif_carrier_off(priv->mesh_dev); - } + netif_carrier_on(priv->wlan_dev.netdev); + } else + netif_carrier_off(priv->wlan_dev.netdev); - lbs_deb_leave(LBS_DEB_NET); + LEAVE(); return 0; } /** @@ -283,12 +297,12 @@ static int mesh_open(struct net_device *dev) { wlan_private *priv = (wlan_private *) dev->priv ; - if (pre_open_check(dev) == -1) + if(pre_open_check(dev) == -1) return -1; priv->mesh_open = 1 ; - netif_wake_queue(priv->mesh_dev); + netif_start_queue(priv->mesh_dev); if (priv->infra_open == 0) - return wlan_dev_open(priv->dev) ; + return wlan_dev_open(priv->wlan_dev.netdev) ; return 0; } @@ -305,9 +319,9 @@ static int wlan_open(struct net_device *dev) if(pre_open_check(dev) == -1) return -1; priv->infra_open = 1 ; - netif_wake_queue(priv->dev); + netif_wake_queue(priv->wlan_dev.netdev); if (priv->open == 0) - return wlan_dev_open(priv->dev) ; + return wlan_dev_open(priv->wlan_dev.netdev) ; return 0; } @@ -315,12 +329,12 @@ static int wlan_dev_close(struct net_device *dev) { wlan_private *priv = dev->priv; - lbs_deb_enter(LBS_DEB_NET); + ENTER(); - netif_carrier_off(priv->dev); + netif_carrier_off(priv->wlan_dev.netdev); priv->open = 0; - lbs_deb_leave(LBS_DEB_NET); + LEAVE(); return 0; } @@ -337,7 +351,7 @@ static int mesh_close(struct net_device *dev) priv->mesh_open = 0; netif_stop_queue(priv->mesh_dev); if (priv->infra_open == 0) - return wlan_dev_close(dev); + return wlan_dev_close( ((wlan_private *) dev->priv)->wlan_dev.netdev) ; else return 0; } @@ -348,38 +362,147 @@ static int mesh_close(struct net_device *dev) * @param dev A pointer to net_device structure * @return 0 */ -static int wlan_close(struct net_device *dev) -{ +static int wlan_close(struct net_device *dev) { wlan_private *priv = (wlan_private *) dev->priv; - netif_stop_queue(dev); + netif_stop_queue(priv->wlan_dev.netdev); priv->infra_open = 0; if (priv->mesh_open == 0) - return wlan_dev_close(dev); + return wlan_dev_close( ((wlan_private *) dev->priv)->wlan_dev.netdev) ; else return 0; } +#ifdef ENABLE_PM + +/** + * @brief This function is a callback function. it is called by + * kernel to enter or exit power saving mode. + * + * @param pmdev A pointer to pm_dev + * @param pmreq pm_request_t + * @param pmdata A pointer to pmdata + * @return 0 or -1 + */ +static int wlan_pm_callback(struct pm_dev *pmdev, pm_request_t pmreq, + void *pmdata) +{ + wlan_private *priv = wlanpriv; + wlan_adapter *adapter = priv->adapter; + struct net_device *dev = priv->wlan_dev.netdev; + + lbs_pr_debug(1, "WPRM_PM_CALLBACK: pmreq = %d.\n", pmreq); + + switch (pmreq) { + case PM_SUSPEND: + lbs_pr_debug(1, "WPRM_PM_CALLBACK: enter PM_SUSPEND.\n"); + + /* in associated mode */ + if (adapter->connect_status == libertas_connected) { + if ((adapter->psstate != PS_STATE_SLEEP) + ) { + lbs_pr_debug(1, + "wlan_pm_callback: can't enter sleep mode\n"); + return -1; + } else { + + /* + * Detach the network interface + * if the network is running + */ + if (netif_running(dev)) { + netif_device_detach(dev); + lbs_pr_debug(1, + "netif_device_detach().\n"); + } + libertas_sbi_suspend(priv); + } + break; + } + + /* in non associated mode */ + + /* + * Detach the network interface + * if the network is running + */ + if (netif_running(dev)) + netif_device_detach(dev); + + /* + * Storing and restoring of the regs be taken care + * at the driver rest will be done at wlan driver + * this makes driver independent of the card + */ + + libertas_sbi_suspend(priv); + + break; + + case PM_RESUME: + /* in associated mode */ + if (adapter->connect_status == libertas_connected) { + { + /* + * Bring the inteface up first + * This case should not happen still ... + */ + libertas_sbi_resume(priv); + + /* + * Attach the network interface + * if the network is running + */ + if (netif_running(dev)) { + netif_device_attach(dev); + lbs_pr_debug(1, + "after netif_device_attach().\n"); + } + lbs_pr_debug(1, + "After netif attach, in associated mode.\n"); + } + break; + } + + /* in non associated mode */ + + /* + * Bring the inteface up first + * This case should not happen still ... + */ + + libertas_sbi_resume(priv); + + if (netif_running(dev)) + netif_device_attach(dev); + + lbs_pr_debug(1, "after netif attach, in NON associated mode.\n"); + break; + } + + return 0; +} +#endif /* ENABLE_PM */ + static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { int ret = 0; wlan_private *priv = dev->priv; - lbs_deb_enter(LBS_DEB_NET); + ENTER(); - if (priv->dnld_sent || priv->adapter->TxLockFlag) { + if (priv->wlan_dev.dnld_sent || priv->adapter->TxLockFlag) { priv->stats.tx_dropped++; goto done; } - netif_stop_queue(priv->dev); - netif_stop_queue(priv->mesh_dev); + netif_stop_queue(priv->wlan_dev.netdev); if (libertas_process_tx(priv, skb) == 0) dev->trans_start = jiffies; done: - lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); + LEAVE(); return ret; } @@ -390,43 +513,33 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) static int mesh_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) { wlan_private *priv = dev->priv; - int ret; - - lbs_deb_enter(LBS_DEB_MESH); - + ENTER(); SET_MESH_FRAME(skb); + LEAVE(); - ret = wlan_hard_start_xmit(skb, priv->dev); - lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); - return ret; + return wlan_hard_start_xmit(skb, priv->wlan_dev.netdev); } /** * @brief Mark non-mesh packets and handover them to wlan_hard_start_xmit * */ -static int wlan_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) -{ - int ret; - - lbs_deb_enter(LBS_DEB_NET); - +static int wlan_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) { + ENTER(); UNSET_MESH_FRAME(skb); - - ret = wlan_hard_start_xmit(skb, dev); - lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); - return ret; + LEAVE(); + return wlan_hard_start_xmit(skb, dev); } static void wlan_tx_timeout(struct net_device *dev) { wlan_private *priv = (wlan_private *) dev->priv; - lbs_deb_enter(LBS_DEB_TX); + ENTER(); - lbs_pr_err("tx watch dog timeout\n"); + lbs_pr_err("tx watch dog timeout!\n"); - priv->dnld_sent = DNLD_RES_RECEIVED; + priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; dev->trans_start = jiffies; if (priv->adapter->currenttxskb) { @@ -437,12 +550,10 @@ static void wlan_tx_timeout(struct net_device *dev) libertas_send_tx_feedback(priv); } else wake_up_interruptible(&priv->mainthread.waitq); - } else if (priv->adapter->connect_status == libertas_connected) { - netif_wake_queue(priv->dev); - netif_wake_queue(priv->mesh_dev); - } + } else if (priv->adapter->connect_status == libertas_connected) + netif_wake_queue(priv->wlan_dev.netdev); - lbs_deb_leave(LBS_DEB_TX); + LEAVE(); } /** @@ -465,10 +576,7 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr) wlan_adapter *adapter = priv->adapter; struct sockaddr *phwaddr = addr; - lbs_deb_enter(LBS_DEB_NET); - - /* In case it was called from the mesh device */ - dev = priv->dev ; + ENTER(); memset(adapter->current_addr, 0, ETH_ALEN); @@ -483,18 +591,17 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr) cmd_option_waitforrsp, 0, NULL); if (ret) { - lbs_deb_net("set MAC address failed\n"); + lbs_pr_debug(1, "set mac address failed.\n"); ret = -1; goto done; } lbs_dbg_hex("adapter->macaddr:", adapter->current_addr, ETH_ALEN); memcpy(dev->dev_addr, adapter->current_addr, ETH_ALEN); - if (priv->mesh_dev) - memcpy(priv->mesh_dev->dev_addr, adapter->current_addr, ETH_ALEN); + memcpy(((wlan_private *) dev->priv)->mesh_dev->dev_addr, adapter->current_addr, ETH_ALEN); done: - lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); + LEAVE(); return ret; } @@ -519,12 +626,12 @@ static void wlan_set_multicast_list(struct net_device *dev) wlan_adapter *adapter = priv->adapter; int oldpacketfilter; - lbs_deb_enter(LBS_DEB_NET); + ENTER(); oldpacketfilter = adapter->currentpacketfilter; if (dev->flags & IFF_PROMISC) { - lbs_deb_net("enable promiscuous mode\n"); + lbs_pr_debug(1, "enable Promiscuous mode\n"); adapter->currentpacketfilter |= cmd_act_mac_promiscuous_enable; adapter->currentpacketfilter &= @@ -537,7 +644,7 @@ static void wlan_set_multicast_list(struct net_device *dev) if (dev->flags & IFF_ALLMULTI || dev->mc_count > MRVDRV_MAX_MULTICAST_LIST_SIZE) { - lbs_deb_net( "enabling all multicast\n"); + lbs_pr_debug(1, "Enabling All Multicast!\n"); adapter->currentpacketfilter |= cmd_act_mac_all_multicast_enable; adapter->currentpacketfilter &= @@ -547,8 +654,8 @@ static void wlan_set_multicast_list(struct net_device *dev) ~cmd_act_mac_all_multicast_enable; if (!dev->mc_count) { - lbs_deb_net("no multicast addresses, " - "disabling multicast\n"); + lbs_pr_debug(1, "No multicast addresses - " + "disabling multicast!\n"); adapter->currentpacketfilter &= ~cmd_act_mac_multicast_enable; } else { @@ -560,12 +667,12 @@ static void wlan_set_multicast_list(struct net_device *dev) adapter->nr_of_multicastmacaddr = wlan_copy_multicast_address(adapter, dev); - lbs_deb_net("multicast addresses: %d\n", + lbs_pr_debug(1, "Multicast addresses: %d\n", dev->mc_count); for (i = 0; i < dev->mc_count; i++) { - lbs_deb_net("Multicast address %d:" - MAC_FMT "\n", i, + lbs_pr_debug(1, "Multicast address %d:" + "%x %x %x %x %x %x\n", i, adapter->multicastlist[i][0], adapter->multicastlist[i][1], adapter->multicastlist[i][2], @@ -573,7 +680,7 @@ static void wlan_set_multicast_list(struct net_device *dev) adapter->multicastlist[i][4], adapter->multicastlist[i][5]); } - /* send multicast addresses to firmware */ + /* set multicast addresses to firmware */ libertas_prepare_and_send_command(priv, cmd_mac_multicast_adr, cmd_act_set, 0, 0, @@ -586,13 +693,13 @@ static void wlan_set_multicast_list(struct net_device *dev) libertas_set_mac_packet_filter(priv); } - lbs_deb_leave(LBS_DEB_NET); + LEAVE(); } /** - * @brief This function handles the major jobs in the WLAN driver. - * It handles all events generated by firmware, RX data received - * from firmware and TX data sent from kernel. + * @brief This function hanldes the major job in WLAN driver. + * it handles the event generated by firmware, rx data received + * from firmware and tx data sent from kernel. * * @param data A pointer to wlan_thread structure * @return 0 @@ -605,26 +712,26 @@ static int wlan_service_main_thread(void *data) wait_queue_t wait; u8 ireg = 0; - lbs_deb_enter(LBS_DEB_THREAD); + ENTER(); wlan_activate_thread(thread); init_waitqueue_entry(&wait, current); for (;;) { - lbs_deb_thread( "main-thread 111: intcounter=%d " + lbs_pr_debug(1, "main-thread 111: intcounter=%d " "currenttxskb=%p dnld_sent=%d\n", adapter->intcounter, - adapter->currenttxskb, priv->dnld_sent); + adapter->currenttxskb, priv->wlan_dev.dnld_sent); add_wait_queue(&thread->waitq, &wait); set_current_state(TASK_INTERRUPTIBLE); spin_lock_irq(&adapter->driver_lock); if ((adapter->psstate == PS_STATE_SLEEP) || (!adapter->intcounter - && (priv->dnld_sent || adapter->cur_cmd || + && (priv->wlan_dev.dnld_sent || adapter->cur_cmd || list_empty(&adapter->cmdpendingq)))) { - lbs_deb_thread( + lbs_pr_debug(1, "main-thread sleeping... Conn=%d IntC=%d PS_mode=%d PS_State=%d\n", adapter->connect_status, adapter->intcounter, adapter->psmode, adapter->psstate); @@ -634,23 +741,23 @@ static int wlan_service_main_thread(void *data) spin_unlock_irq(&adapter->driver_lock); - lbs_deb_thread( + lbs_pr_debug(1, "main-thread 222 (waking up): intcounter=%d currenttxskb=%p " "dnld_sent=%d\n", adapter->intcounter, - adapter->currenttxskb, priv->dnld_sent); + adapter->currenttxskb, priv->wlan_dev.dnld_sent); set_current_state(TASK_RUNNING); remove_wait_queue(&thread->waitq, &wait); try_to_freeze(); - lbs_deb_thread("main-thread 333: intcounter=%d currenttxskb=%p " + lbs_pr_debug(1, "main-thread 333: intcounter=%d currenttxskb=%p " "dnld_sent=%d\n", adapter->intcounter, - adapter->currenttxskb, priv->dnld_sent); + adapter->currenttxskb, priv->wlan_dev.dnld_sent); if (kthread_should_stop() || adapter->surpriseremoved) { - lbs_deb_thread( + lbs_pr_debug(1, "main-thread: break from main thread: surpriseremoved=0x%x\n", adapter->surpriseremoved); break; @@ -661,10 +768,10 @@ static int wlan_service_main_thread(void *data) if (adapter->intcounter) { u8 int_status; adapter->intcounter = 0; - int_status = priv->hw_get_int_status(priv, &ireg); + int_status = libertas_sbi_get_int_status(priv, &ireg); if (int_status) { - lbs_deb_thread( + lbs_pr_debug(1, "main-thread: reading HOST_INT_STATUS_REG failed\n"); spin_unlock_irq(&adapter->driver_lock); continue; @@ -672,14 +779,14 @@ static int wlan_service_main_thread(void *data) adapter->hisregcpy |= ireg; } - lbs_deb_thread("main-thread 444: intcounter=%d currenttxskb=%p " + lbs_pr_debug(1, "main-thread 444: intcounter=%d currenttxskb=%p " "dnld_sent=%d\n", adapter->intcounter, - adapter->currenttxskb, priv->dnld_sent); + adapter->currenttxskb, priv->wlan_dev.dnld_sent); /* command response? */ if (adapter->hisregcpy & his_cmdupldrdy) { - lbs_deb_thread("main-thread: cmd response ready\n"); + lbs_pr_debug(1, "main-thread: cmd response ready.\n"); adapter->hisregcpy &= ~his_cmdupldrdy; spin_unlock_irq(&adapter->driver_lock); @@ -689,13 +796,13 @@ static int wlan_service_main_thread(void *data) /* Any Card Event */ if (adapter->hisregcpy & his_cardevent) { - lbs_deb_thread("main-thread: Card Event Activity\n"); + lbs_pr_debug(1, "main-thread: Card Event Activity.\n"); adapter->hisregcpy &= ~his_cardevent; - if (priv->hw_read_event_cause(priv)) { + if (libertas_sbi_read_event_cause(priv)) { lbs_pr_alert( - "main-thread: hw_read_event_cause failed\n"); + "main-thread: libertas_sbi_read_event_cause failed.\n"); spin_unlock_irq(&adapter->driver_lock); continue; } @@ -706,15 +813,15 @@ static int wlan_service_main_thread(void *data) /* Check if we need to confirm Sleep Request received previously */ if (adapter->psstate == PS_STATE_PRE_SLEEP) { - if (!priv->dnld_sent && !adapter->cur_cmd) { + if (!priv->wlan_dev.dnld_sent && !adapter->cur_cmd) { if (adapter->connect_status == libertas_connected) { - lbs_deb_thread( + lbs_pr_debug(1, "main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p " "dnld_sent=%d cur_cmd=%p, confirm now\n", adapter->intcounter, adapter->currenttxskb, - priv->dnld_sent, + priv->wlan_dev.dnld_sent, adapter->cur_cmd); libertas_ps_confirm_sleep(priv, @@ -740,7 +847,7 @@ static int wlan_service_main_thread(void *data) continue; /* Execute the next command */ - if (!priv->dnld_sent && !priv->adapter->cur_cmd) + if (!priv->wlan_dev.dnld_sent && !priv->adapter->cur_cmd) libertas_execute_next_command(priv); /* Wake-up command waiters which can't sleep in @@ -757,7 +864,7 @@ static int wlan_service_main_thread(void *data) wake_up_all(&adapter->cmd_pending); wlan_deactivate_thread(thread); - lbs_deb_leave(LBS_DEB_THREAD); + LEAVE(); return 0; } @@ -768,32 +875,49 @@ static int wlan_service_main_thread(void *data) * @param card A pointer to card * @return A pointer to wlan_private structure */ -wlan_private *libertas_add_card(void *card, struct device *dmdev) +wlan_private *wlan_add_card(void *card) { struct net_device *dev = NULL; + struct net_device *mesh_dev = NULL; wlan_private *priv = NULL; - lbs_deb_enter(LBS_DEB_NET); + ENTER(); /* Allocate an Ethernet device and register it */ if (!(dev = alloc_etherdev(sizeof(wlan_private)))) { - lbs_pr_err("init ethX device failed\n"); + lbs_pr_alert( "Init ethernet device failed!\n"); return NULL; } + priv = dev->priv; /* allocate buffer for wlan_adapter */ - if (!(priv->adapter = kzalloc(sizeof(wlan_adapter), GFP_KERNEL))) { - lbs_pr_err("allocate buffer for wlan_adapter failed\n"); - goto err_kzalloc; + if (!(priv->adapter = kmalloc(sizeof(wlan_adapter), GFP_KERNEL))) { + lbs_pr_alert( "Allocate buffer for wlan_adapter failed!\n"); + goto err_kmalloc; + } + + /* Allocate a virtual mesh device */ + if (!(mesh_dev = alloc_netdev(0, "msh%d", ether_setup))) { + lbs_pr_debug(1, "Init ethernet device failed!\n"); + return NULL; } - priv->dev = dev; - priv->card = card; + /* Both intervaces share the priv structure */ + mesh_dev->priv = priv; + + /* init wlan_adapter */ + memset(priv->adapter, 0, sizeof(wlan_adapter)); + + priv->wlan_dev.netdev = dev; + priv->wlan_dev.card = card; priv->mesh_open = 0; priv->infra_open = 0; + priv->mesh_dev = mesh_dev; + wlanpriv = priv; SET_MODULE_OWNER(dev); + SET_MODULE_OWNER(mesh_dev); /* Setup the OS Interface to our functions */ dev->open = wlan_open; @@ -801,172 +925,116 @@ wlan_private *libertas_add_card(void *card, struct device *dmdev) dev->stop = wlan_close; dev->do_ioctl = libertas_do_ioctl; dev->set_mac_address = wlan_set_mac_address; + mesh_dev->open = mesh_open; + mesh_dev->hard_start_xmit = mesh_pre_start_xmit; + mesh_dev->stop = mesh_close; + mesh_dev->do_ioctl = libertas_do_ioctl; + memcpy(mesh_dev->dev_addr, wlanpriv->wlan_dev.netdev->dev_addr, + sizeof(wlanpriv->wlan_dev.netdev->dev_addr)); + +#define WLAN_WATCHDOG_TIMEOUT (5 * HZ) + dev->tx_timeout = wlan_tx_timeout; dev->get_stats = wlan_get_stats; - dev->watchdog_timeo = 5 * HZ; + dev->watchdog_timeo = WLAN_WATCHDOG_TIMEOUT; dev->ethtool_ops = &libertas_ethtool_ops; + mesh_dev->get_stats = wlan_get_stats; + mesh_dev->ethtool_ops = &libertas_ethtool_ops; + #ifdef WIRELESS_EXT dev->wireless_handlers = (struct iw_handler_def *)&libertas_handler_def; + mesh_dev->wireless_handlers = (struct iw_handler_def *)&libertas_handler_def; #endif #define NETIF_F_DYNALLOC 16 dev->features |= NETIF_F_DYNALLOC; dev->flags |= IFF_BROADCAST | IFF_MULTICAST; dev->set_multicast_list = wlan_set_multicast_list; - SET_NETDEV_DEV(dev, dmdev); - INIT_LIST_HEAD(&priv->adapter->cmdfreeq); INIT_LIST_HEAD(&priv->adapter->cmdpendingq); spin_lock_init(&priv->adapter->driver_lock); init_waitqueue_head(&priv->adapter->cmd_pending); priv->adapter->nr_cmd_pending = 0; - goto done; -err_kzalloc: - free_netdev(dev); - priv = NULL; -done: - lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv); - return priv; -} -EXPORT_SYMBOL_GPL(libertas_add_card); - -int libertas_activate_card(wlan_private *priv, char *fw_name) -{ - struct net_device *dev = priv->dev; - int ret = -1; - - lbs_deb_enter(LBS_DEB_MAIN); - - lbs_deb_thread("Starting kthread...\n"); + lbs_pr_debug(1, "Starting kthread...\n"); priv->mainthread.priv = priv; wlan_create_thread(wlan_service_main_thread, &priv->mainthread, "wlan_main_service"); priv->assoc_thread = create_singlethread_workqueue("libertas_assoc"); - INIT_DELAYED_WORK(&priv->assoc_work, libertas_association_worker); - INIT_WORK(&priv->sync_channel, libertas_sync_channel); + INIT_DELAYED_WORK(&priv->assoc_work, wlan_association_worker); /* * Register the device. Fillup the private data structure with * relevant information from the card and request for the required * IRQ. */ - if (priv->hw_register_dev(priv) < 0) { - lbs_pr_err("failed to register WLAN device\n"); + if (libertas_sbi_register_dev(priv) < 0) { + lbs_pr_info("failed to register wlan device!\n"); goto err_registerdev; } /* init FW and HW */ - if (fw_name && libertas_init_fw(priv, fw_name)) { - lbs_pr_err("firmware init failed\n"); + if (libertas_init_fw(priv)) { + lbs_pr_debug(1, "Firmware Init failed\n"); goto err_registerdev; } if (register_netdev(dev)) { - lbs_pr_err("cannot register ethX device\n"); + lbs_pr_err("Cannot register network device!\n"); + goto err_init_fw; + } + + /* Register virtual mesh interface */ + if (register_netdev(mesh_dev)) { + lbs_pr_info("Cannot register mesh virtual interface!\n"); goto err_init_fw; } - lbs_pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name); + lbs_pr_info("%s: Marvell Wlan 802.11 adapter ", dev->name); libertas_debugfs_init_one(priv, dev); - ret = 0; - goto done; + if (libertas_found == MAX_DEVS) + goto err_init_fw; + libertas_devs[libertas_found] = dev; + libertas_found++; +#ifdef ENABLE_PM + if (!(wlan_pm_dev = pm_register(PM_UNKNOWN_DEV, 0, wlan_pm_callback))) + lbs_pr_alert( "failed to register PM callback\n"); +#endif + if (device_create_file(&(mesh_dev->dev), &dev_attr_libertas_mpp)) + goto err_create_file; + + LEAVE(); + return priv; +err_create_file: + device_remove_file(&(mesh_dev->dev), &dev_attr_libertas_mpp); err_init_fw: - priv->hw_unregister_dev(priv); + libertas_sbi_unregister_dev(priv); err_registerdev: destroy_workqueue(priv->assoc_thread); /* Stop the thread servicing the interrupts */ wake_up_interruptible(&priv->mainthread.waitq); wlan_terminate_thread(&priv->mainthread); -done: - lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); - return ret; -} -EXPORT_SYMBOL_GPL(libertas_activate_card); - - -/** - * @brief This function adds mshX interface - * - * @param priv A pointer to the wlan_private structure - * @return 0 if successful, -X otherwise - */ -int libertas_add_mesh(wlan_private *priv, struct device *dev) -{ - struct net_device *mesh_dev = NULL; - int ret = 0; - - lbs_deb_enter(LBS_DEB_MESH); - - /* Allocate a virtual mesh device */ - if (!(mesh_dev = alloc_netdev(0, "msh%d", ether_setup))) { - lbs_deb_mesh("init mshX device failed\n"); - ret = -ENOMEM; - goto done; - } - mesh_dev->priv = priv; - priv->mesh_dev = mesh_dev; - - SET_MODULE_OWNER(mesh_dev); - - mesh_dev->open = mesh_open; - mesh_dev->hard_start_xmit = mesh_pre_start_xmit; - mesh_dev->stop = mesh_close; - mesh_dev->do_ioctl = libertas_do_ioctl; - mesh_dev->get_stats = wlan_get_stats; - mesh_dev->set_mac_address = wlan_set_mac_address; - mesh_dev->ethtool_ops = &libertas_ethtool_ops; - memcpy(mesh_dev->dev_addr, priv->dev->dev_addr, - sizeof(priv->dev->dev_addr)); - - SET_NETDEV_DEV(priv->mesh_dev, dev); - -#ifdef WIRELESS_EXT - mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def; -#endif -#define NETIF_F_DYNALLOC 16 - - /* Register virtual mesh interface */ - ret = register_netdev(mesh_dev); - if (ret) { - lbs_pr_err("cannot register mshX virtual interface\n"); - goto err_free; - } - - ret = device_create_file(&(mesh_dev->dev), &dev_attr_anycast_mask); - if (ret) - goto err_unregister; - - /* Everything successful */ - ret = 0; - goto done; - - -err_unregister: - unregister_netdev(mesh_dev); - -err_free: + kfree(priv->adapter); +err_kmalloc: + free_netdev(dev); free_netdev(mesh_dev); + wlanpriv = NULL; -done: - lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); - return ret; + LEAVE(); + return NULL; } -EXPORT_SYMBOL_GPL(libertas_add_mesh); static void wake_pending_cmdnodes(wlan_private *priv) { struct cmd_ctrl_node *cmdnode; unsigned long flags; - lbs_deb_enter(LBS_DEB_CMD); - spin_lock_irqsave(&priv->adapter->driver_lock, flags); list_for_each_entry(cmdnode, &priv->adapter->cmdpendingq, list) { cmdnode->cmdwaitqwoken = 1; @@ -976,29 +1044,40 @@ static void wake_pending_cmdnodes(wlan_private *priv) } -int libertas_remove_card(wlan_private *priv) +int wlan_remove_card(void *card) { + wlan_private *priv = libertas_sbi_get_priv(card); wlan_adapter *adapter; struct net_device *dev; + struct net_device *mesh_dev; union iwreq_data wrqu; + int i; - lbs_deb_enter(LBS_DEB_NET); + ENTER(); - if (!priv) - goto out; + if (!priv) { + LEAVE(); + return 0; + } adapter = priv->adapter; - if (!adapter) - goto out; + if (!adapter) { + LEAVE(); + return 0; + } - dev = priv->dev; + dev = priv->wlan_dev.netdev; + mesh_dev = priv->mesh_dev; - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); + netif_stop_queue(mesh_dev); + netif_stop_queue(priv->wlan_dev.netdev); + netif_carrier_off(priv->wlan_dev.netdev); wake_pending_cmdnodes(priv); + device_remove_file(&(mesh_dev->dev), &dev_attr_libertas_mpp); + unregister_netdev(mesh_dev); unregister_netdev(dev); cancel_delayed_work(&priv->assoc_work); @@ -1011,7 +1090,11 @@ int libertas_remove_card(wlan_private *priv) memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN); wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); + wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); + +#ifdef ENABLE_PM + pm_unregister(wlan_pm_dev); +#endif adapter->surpriseremoved = 1; @@ -1020,45 +1103,28 @@ int libertas_remove_card(wlan_private *priv) libertas_debugfs_remove_one(priv); - lbs_deb_net("free adapter\n"); + lbs_pr_debug(1, "Free adapter\n"); libertas_free_adapter(priv); - lbs_deb_net("unregister finish\n"); - - priv->dev = NULL; - free_netdev(dev); - -out: - lbs_deb_leave(LBS_DEB_NET); - return 0; -} -EXPORT_SYMBOL_GPL(libertas_remove_card); - - -void libertas_remove_mesh(wlan_private *priv) -{ - struct net_device *mesh_dev; - - lbs_deb_enter(LBS_DEB_NET); - - if (!priv) - goto out; - - mesh_dev = priv->mesh_dev; - - netif_stop_queue(mesh_dev); - netif_carrier_off(priv->mesh_dev); + for (i = 0; iwlan_dev.netdev) { + libertas_devs[i] = libertas_devs[--libertas_found]; + libertas_devs[libertas_found] = NULL ; + break ; + } + } - device_remove_file(&(mesh_dev->dev), &dev_attr_anycast_mask); - unregister_netdev(mesh_dev); + lbs_pr_debug(1, "Unregister finish\n"); + priv->wlan_dev.netdev = NULL; priv->mesh_dev = NULL ; free_netdev(mesh_dev); + free_netdev(dev); + wlanpriv = NULL; -out: - lbs_deb_leave(LBS_DEB_NET); + LEAVE(); + return 0; } -EXPORT_SYMBOL_GPL(libertas_remove_mesh); /** * @brief This function finds the CFP in @@ -1073,34 +1139,33 @@ struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, int *c { int i, end; - lbs_deb_enter(LBS_DEB_MAIN); + ENTER(); end = sizeof(region_cfp_table)/sizeof(struct region_cfp_table); for (i = 0; i < end ; i++) { - lbs_deb_main("region_cfp_table[i].region=%d\n", + lbs_pr_debug(1, "region_cfp_table[i].region=%d\n", region_cfp_table[i].region); if (region_cfp_table[i].region == region) { *cfp_no = region_cfp_table[i].cfp_no_BG; - lbs_deb_leave(LBS_DEB_MAIN); + LEAVE(); return region_cfp_table[i].cfp_BG; } } - lbs_deb_leave_args(LBS_DEB_MAIN, "ret NULL"); + LEAVE(); return NULL; } int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band) { wlan_adapter *adapter = priv->adapter; - int ret = 0; int i = 0; struct chan_freq_power *cfp; int cfp_no; - lbs_deb_enter(LBS_DEB_MAIN); + ENTER(); memset(adapter->region_channel, 0, sizeof(adapter->region_channel)); @@ -1110,19 +1175,17 @@ int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band) adapter->region_channel[i].nrcfp = cfp_no; adapter->region_channel[i].CFP = cfp; } else { - lbs_deb_main("wrong region code %#x in band B/G\n", + lbs_pr_debug(1, "wrong region code %#x in band B-G\n", region); - ret = -1; - goto out; + return -1; } adapter->region_channel[i].valid = 1; adapter->region_channel[i].region = region; adapter->region_channel[i].band = band; i++; } -out: - lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); - return ret; + LEAVE(); + return 0; } /** @@ -1137,9 +1200,9 @@ void libertas_interrupt(struct net_device *dev) { wlan_private *priv = dev->priv; - lbs_deb_enter(LBS_DEB_THREAD); + ENTER(); - lbs_deb_thread("libertas_interrupt: intcounter=%d\n", + lbs_pr_debug(1, "libertas_interrupt: intcounter=%d\n", priv->adapter->intcounter); priv->adapter->intcounter++; @@ -1147,35 +1210,56 @@ void libertas_interrupt(struct net_device *dev) if (priv->adapter->psstate == PS_STATE_SLEEP) { priv->adapter->psstate = PS_STATE_AWAKE; netif_wake_queue(dev); - netif_wake_queue(priv->mesh_dev); } wake_up_interruptible(&priv->mainthread.waitq); - lbs_deb_leave(LBS_DEB_THREAD); + LEAVE(); } -EXPORT_SYMBOL_GPL(libertas_interrupt); -static int libertas_init_module(void) +static int wlan_init_module(void) { - lbs_deb_enter(LBS_DEB_MAIN); + int ret = 0; + + ENTER(); + + if (libertas_fw_name == NULL) { + libertas_fw_name = default_fw_name; + } + libertas_debugfs_init(); - lbs_deb_leave(LBS_DEB_MAIN); - return 0; + + if (libertas_sbi_register()) { + ret = -1; + libertas_debugfs_remove(); + goto done; + } + +done: + LEAVE(); + return ret; } -static void libertas_exit_module(void) +static void wlan_cleanup_module(void) { - lbs_deb_enter(LBS_DEB_MAIN); + int i; + + ENTER(); + + for (i = 0; ipriv; + reset_device(priv); + } + libertas_sbi_unregister(); libertas_debugfs_remove(); - lbs_deb_leave(LBS_DEB_MAIN); + LEAVE(); } -module_init(libertas_init_module); -module_exit(libertas_exit_module); +module_init(wlan_init_module); +module_exit(wlan_cleanup_module); -MODULE_DESCRIPTION("Libertas WLAN Driver Library"); +MODULE_DESCRIPTION("M-WLAN Driver"); MODULE_AUTHOR("Marvell International Ltd."); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/net/wireless/libertas/rx.c b/trunk/drivers/net/wireless/libertas/rx.c index 88d9d2d787d5..96619a32951b 100644 --- a/trunk/drivers/net/wireless/libertas/rx.c +++ b/trunk/drivers/net/wireless/libertas/rx.c @@ -106,10 +106,10 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) { wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_RX); + ENTER(); - lbs_deb_rx("rxpd: SNR %d, NF %d\n", p_rx_pd->snr, p_rx_pd->nf); - lbs_deb_rx("before computing SNR: SNR-avg = %d, NF-avg = %d\n", + lbs_pr_debug(1, "rxpd: SNR = %d, NF = %d\n", p_rx_pd->snr, p_rx_pd->nf); + lbs_pr_debug(1, "Before computing SNR: SNR- avg = %d, NF-avg = %d\n", adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); @@ -121,7 +121,7 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) adapter->SNR[TYPE_RXPD][TYPE_AVG] = wlan_getavgsnr(priv) * AVG_SCALE; adapter->NF[TYPE_RXPD][TYPE_AVG] = wlan_getavgnf(priv) * AVG_SCALE; - lbs_deb_rx("after computing SNR: SNR-avg = %d, NF-avg = %d\n", + lbs_pr_debug(1, "After computing SNR: SNR-avg = %d, NF-avg = %d\n", adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); @@ -133,17 +133,18 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); - lbs_deb_leave(LBS_DEB_RX); + LEAVE(); } void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) { - lbs_deb_rx("skb->data %p\n", skb->data); + lbs_pr_debug(1, "skb->data=%p\n", skb->data); - if (priv->mesh_dev && IS_MESH_FRAME(skb)) - skb->protocol = eth_type_trans(skb, priv->mesh_dev); + if(IS_MESH_FRAME(skb)) + skb->dev = priv->mesh_dev; else - skb->protocol = eth_type_trans(skb, priv->dev); + skb->dev = priv->wlan_dev.netdev; + skb->protocol = eth_type_trans(skb, priv->wlan_dev.netdev); skb->ip_summed = CHECKSUM_UNNECESSARY; netif_rx(skb); @@ -170,7 +171,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) const u8 rfc1042_eth_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; - lbs_deb_enter(LBS_DEB_RX); + ENTER(); if (priv->adapter->debugmode & MRVDRV_DEBUG_RX_PATH) lbs_dbg_hex("RX packet: ", skb->data, @@ -190,7 +191,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) min_t(unsigned int, skb->len, 100)); if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { - lbs_deb_rx("rx err: frame received with bad length\n"); + lbs_pr_debug(1, "RX error: FRAME RECEIVED WITH BAD LENGTH\n"); priv->stats.rx_length_errors++; ret = 0; goto done; @@ -199,15 +200,15 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) /* * Check rxpd status and update 802.3 stat, */ - if (!(p_rx_pd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) { - lbs_deb_rx("rx err: frame received with bad status\n"); - lbs_pr_alert("rxpd not ok\n"); + if (!(p_rx_pd->status & MRVDRV_RXPD_STATUS_OK)) { + lbs_pr_debug(1, "RX error: frame received with bad status\n"); + lbs_pr_alert("rxpd Not OK\n"); priv->stats.rx_errors++; ret = 0; goto done; } - lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n", + lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n", skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); lbs_dbg_hex("RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr, @@ -265,7 +266,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) wlan_compute_rssi(priv, p_rx_pd); - lbs_deb_rx("rx data: size of actual packet %d\n", skb->len); + lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); priv->stats.rx_bytes += skb->len; priv->stats.rx_packets++; @@ -273,10 +274,10 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) ret = 0; done: - lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret); + LEAVE(); + return ret; } -EXPORT_SYMBOL_GPL(libertas_process_rxed_packet); /** * @brief This function converts Tx/Rx rates from the Marvell WLAN format @@ -313,7 +314,7 @@ static u8 convert_mv_rate_to_radiotap(u8 rate) case 11: /* 54 Mbps */ return 108; } - lbs_pr_alert("Invalid Marvell WLAN rate %i\n", rate); + lbs_pr_alert( "Invalid Marvell WLAN rate (%i)\n", rate); return 0; } @@ -335,7 +336,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) struct rx_radiotap_hdr radiotap_hdr; struct rx_radiotap_hdr *pradiotap_hdr; - lbs_deb_enter(LBS_DEB_RX); + ENTER(); p_rx_pkt = (struct rx80211packethdr *) skb->data; prxpd = &p_rx_pkt->rx_pd; @@ -343,7 +344,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) // lbs_dbg_hex("RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { - lbs_deb_rx("rx err: frame received wit bad length\n"); + lbs_pr_debug(1, "RX error: FRAME RECEIVED WITH BAD LENGTH\n"); priv->stats.rx_length_errors++; ret = 0; goto done; @@ -352,12 +353,12 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) /* * Check rxpd status and update 802.3 stat, */ - if (!(prxpd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) { - //lbs_deb_rx("rx err: frame received with bad status\n"); + if (!(prxpd->status & MRVDRV_RXPD_STATUS_OK)) { + //lbs_pr_debug(1, "RX error: frame received with bad status\n"); priv->stats.rx_errors++; } - lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n", + lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n", skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); /* create the exported radio header */ @@ -385,7 +386,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) /* XXX must check no carryout */ radiotap_hdr.antsignal = prxpd->snr + prxpd->nf; radiotap_hdr.rx_flags = 0; - if (!(prxpd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) + if (!(prxpd->status & MRVDRV_RXPD_STATUS_OK)) radiotap_hdr.rx_flags |= IEEE80211_RADIOTAP_F_RX_BADFCS; //memset(radiotap_hdr.pad, 0x11, IEEE80211_RADIOTAP_HDRLEN - 18); @@ -398,7 +399,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) { - lbs_pr_alert("%s: couldn't pskb_expand_head\n", + lbs_pr_alert( "%s: couldn't pskb_expand_head\n", __func__); } @@ -413,7 +414,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) default: /* unknown header */ - lbs_pr_alert("Unknown radiomode %i\n", + lbs_pr_alert( "Unknown radiomode (%i)\n", priv->adapter->radiomode); /* don't export any header */ /* chop the rxpd */ @@ -430,16 +431,15 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) wlan_compute_rssi(priv, prxpd); - lbs_deb_rx("rx data: size of actual packet %d\n", skb->len); + lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); priv->stats.rx_bytes += skb->len; priv->stats.rx_packets++; libertas_upload_rx_packet(priv, skb); ret = 0; - done: - skb->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ - lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret); - return ret; + LEAVE(); + + return (ret); } diff --git a/trunk/drivers/net/wireless/libertas/sbi.h b/trunk/drivers/net/wireless/libertas/sbi.h new file mode 100644 index 000000000000..59d3a59ccef0 --- /dev/null +++ b/trunk/drivers/net/wireless/libertas/sbi.h @@ -0,0 +1,40 @@ +/** + * This file contains IF layer definitions. + */ + +#ifndef _SBI_H_ +#define _SBI_H_ + +#include + +#include "defs.h" + +/** INT status Bit Definition*/ +#define his_cmddnldrdy 0x01 +#define his_cardevent 0x02 +#define his_cmdupldrdy 0x04 + +#ifndef DEV_NAME_LEN +#define DEV_NAME_LEN 32 +#endif + +#define SBI_EVENT_CAUSE_SHIFT 3 + +/* Probe and Check if the card is present*/ +int libertas_sbi_register_dev(wlan_private * priv); +int libertas_sbi_unregister_dev(wlan_private *); +int libertas_sbi_get_int_status(wlan_private * priv, u8 *); +int libertas_sbi_register(void); +void libertas_sbi_unregister(void); +int libertas_sbi_prog_firmware(wlan_private *); + +int libertas_sbi_read_event_cause(wlan_private *); +int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb); +wlan_private *libertas_sbi_get_priv(void *card); + +#ifdef ENABLE_PM +int libertas_sbi_suspend(wlan_private *); +int libertas_sbi_resume(wlan_private *); +#endif + +#endif /* _SBI_H */ diff --git a/trunk/drivers/net/wireless/libertas/scan.c b/trunk/drivers/net/wireless/libertas/scan.c index 606af50fa09b..3c0b1a2a1727 100644 --- a/trunk/drivers/net/wireless/libertas/scan.c +++ b/trunk/drivers/net/wireless/libertas/scan.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include @@ -59,82 +58,12 @@ //! Scan time specified in the channel TLV for each channel for active scans #define MRVDRV_ACTIVE_SCAN_CHAN_TIME 100 -static const u8 zeromac[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const u8 bcastmac[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - -static inline void clear_bss_descriptor (struct bss_descriptor * bss) -{ - /* Don't blow away ->list, just BSS data */ - memset(bss, 0, offsetof(struct bss_descriptor, list)); -} - -static inline int match_bss_no_security(struct wlan_802_11_security * secinfo, - struct bss_descriptor * match_bss) -{ - if ( !secinfo->wep_enabled - && !secinfo->WPAenabled - && !secinfo->WPA2enabled - && match_bss->wpa_ie[0] != WPA_IE - && match_bss->rsn_ie[0] != WPA2_IE - && !match_bss->privacy) { - return 1; - } - return 0; -} - -static inline int match_bss_static_wep(struct wlan_802_11_security * secinfo, - struct bss_descriptor * match_bss) -{ - if ( secinfo->wep_enabled - && !secinfo->WPAenabled - && !secinfo->WPA2enabled - && match_bss->privacy) { - return 1; - } - return 0; -} - -static inline int match_bss_wpa(struct wlan_802_11_security * secinfo, - struct bss_descriptor * match_bss) -{ - if ( !secinfo->wep_enabled - && secinfo->WPAenabled - && (match_bss->wpa_ie[0] == WPA_IE) - /* privacy bit may NOT be set in some APs like LinkSys WRT54G - && bss->privacy */ - ) { - return 1; - } - return 0; -} - -static inline int match_bss_wpa2(struct wlan_802_11_security * secinfo, - struct bss_descriptor * match_bss) -{ - if ( !secinfo->wep_enabled - && secinfo->WPA2enabled - && (match_bss->rsn_ie[0] == WPA2_IE) - /* privacy bit may NOT be set in some APs like LinkSys WRT54G - && bss->privacy */ - ) { - return 1; - } - return 0; -} - -static inline int match_bss_dynamic_wep(struct wlan_802_11_security * secinfo, - struct bss_descriptor * match_bss) -{ - if ( !secinfo->wep_enabled - && !secinfo->WPAenabled - && !secinfo->WPA2enabled - && (match_bss->wpa_ie[0] != WPA_IE) - && (match_bss->rsn_ie[0] != WPA2_IE) - && match_bss->privacy) { - return 1; - } - return 0; -} +//! Macro to enable/disable SSID checking before storing a scan table +#ifdef DISCARD_BAD_SSID +#define CHECK_SSID_IS_VALID(x) ssid_valid(&bssidEntry.ssid) +#else +#define CHECK_SSID_IS_VALID(x) 1 +#endif /** * @brief Check if a scanned network compatible with the driver settings @@ -155,63 +84,123 @@ static inline int match_bss_dynamic_wep(struct wlan_802_11_security * secinfo, * * @return Index in scantable, or error code if negative */ -static int is_network_compatible(wlan_adapter * adapter, - struct bss_descriptor * bss, u8 mode) +static int is_network_compatible(wlan_adapter * adapter, int index, u8 mode) { - int matched = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - if (bss->mode != mode) - goto done; - - if ((matched = match_bss_no_security(&adapter->secinfo, bss))) { - goto done; - } else if ((matched = match_bss_static_wep(&adapter->secinfo, bss))) { - goto done; - } else if ((matched = match_bss_wpa(&adapter->secinfo, bss))) { - lbs_deb_scan( - "is_network_compatible() WPA: wpa_ie=%#x " - "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s " - "privacy=%#x\n", bss->wpa_ie[0], bss->rsn_ie[0], - adapter->secinfo.wep_enabled ? "e" : "d", - adapter->secinfo.WPAenabled ? "e" : "d", - adapter->secinfo.WPA2enabled ? "e" : "d", - bss->privacy); - goto done; - } else if ((matched = match_bss_wpa2(&adapter->secinfo, bss))) { - lbs_deb_scan( - "is_network_compatible() WPA2: wpa_ie=%#x " - "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s " - "privacy=%#x\n", bss->wpa_ie[0], bss->rsn_ie[0], + ENTER(); + + if (adapter->scantable[index].mode == mode) { + if ( !adapter->secinfo.wep_enabled + && !adapter->secinfo.WPAenabled + && !adapter->secinfo.WPA2enabled + && adapter->scantable[index].wpa_ie[0] != WPA_IE + && adapter->scantable[index].rsn_ie[0] != WPA2_IE + && !adapter->scantable[index].privacy) { + /* no security */ + LEAVE(); + return index; + } else if ( adapter->secinfo.wep_enabled + && !adapter->secinfo.WPAenabled + && !adapter->secinfo.WPA2enabled + && adapter->scantable[index].privacy) { + /* static WEP enabled */ + LEAVE(); + return index; + } else if ( !adapter->secinfo.wep_enabled + && adapter->secinfo.WPAenabled + && !adapter->secinfo.WPA2enabled + && (adapter->scantable[index].wpa_ie[0] == WPA_IE) + /* privacy bit may NOT be set in some APs like LinkSys WRT54G + && adapter->scantable[index].privacy */ + ) { + /* WPA enabled */ + lbs_pr_debug(1, + "is_network_compatible() WPA: index=%d wpa_ie=%#x " + "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s " + "privacy=%#x\n", index, + adapter->scantable[index].wpa_ie[0], + adapter->scantable[index].rsn_ie[0], + adapter->secinfo.wep_enabled ? "e" : "d", + adapter->secinfo.WPAenabled ? "e" : "d", + adapter->secinfo.WPA2enabled ? "e" : "d", + adapter->scantable[index].privacy); + LEAVE(); + return index; + } else if ( !adapter->secinfo.wep_enabled + && !adapter->secinfo.WPAenabled + && adapter->secinfo.WPA2enabled + && (adapter->scantable[index].rsn_ie[0] == WPA2_IE) + /* privacy bit may NOT be set in some APs like LinkSys WRT54G + && adapter->scantable[index].privacy */ + ) { + /* WPA2 enabled */ + lbs_pr_debug(1, + "is_network_compatible() WPA2: index=%d wpa_ie=%#x " + "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s " + "privacy=%#x\n", index, + adapter->scantable[index].wpa_ie[0], + adapter->scantable[index].rsn_ie[0], + adapter->secinfo.wep_enabled ? "e" : "d", + adapter->secinfo.WPAenabled ? "e" : "d", + adapter->secinfo.WPA2enabled ? "e" : "d", + adapter->scantable[index].privacy); + LEAVE(); + return index; + } else if ( !adapter->secinfo.wep_enabled + && !adapter->secinfo.WPAenabled + && !adapter->secinfo.WPA2enabled + && (adapter->scantable[index].wpa_ie[0] != WPA_IE) + && (adapter->scantable[index].rsn_ie[0] != WPA2_IE) + && adapter->scantable[index].privacy) { + /* dynamic WEP enabled */ + lbs_pr_debug(1, + "is_network_compatible() dynamic WEP: index=%d " + "wpa_ie=%#x wpa2_ie=%#x privacy=%#x\n", + index, + adapter->scantable[index].wpa_ie[0], + adapter->scantable[index].rsn_ie[0], + adapter->scantable[index].privacy); + LEAVE(); + return index; + } + + /* security doesn't match */ + lbs_pr_debug(1, + "is_network_compatible() FAILED: index=%d wpa_ie=%#x " + "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s privacy=%#x\n", + index, + adapter->scantable[index].wpa_ie[0], + adapter->scantable[index].rsn_ie[0], adapter->secinfo.wep_enabled ? "e" : "d", adapter->secinfo.WPAenabled ? "e" : "d", adapter->secinfo.WPA2enabled ? "e" : "d", - bss->privacy); - goto done; - } else if ((matched = match_bss_dynamic_wep(&adapter->secinfo, bss))) { - lbs_deb_scan( - "is_network_compatible() dynamic WEP: " - "wpa_ie=%#x wpa2_ie=%#x privacy=%#x\n", - bss->wpa_ie[0], - bss->rsn_ie[0], - bss->privacy); - goto done; + adapter->scantable[index].privacy); + LEAVE(); + return -ECONNREFUSED; + } + + /* mode doesn't match */ + LEAVE(); + return -ENETUNREACH; +} + +/** + * @brief This function validates a SSID as being able to be printed + * + * @param pssid SSID structure to validate + * + * @return TRUE or FALSE + */ +static u8 ssid_valid(struct WLAN_802_11_SSID *pssid) +{ + int ssididx; + + for (ssididx = 0; ssididx < pssid->ssidlength; ssididx++) { + if (!isprint(pssid->ssid[ssididx])) { + return 0; + } } - /* bss security settings don't match those configured on card */ - lbs_deb_scan( - "is_network_compatible() FAILED: wpa_ie=%#x " - "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s privacy=%#x\n", - bss->wpa_ie[0], bss->rsn_ie[0], - adapter->secinfo.wep_enabled ? "e" : "d", - adapter->secinfo.WPAenabled ? "e" : "d", - adapter->secinfo.WPA2enabled ? "e" : "d", - bss->privacy); - -done: - lbs_deb_leave(LBS_DEB_SCAN); - return matched; + return 1; } /** @@ -231,19 +220,44 @@ static int is_network_compatible(wlan_adapter * adapter, static void wlan_scan_process_results(wlan_private * priv) { wlan_adapter *adapter = priv->adapter; - struct bss_descriptor * iter_bss; - int i = 0; + int foundcurrent; + int i; + + foundcurrent = 0; + + if (adapter->connect_status == libertas_connected) { + /* try to find the current BSSID in the new scan list */ + for (i = 0; i < adapter->numinscantable; i++) { + if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, + &adapter->curbssparams.ssid) && + !memcmp(adapter->curbssparams.bssid, + adapter->scantable[i].macaddress, + ETH_ALEN)) { + foundcurrent = 1; + } + } - if (adapter->connect_status == libertas_connected) - return; + if (foundcurrent) { + /* Make a copy of current BSSID descriptor */ + memcpy(&adapter->curbssparams.bssdescriptor, + &adapter->scantable[i], + sizeof(adapter->curbssparams.bssdescriptor)); + } + } - mutex_lock(&adapter->lock); - list_for_each_entry (iter_bss, &adapter->network_list, list) { - lbs_deb_scan("Scan:(%02d) " MAC_FMT ", RSSI[%03d], SSID[%s]\n", - i++, MAC_ARG(iter_bss->bssid), (s32) iter_bss->rssi, - escape_essid(iter_bss->ssid, iter_bss->ssid_len)); + for (i = 0; i < adapter->numinscantable; i++) { + lbs_pr_debug(1, "Scan:(%02d) %02x:%02x:%02x:%02x:%02x:%02x, " + "RSSI[%03d], SSID[%s]\n", + i, + adapter->scantable[i].macaddress[0], + adapter->scantable[i].macaddress[1], + adapter->scantable[i].macaddress[2], + adapter->scantable[i].macaddress[3], + adapter->scantable[i].macaddress[4], + adapter->scantable[i].macaddress[5], + (s32) adapter->scantable[i].rssi, + adapter->scantable[i].ssid.ssid); } - mutex_unlock(&adapter->lock); } /** @@ -324,12 +338,14 @@ static void wlan_scan_create_channel_list(wlan_private * priv, if (scantype == cmd_scan_type_passive) { scanchanlist[chanidx].maxscantime = - cpu_to_le16(MRVDRV_PASSIVE_SCAN_CHAN_TIME); + cpu_to_le16 + (MRVDRV_PASSIVE_SCAN_CHAN_TIME); scanchanlist[chanidx].chanscanmode.passivescan = 1; } else { scanchanlist[chanidx].maxscantime = - cpu_to_le16(MRVDRV_ACTIVE_SCAN_CHAN_TIME); + cpu_to_le16 + (MRVDRV_ACTIVE_SCAN_CHAN_TIME); scanchanlist[chanidx].chanscanmode.passivescan = 0; } @@ -392,11 +408,13 @@ wlan_scan_setup_scan_config(wlan_private * priv, u8 * pscancurrentonly) { wlan_adapter *adapter = priv->adapter; + const u8 zeromac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; struct mrvlietypes_numprobes *pnumprobestlv; struct mrvlietypes_ssidparamset *pssidtlv; struct wlan_scan_cmd_config * pscancfgout = NULL; u8 *ptlvpos; u16 numprobes; + u16 ssidlen; int chanidx; int scantype; int scandur; @@ -453,18 +471,21 @@ wlan_scan_setup_scan_config(wlan_private * priv, * Set the BSSID filter to the incoming configuration, * if non-zero. If not set, it will remain disabled (all zeros). */ - memcpy(pscancfgout->bssid, puserscanin->bssid, - sizeof(pscancfgout->bssid)); + memcpy(pscancfgout->specificBSSID, + puserscanin->specificBSSID, + sizeof(pscancfgout->specificBSSID)); + + ssidlen = strlen(puserscanin->specificSSID); - if (puserscanin->ssid_len) { + if (ssidlen) { pssidtlv = (struct mrvlietypes_ssidparamset *) pscancfgout-> tlvbuffer; pssidtlv->header.type = cpu_to_le16(TLV_TYPE_SSID); - pssidtlv->header.len = cpu_to_le16(puserscanin->ssid_len); - memcpy(pssidtlv->ssid, puserscanin->ssid, - puserscanin->ssid_len); - ptlvpos += sizeof(pssidtlv->header) + puserscanin->ssid_len; + pssidtlv->header.len = cpu_to_le16(ssidlen); + memcpy(pssidtlv->ssid, puserscanin->specificSSID, + ssidlen); + ptlvpos += sizeof(pssidtlv->header) + ssidlen; } /* @@ -473,8 +494,8 @@ wlan_scan_setup_scan_config(wlan_private * priv, * scan results. That is not an issue with an SSID or BSSID * filter applied to the scan results in the firmware. */ - if ( puserscanin->ssid_len - || (compare_ether_addr(pscancfgout->bssid, &zeromac[0]) != 0)) { + if (ssidlen || (memcmp(pscancfgout->specificBSSID, + &zeromac, sizeof(zeromac)) != 0)) { *pmaxchanperscan = MRVDRV_MAX_CHANNELS_PER_SCAN; *pfilteredscan = 1; } @@ -486,11 +507,16 @@ wlan_scan_setup_scan_config(wlan_private * priv, /* If the input config or adapter has the number of Probes set, add tlv */ if (numprobes) { pnumprobestlv = (struct mrvlietypes_numprobes *) ptlvpos; - pnumprobestlv->header.type = cpu_to_le16(TLV_TYPE_NUMPROBES); - pnumprobestlv->header.len = cpu_to_le16(2); + pnumprobestlv->header.type = + cpu_to_le16(TLV_TYPE_NUMPROBES); + pnumprobestlv->header.len = sizeof(pnumprobestlv->numprobes); pnumprobestlv->numprobes = cpu_to_le16(numprobes); - ptlvpos += sizeof(*pnumprobestlv); + ptlvpos += + sizeof(pnumprobestlv->header) + pnumprobestlv->header.len; + + pnumprobestlv->header.len = + cpu_to_le16(pnumprobestlv->header.len); } /* @@ -503,7 +529,7 @@ wlan_scan_setup_scan_config(wlan_private * priv, if (puserscanin && puserscanin->chanlist[0].channumber) { - lbs_deb_scan("Scan: Using supplied channel list\n"); + lbs_pr_debug(1, "Scan: Using supplied channel list\n"); for (chanidx = 0; chanidx < WLAN_IOCTL_USER_SCAN_CHAN_MAX @@ -547,11 +573,11 @@ wlan_scan_setup_scan_config(wlan_private * priv, == priv->adapter->curbssparams.channel)) { *pscancurrentonly = 1; - lbs_deb_scan("Scan: Scanning current channel only"); + lbs_pr_debug(1, "Scan: Scanning current channel only"); } } else { - lbs_deb_scan("Scan: Creating full region channel list\n"); + lbs_pr_debug(1, "Scan: Creating full region channel list\n"); wlan_scan_create_channel_list(priv, pscanchanlist, *pfilteredscan); } @@ -587,9 +613,7 @@ static int wlan_scan_channel_list(wlan_private * priv, u8 filteredscan, struct wlan_scan_cmd_config * pscancfgout, struct mrvlietypes_chanlistparamset * pchantlvout, - struct chanscanparamset * pscanchanlist, - const struct wlan_ioctl_user_scan_cfg * puserscanin, - int full_scan) + struct chanscanparamset * pscanchanlist) { struct chanscanparamset *ptmpchan; struct chanscanparamset *pstartchan; @@ -597,13 +621,11 @@ static int wlan_scan_channel_list(wlan_private * priv, int doneearly; int tlvidx; int ret = 0; - int scanned = 0; - union iwreq_data wrqu; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); if (pscancfgout == 0 || pchantlvout == 0 || pscanchanlist == 0) { - lbs_deb_scan("Scan: Null detect: %p, %p, %p\n", + lbs_pr_debug(1, "Scan: Null detect: %p, %p, %p\n", pscancfgout, pchantlvout, pscanchanlist); return -1; } @@ -613,9 +635,6 @@ static int wlan_scan_channel_list(wlan_private * priv, /* Set the temp channel struct pointer to the start of the desired list */ ptmpchan = pscanchanlist; - if (priv->adapter->last_scanned_channel && !puserscanin) - ptmpchan += priv->adapter->last_scanned_channel; - /* Loop through the desired channel list, sending a new firmware scan * commands for each maxchanperscan channels (or for 1,6,11 individually * if configured accordingly) @@ -635,9 +654,9 @@ static int wlan_scan_channel_list(wlan_private * priv, * - doneearly is set (controlling individual scanning of 1,6,11) */ while (tlvidx < maxchanperscan && ptmpchan->channumber - && !doneearly && scanned < 2) { + && !doneearly) { - lbs_deb_scan( + lbs_pr_debug(1, "Scan: Chan(%3d), Radio(%d), mode(%d,%d), Dur(%d)\n", ptmpchan->channumber, ptmpchan->radiotype, ptmpchan->chanscanmode.passivescan, @@ -649,11 +668,8 @@ static int wlan_scan_channel_list(wlan_private * priv, ptmpchan, sizeof(pchantlvout->chanscanparam)); /* Increment the TLV header length by the size appended */ - /* Ew, it would be _so_ nice if we could just declare the - variable little-endian and let GCC handle it for us */ - pchantlvout->header.len = - cpu_to_le16(le16_to_cpu(pchantlvout->header.len) + - sizeof(pchantlvout->chanscanparam)); + pchantlvout->header.len += + sizeof(pchantlvout->chanscanparam); /* * The tlv buffer length is set to the number of bytes of the @@ -667,7 +683,7 @@ static int wlan_scan_channel_list(wlan_private * priv, /* Add the size of the channel tlv header and the data length */ pscancfgout->tlvbufferlen += (sizeof(pchantlvout->header) - + le16_to_cpu(pchantlvout->header.len)); + + pchantlvout->header.len); /* Increment the index to the channel tlv we are constructing */ tlvidx++; @@ -685,7 +701,6 @@ static int wlan_scan_channel_list(wlan_private * priv, /* Increment the tmp pointer to the next channel to be scanned */ ptmpchan++; - scanned++; /* Stop the loop if the *next* channel is in the 1,6,11 set. * This will cause it to be the only channel scanned on the next @@ -701,71 +716,12 @@ static int wlan_scan_channel_list(wlan_private * priv, /* Send the scan command to the firmware with the specified cfg */ ret = libertas_prepare_and_send_command(priv, cmd_802_11_scan, 0, 0, 0, pscancfgout); - if (scanned >= 2 && !full_scan) { - ret = 0; - goto done; - } - scanned = 0; } -done: - priv->adapter->last_scanned_channel = ptmpchan->channumber; - - /* Tell userspace the scan table has been updated */ - memset(&wrqu, 0, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL); - - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); + LEAVE(); return ret; } -static void -clear_selected_scan_list_entries(wlan_adapter * adapter, - const struct wlan_ioctl_user_scan_cfg * scan_cfg) -{ - struct bss_descriptor * bss; - struct bss_descriptor * safe; - u32 clear_ssid_flag = 0, clear_bssid_flag = 0; - - if (!scan_cfg) - return; - - if (scan_cfg->clear_ssid && scan_cfg->ssid_len) - clear_ssid_flag = 1; - - if (scan_cfg->clear_bssid - && (compare_ether_addr(scan_cfg->bssid, &zeromac[0]) != 0) - && (compare_ether_addr(scan_cfg->bssid, &bcastmac[0]) != 0)) { - clear_bssid_flag = 1; - } - - if (!clear_ssid_flag && !clear_bssid_flag) - return; - - mutex_lock(&adapter->lock); - list_for_each_entry_safe (bss, safe, &adapter->network_list, list) { - u32 clear = 0; - - /* Check for an SSID match */ - if ( clear_ssid_flag - && (bss->ssid_len == scan_cfg->ssid_len) - && !memcmp(bss->ssid, scan_cfg->ssid, bss->ssid_len)) - clear = 1; - - /* Check for a BSSID match */ - if ( clear_bssid_flag - && !compare_ether_addr(bss->bssid, scan_cfg->bssid)) - clear = 1; - - if (clear) { - list_move_tail (&bss->list, &adapter->network_free_list); - clear_bss_descriptor(bss); - } - } - mutex_unlock(&adapter->lock); -} - - /** * @brief Internal function used to start a scan based on an input config * @@ -780,19 +736,19 @@ clear_selected_scan_list_entries(wlan_adapter * adapter, * @return 0 or < 0 if error */ int wlan_scan_networks(wlan_private * priv, - const struct wlan_ioctl_user_scan_cfg * puserscanin, - int full_scan) + const struct wlan_ioctl_user_scan_cfg * puserscanin) { - wlan_adapter * adapter = priv->adapter; + wlan_adapter *adapter = priv->adapter; struct mrvlietypes_chanlistparamset *pchantlvout; struct chanscanparamset * scan_chan_list = NULL; struct wlan_scan_cmd_config * scan_cfg = NULL; + u8 keeppreviousscan; u8 filteredscan; u8 scancurrentchanonly; int maxchanperscan; int ret; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); scan_chan_list = kzalloc(sizeof(struct chanscanparamset) * WLAN_IOCTL_USER_SCAN_CHAN_MAX, GFP_KERNEL); @@ -813,14 +769,22 @@ int wlan_scan_networks(wlan_private * priv, goto out; } - clear_selected_scan_list_entries(adapter, puserscanin); + keeppreviousscan = 0; + + if (puserscanin) { + keeppreviousscan = puserscanin->keeppreviousscan; + } + + if (!keeppreviousscan) { + memset(adapter->scantable, 0x00, + sizeof(struct bss_descriptor) * MRVDRV_MAX_BSSID_LIST); + adapter->numinscantable = 0; + } /* Keep the data path active if we are only scanning our current channel */ if (!scancurrentchanonly) { - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - netif_stop_queue(priv->mesh_dev); - netif_carrier_off(priv->mesh_dev); + netif_stop_queue(priv->wlan_dev.netdev); + netif_carrier_off(priv->wlan_dev.netdev); } ret = wlan_scan_channel_list(priv, @@ -828,9 +792,7 @@ int wlan_scan_networks(wlan_private * priv, filteredscan, scan_cfg, pchantlvout, - scan_chan_list, - puserscanin, - full_scan); + scan_chan_list); /* Process the resulting scan table: * - Remove any bad ssids @@ -839,10 +801,8 @@ int wlan_scan_networks(wlan_private * priv, wlan_scan_process_results(priv); if (priv->adapter->connect_status == libertas_connected) { - netif_carrier_on(priv->dev); - netif_wake_queue(priv->dev); - netif_carrier_on(priv->mesh_dev); - netif_wake_queue(priv->mesh_dev); + netif_carrier_on(priv->wlan_dev.netdev); + netif_wake_queue(priv->wlan_dev.netdev); } out: @@ -852,7 +812,7 @@ int wlan_scan_networks(wlan_private * priv, if (scan_chan_list) kfree(scan_chan_list); - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); + LEAVE(); return ret; } @@ -883,7 +843,7 @@ void wlan_ret_802_11_scan_get_tlv_ptrs(struct mrvlietypes_data * ptlv, tlvbufleft = tlvbufsize; *ptsftlv = NULL; - lbs_deb_scan("SCAN_RESP: tlvbufsize = %d\n", tlvbufsize); + lbs_pr_debug(1, "SCAN_RESP: tlvbufsize = %d\n", tlvbufsize); lbs_dbg_hex("SCAN_RESP: TLV Buf", (u8 *) ptlv, tlvbufsize); while (tlvbufleft >= sizeof(struct mrvlietypesheader)) { @@ -896,7 +856,7 @@ void wlan_ret_802_11_scan_get_tlv_ptrs(struct mrvlietypes_data * ptlv, break; default: - lbs_deb_scan("SCAN_RESP: Unhandled TLV = %d\n", + lbs_pr_debug(1, "SCAN_RESP: Unhandled TLV = %d\n", tlvtype); /* Give up, this seems corrupted */ return; @@ -915,12 +875,12 @@ void wlan_ret_802_11_scan_get_tlv_ptrs(struct mrvlietypes_data * ptlv, * response or beacon from the scan command. Record information as needed * in the scan table struct bss_descriptor for that entry. * - * @param bss Output parameter: Pointer to the BSS Entry + * @param pBSSIDEntry Output parameter: Pointer to the BSS Entry * * @return 0 or -1 */ -static int libertas_process_bss(struct bss_descriptor * bss, - u8 ** pbeaconinfo, int *bytesleft) +static int InterpretBSSDescriptionWithIE(struct bss_descriptor * pBSSEntry, + u8 ** pbeaconinfo, int *bytesleft) { enum ieeetypes_elementid elemID; struct ieeetypes_fhparamset *pFH; @@ -937,14 +897,13 @@ static int libertas_process_bss(struct bss_descriptor * bss, u16 beaconsize; u8 founddatarateie; int bytesleftforcurrentbeacon; - int ret; struct IE_WPA *pIe; const u8 oui01[4] = { 0x00, 0x50, 0xf2, 0x01 }; struct ieeetypes_countryinfoset *pcountryinfo; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); founddatarateie = 0; ratesize = 0; @@ -952,7 +911,8 @@ static int libertas_process_bss(struct bss_descriptor * bss, if (*bytesleft >= sizeof(beaconsize)) { /* Extract & convert beacon size from the command buffer */ - beaconsize = le16_to_cpup((void *)*pbeaconinfo); + memcpy(&beaconsize, *pbeaconinfo, sizeof(beaconsize)); + beaconsize = le16_to_cpu(beaconsize); *bytesleft -= sizeof(beaconsize); *pbeaconinfo += sizeof(beaconsize); } @@ -974,14 +934,17 @@ static int libertas_process_bss(struct bss_descriptor * bss, bytesleftforcurrentbeacon = beaconsize; - memcpy(bss->bssid, pcurrentptr, ETH_ALEN); - lbs_deb_scan("process_bss: AP BSSID " MAC_FMT "\n", MAC_ARG(bss->bssid)); + memcpy(pBSSEntry->macaddress, pcurrentptr, ETH_ALEN); + lbs_pr_debug(1, "InterpretIE: AP MAC Addr-%x:%x:%x:%x:%x:%x\n", + pBSSEntry->macaddress[0], pBSSEntry->macaddress[1], + pBSSEntry->macaddress[2], pBSSEntry->macaddress[3], + pBSSEntry->macaddress[4], pBSSEntry->macaddress[5]); pcurrentptr += ETH_ALEN; bytesleftforcurrentbeacon -= ETH_ALEN; if (bytesleftforcurrentbeacon < 12) { - lbs_deb_scan("process_bss: Not enough bytes left\n"); + lbs_pr_debug(1, "InterpretIE: Not enough bytes left\n"); return -1; } @@ -991,48 +954,51 @@ static int libertas_process_bss(struct bss_descriptor * bss, */ /* RSSI is 1 byte long */ - bss->rssi = *pcurrentptr; - lbs_deb_scan("process_bss: RSSI=%02X\n", *pcurrentptr); + pBSSEntry->rssi = le32_to_cpu((long)(*pcurrentptr)); + lbs_pr_debug(1, "InterpretIE: RSSI=%02X\n", *pcurrentptr); pcurrentptr += 1; bytesleftforcurrentbeacon -= 1; /* time stamp is 8 bytes long */ - fixedie.timestamp = bss->timestamp = le64_to_cpup((void *)pcurrentptr); + memcpy(fixedie.timestamp, pcurrentptr, 8); + memcpy(pBSSEntry->timestamp, pcurrentptr, 8); pcurrentptr += 8; bytesleftforcurrentbeacon -= 8; /* beacon interval is 2 bytes long */ - fixedie.beaconinterval = bss->beaconperiod = le16_to_cpup((void *)pcurrentptr); + memcpy(&fixedie.beaconinterval, pcurrentptr, 2); + pBSSEntry->beaconperiod = le16_to_cpu(fixedie.beaconinterval); pcurrentptr += 2; bytesleftforcurrentbeacon -= 2; /* capability information is 2 bytes long */ - memcpy(&fixedie.capabilities, pcurrentptr, 2); - lbs_deb_scan("process_bss: fixedie.capabilities=0x%X\n", + memcpy(&fixedie.capabilities, pcurrentptr, 2); + lbs_pr_debug(1, "InterpretIE: fixedie.capabilities=0x%X\n", fixedie.capabilities); + fixedie.capabilities = le16_to_cpu(fixedie.capabilities); pcap = (struct ieeetypes_capinfo *) & fixedie.capabilities; - memcpy(&bss->cap, pcap, sizeof(struct ieeetypes_capinfo)); + memcpy(&pBSSEntry->cap, pcap, sizeof(struct ieeetypes_capinfo)); pcurrentptr += 2; bytesleftforcurrentbeacon -= 2; /* rest of the current buffer are IE's */ - lbs_deb_scan("process_bss: IE length for this AP = %d\n", + lbs_pr_debug(1, "InterpretIE: IElength for this AP = %d\n", bytesleftforcurrentbeacon); - lbs_dbg_hex("process_bss: IE info", (u8 *) pcurrentptr, + lbs_dbg_hex("InterpretIE: IE info", (u8 *) pcurrentptr, bytesleftforcurrentbeacon); if (pcap->privacy) { - lbs_deb_scan("process_bss: AP WEP enabled\n"); - bss->privacy = wlan802_11privfilter8021xWEP; + lbs_pr_debug(1, "InterpretIE: AP WEP enabled\n"); + pBSSEntry->privacy = wlan802_11privfilter8021xWEP; } else { - bss->privacy = wlan802_11privfilteracceptall; + pBSSEntry->privacy = wlan802_11privfilteracceptall; } if (pcap->ibss == 1) { - bss->mode = IW_MODE_ADHOC; + pBSSEntry->mode = IW_MODE_ADHOC; } else { - bss->mode = IW_MODE_INFRA; + pBSSEntry->mode = IW_MODE_INFRA; } /* process variable IE */ @@ -1041,83 +1007,94 @@ static int libertas_process_bss(struct bss_descriptor * bss, elemlen = *((u8 *) pcurrentptr + 1); if (bytesleftforcurrentbeacon < elemlen) { - lbs_deb_scan("process_bss: error in processing IE, " + lbs_pr_debug(1, "InterpretIE: error in processing IE, " "bytes left < IE length\n"); bytesleftforcurrentbeacon = 0; continue; } switch (elemID) { + case SSID: - bss->ssid_len = elemlen; - memcpy(bss->ssid, (pcurrentptr + 2), elemlen); - lbs_deb_scan("ssid '%s', ssid length %u\n", - escape_essid(bss->ssid, bss->ssid_len), - bss->ssid_len); + pBSSEntry->ssid.ssidlength = elemlen; + memcpy(pBSSEntry->ssid.ssid, (pcurrentptr + 2), + elemlen); + lbs_pr_debug(1, "ssid: %32s", pBSSEntry->ssid.ssid); break; case SUPPORTED_RATES: - memcpy(bss->datarates, (pcurrentptr + 2), elemlen); - memmove(bss->libertas_supported_rates, (pcurrentptr + 2), + memcpy(pBSSEntry->datarates, (pcurrentptr + 2), + elemlen); + memmove(pBSSEntry->libertas_supported_rates, (pcurrentptr + 2), elemlen); ratesize = elemlen; founddatarateie = 1; break; case EXTRA_IE: - lbs_deb_scan("process_bss: EXTRA_IE Found!\n"); + lbs_pr_debug(1, "InterpretIE: EXTRA_IE Found!\n"); + pBSSEntry->extra_ie = 1; break; case FH_PARAM_SET: pFH = (struct ieeetypes_fhparamset *) pcurrentptr; - memmove(&bss->phyparamset.fhparamset, pFH, + memmove(&pBSSEntry->phyparamset.fhparamset, pFH, sizeof(struct ieeetypes_fhparamset)); -#if 0 /* I think we can store these LE */ - bss->phyparamset.fhparamset.dwelltime - = le16_to_cpu(bss->phyparamset.fhparamset.dwelltime); -#endif + pBSSEntry->phyparamset.fhparamset.dwelltime + = + le16_to_cpu(pBSSEntry->phyparamset.fhparamset. + dwelltime); break; case DS_PARAM_SET: pDS = (struct ieeetypes_dsparamset *) pcurrentptr; - bss->channel = pDS->currentchan; - memcpy(&bss->phyparamset.dsparamset, pDS, + + pBSSEntry->channel = pDS->currentchan; + + memcpy(&pBSSEntry->phyparamset.dsparamset, pDS, sizeof(struct ieeetypes_dsparamset)); break; case CF_PARAM_SET: pCF = (struct ieeetypes_cfparamset *) pcurrentptr; - memcpy(&bss->ssparamset.cfparamset, pCF, + + memcpy(&pBSSEntry->ssparamset.cfparamset, pCF, sizeof(struct ieeetypes_cfparamset)); break; case IBSS_PARAM_SET: pibss = (struct ieeetypes_ibssparamset *) pcurrentptr; - bss->atimwindow = le32_to_cpu(pibss->atimwindow); - memmove(&bss->ssparamset.ibssparamset, pibss, + pBSSEntry->atimwindow = + le32_to_cpu(pibss->atimwindow); + + memmove(&pBSSEntry->ssparamset.ibssparamset, pibss, sizeof(struct ieeetypes_ibssparamset)); -#if 0 - bss->ssparamset.ibssparamset.atimwindow - = le16_to_cpu(bss->ssparamset.ibssparamset.atimwindow); -#endif + + pBSSEntry->ssparamset.ibssparamset.atimwindow + = + le16_to_cpu(pBSSEntry->ssparamset.ibssparamset. + atimwindow); break; /* Handle Country Info IE */ case COUNTRY_INFO: - pcountryinfo = (struct ieeetypes_countryinfoset *) pcurrentptr; - if (pcountryinfo->len < sizeof(pcountryinfo->countrycode) + pcountryinfo = + (struct ieeetypes_countryinfoset *) pcurrentptr; + + if (pcountryinfo->len < + sizeof(pcountryinfo->countrycode) || pcountryinfo->len > 254) { - lbs_deb_scan("process_bss: 11D- Err " + lbs_pr_debug(1, "InterpretIE: 11D- Err " "CountryInfo len =%d min=%zd max=254\n", pcountryinfo->len, sizeof(pcountryinfo->countrycode)); - ret = -1; - goto done; + LEAVE(); + return -1; } - memcpy(&bss->countryinfo, + memcpy(&pBSSEntry->countryinfo, pcountryinfo, pcountryinfo->len + 2); - lbs_dbg_hex("process_bss: 11D- CountryInfo:", + lbs_dbg_hex("InterpretIE: 11D- CountryInfo:", (u8 *) pcountryinfo, (u32) (pcountryinfo->len + 2)); break; @@ -1137,10 +1114,12 @@ static int libertas_process_bss(struct bss_descriptor * bss, bytestocopy = elemlen; } - pRate = (u8 *) bss->datarates; + pRate = (u8 *) pBSSEntry->datarates; pRate += ratesize; memmove(pRate, (pcurrentptr + 2), bytestocopy); - pRate = (u8 *) bss->libertas_supported_rates; + + pRate = (u8 *) pBSSEntry->libertas_supported_rates; + pRate += ratesize; memmove(pRate, (pcurrentptr + 2), bytestocopy); } @@ -1153,17 +1132,24 @@ static int libertas_process_bss(struct bss_descriptor * bss, if (memcmp(pIe->oui, oui01, sizeof(oui01))) break; - bss->wpa_ie_len = min(elemlen + IE_ID_LEN_FIELDS_BYTES, - MAX_WPA_IE_LEN); - memcpy(bss->wpa_ie, pcurrentptr, bss->wpa_ie_len); - lbs_dbg_hex("process_bss: WPA IE", bss->wpa_ie, elemlen); + pBSSEntry->wpa_ie_len = min_t(size_t, + elemlen + IE_ID_LEN_FIELDS_BYTES, + sizeof(pBSSEntry->wpa_ie)); + memcpy(pBSSEntry->wpa_ie, pcurrentptr, + pBSSEntry->wpa_ie_len); + lbs_dbg_hex("InterpretIE: Resp WPA_IE", + pBSSEntry->wpa_ie, elemlen); break; case WPA2_IE: pIe = (struct IE_WPA *)pcurrentptr; - bss->rsn_ie_len = min(elemlen + IE_ID_LEN_FIELDS_BYTES, - MAX_WPA_IE_LEN); - memcpy(bss->rsn_ie, pcurrentptr, bss->rsn_ie_len); - lbs_dbg_hex("process_bss: RSN_IE", bss->rsn_ie, elemlen); + + pBSSEntry->rsn_ie_len = min_t(size_t, + elemlen + IE_ID_LEN_FIELDS_BYTES, + sizeof(pBSSEntry->rsn_ie)); + memcpy(pBSSEntry->rsn_ie, pcurrentptr, + pBSSEntry->rsn_ie_len); + lbs_dbg_hex("InterpretIE: Resp WPA2_IE", + pBSSEntry->rsn_ie, elemlen); break; case TIM: break; @@ -1179,14 +1165,7 @@ static int libertas_process_bss(struct bss_descriptor * bss, } /* while (bytesleftforcurrentbeacon > 2) */ - /* Timestamp */ - bss->last_scanned = jiffies; - - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); - return ret; + return 0; } /** @@ -1197,12 +1176,15 @@ static int libertas_process_bss(struct bss_descriptor * bss, * * @return 0--ssid is same, otherwise is different */ -int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len) +int libertas_SSID_cmp(struct WLAN_802_11_SSID *ssid1, struct WLAN_802_11_SSID *ssid2) { - if (ssid1_len != ssid2_len) + if (!ssid1 || !ssid2) + return -1; + + if (ssid1->ssidlength != ssid2->ssidlength) return -1; - return memcmp(ssid1, ssid2, ssid1_len); + return memcmp(ssid1->ssid, ssid2->ssid, ssid1->ssidlength); } /** @@ -1214,41 +1196,38 @@ int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len) * * @return index in BSSID list, or error return code (< 0) */ -struct bss_descriptor * libertas_find_bssid_in_list(wlan_adapter * adapter, - u8 * bssid, u8 mode) +int libertas_find_BSSID_in_list(wlan_adapter * adapter, u8 * bssid, u8 mode) { - struct bss_descriptor * iter_bss; - struct bss_descriptor * found_bss = NULL; + int ret = -ENETUNREACH; + int i; if (!bssid) - return NULL; + return -EFAULT; - lbs_dbg_hex("libertas_find_BSSID_in_list: looking for ", - bssid, ETH_ALEN); + lbs_pr_debug(1, "FindBSSID: Num of BSSIDs = %d\n", + adapter->numinscantable); - /* Look through the scan table for a compatible match. The loop will - * continue past a matched bssid that is not compatible in case there - * is an AP with multiple SSIDs assigned to the same BSSID + /* Look through the scan table for a compatible match. The ret return + * variable will be equal to the index in the scan table (greater + * than zero) if the network is compatible. The loop will continue + * past a matched bssid that is not compatible in case there is an + * AP with multiple SSIDs assigned to the same BSSID */ - mutex_lock(&adapter->lock); - list_for_each_entry (iter_bss, &adapter->network_list, list) { - if (compare_ether_addr(iter_bss->bssid, bssid)) - continue; /* bssid doesn't match */ - switch (mode) { - case IW_MODE_INFRA: - case IW_MODE_ADHOC: - if (!is_network_compatible(adapter, iter_bss, mode)) + for (i = 0; ret < 0 && i < adapter->numinscantable; i++) { + if (!memcmp(adapter->scantable[i].macaddress, bssid, ETH_ALEN)) { + switch (mode) { + case IW_MODE_INFRA: + case IW_MODE_ADHOC: + ret = is_network_compatible(adapter, i, mode); break; - found_bss = iter_bss; - break; - default: - found_bss = iter_bss; - break; + default: + ret = i; + break; + } } } - mutex_unlock(&adapter->lock); - return found_bss; + return ret; } /** @@ -1261,60 +1240,61 @@ struct bss_descriptor * libertas_find_bssid_in_list(wlan_adapter * adapter, * * @return index in BSSID list */ -struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter, - u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode, - int channel) +int libertas_find_SSID_in_list(wlan_adapter * adapter, + struct WLAN_802_11_SSID *ssid, u8 * bssid, u8 mode) { + int net = -ENETUNREACH; u8 bestrssi = 0; - struct bss_descriptor * iter_bss = NULL; - struct bss_descriptor * found_bss = NULL; - struct bss_descriptor * tmp_oldest = NULL; - - mutex_lock(&adapter->lock); - - list_for_each_entry (iter_bss, &adapter->network_list, list) { - if ( !tmp_oldest - || (iter_bss->last_scanned < tmp_oldest->last_scanned)) - tmp_oldest = iter_bss; - - if (libertas_ssid_cmp(iter_bss->ssid, iter_bss->ssid_len, - ssid, ssid_len) != 0) - continue; /* ssid doesn't match */ - if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0) - continue; /* bssid doesn't match */ - if ((channel > 0) && (iter_bss->channel != channel)) - continue; /* channel doesn't match */ + int i; + int j; - switch (mode) { - case IW_MODE_INFRA: - case IW_MODE_ADHOC: - if (!is_network_compatible(adapter, iter_bss, mode)) + lbs_pr_debug(1, "Num of Entries in Table = %d\n", adapter->numinscantable); + + for (i = 0; i < adapter->numinscantable; i++) { + if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, ssid) && + (!bssid || + !memcmp(adapter->scantable[i]. + macaddress, bssid, ETH_ALEN))) { + switch (mode) { + case IW_MODE_INFRA: + case IW_MODE_ADHOC: + j = is_network_compatible(adapter, i, mode); + + if (j >= 0) { + if (bssid) { + return i; + } + + if (SCAN_RSSI + (adapter->scantable[i].rssi) + > bestrssi) { + bestrssi = + SCAN_RSSI(adapter-> + scantable[i]. + rssi); + net = i; + } + } else { + if (net == -ENETUNREACH) { + net = j; + } + } + break; + case IW_MODE_AUTO: + default: + if (SCAN_RSSI(adapter->scantable[i].rssi) + > bestrssi) { + bestrssi = + SCAN_RSSI(adapter->scantable[i]. + rssi); + net = i; + } break; - - if (bssid) { - /* Found requested BSSID */ - found_bss = iter_bss; - goto out; - } - - if (SCAN_RSSI(iter_bss->rssi) > bestrssi) { - bestrssi = SCAN_RSSI(iter_bss->rssi); - found_bss = iter_bss; - } - break; - case IW_MODE_AUTO: - default: - if (SCAN_RSSI(iter_bss->rssi) > bestrssi) { - bestrssi = SCAN_RSSI(iter_bss->rssi); - found_bss = iter_bss; } - break; } } -out: - mutex_unlock(&adapter->lock); - return found_bss; + return net; } /** @@ -1327,38 +1307,43 @@ struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter, * * @return index in BSSID list */ -struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter, - u8 mode) +int libertas_find_best_SSID_in_list(wlan_adapter * adapter, u8 mode) { + int bestnet = -ENETUNREACH; u8 bestrssi = 0; - struct bss_descriptor * iter_bss; - struct bss_descriptor * best_bss = NULL; + int i; - mutex_lock(&adapter->lock); + ENTER(); - list_for_each_entry (iter_bss, &adapter->network_list, list) { + lbs_pr_debug(1, "Num of BSSIDs = %d\n", adapter->numinscantable); + + for (i = 0; i < adapter->numinscantable; i++) { switch (mode) { case IW_MODE_INFRA: case IW_MODE_ADHOC: - if (!is_network_compatible(adapter, iter_bss, mode)) - break; - if (SCAN_RSSI(iter_bss->rssi) <= bestrssi) - break; - bestrssi = SCAN_RSSI(iter_bss->rssi); - best_bss = iter_bss; + if (is_network_compatible(adapter, i, mode) >= 0) { + if (SCAN_RSSI(adapter->scantable[i].rssi) > + bestrssi) { + bestrssi = + SCAN_RSSI(adapter->scantable[i]. + rssi); + bestnet = i; + } + } break; case IW_MODE_AUTO: default: - if (SCAN_RSSI(iter_bss->rssi) <= bestrssi) - break; - bestrssi = SCAN_RSSI(iter_bss->rssi); - best_bss = iter_bss; + if (SCAN_RSSI(adapter->scantable[i].rssi) > bestrssi) { + bestrssi = + SCAN_RSSI(adapter->scantable[i].rssi); + bestnet = i; + } break; } } - mutex_unlock(&adapter->lock); - return best_bss; + LEAVE(); + return bestnet; } /** @@ -1369,30 +1354,41 @@ struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter, * * @return 0--success, otherwise--fail */ -int libertas_find_best_network_ssid(wlan_private * priv, - u8 *out_ssid, u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode) +int libertas_find_best_network_SSID(wlan_private * priv, + struct WLAN_802_11_SSID *pSSID, + u8 preferred_mode, u8 *out_mode) { wlan_adapter *adapter = priv->adapter; - int ret = -1; - struct bss_descriptor * found; + int ret = 0; + struct bss_descriptor *preqbssid; + int i; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); - wlan_scan_networks(priv, NULL, 1); + memset(pSSID, 0, sizeof(struct WLAN_802_11_SSID)); + + wlan_scan_networks(priv, NULL); if (adapter->surpriseremoved) return -1; - wait_event_interruptible(adapter->cmd_pending, !adapter->nr_cmd_pending); - found = libertas_find_best_ssid_in_list(adapter, preferred_mode); - if (found && (found->ssid_len > 0)) { - memcpy(out_ssid, &found->ssid, IW_ESSID_MAX_SIZE); - *out_ssid_len = found->ssid_len; - *out_mode = found->mode; - ret = 0; + i = libertas_find_best_SSID_in_list(adapter, preferred_mode); + if (i < 0) { + ret = -1; + goto out; } - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); + preqbssid = &adapter->scantable[i]; + memcpy(pSSID, &preqbssid->ssid, + sizeof(struct WLAN_802_11_SSID)); + *out_mode = preqbssid->mode; + + if (!pSSID->ssidlength) { + ret = -1; + } + +out: + LEAVE(); return ret; } @@ -1411,15 +1407,20 @@ int libertas_set_scan(struct net_device *dev, struct iw_request_info *info, { wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; + union iwreq_data wrqu; - lbs_deb_enter(LBS_DEB_SCAN); + ENTER(); - wlan_scan_networks(priv, NULL, 0); + if (!wlan_scan_networks(priv, NULL)) { + memset(&wrqu, 0, sizeof(union iwreq_data)); + wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu, + NULL); + } if (adapter->surpriseremoved) return -1; - lbs_deb_leave(LBS_DEB_SCAN); + LEAVE(); return 0; } @@ -1432,31 +1433,32 @@ int libertas_set_scan(struct net_device *dev, struct iw_request_info *info, * * @return 0-success, otherwise fail */ -int libertas_send_specific_ssid_scan(wlan_private * priv, - u8 *ssid, u8 ssid_len, u8 clear_ssid) +int libertas_send_specific_SSID_scan(wlan_private * priv, + struct WLAN_802_11_SSID *prequestedssid, + u8 keeppreviousscan) { wlan_adapter *adapter = priv->adapter; struct wlan_ioctl_user_scan_cfg scancfg; - int ret = 0; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); - if (!ssid_len) - goto out; + if (prequestedssid == NULL) { + return -1; + } memset(&scancfg, 0x00, sizeof(scancfg)); - memcpy(scancfg.ssid, ssid, ssid_len); - scancfg.ssid_len = ssid_len; - scancfg.clear_ssid = clear_ssid; - wlan_scan_networks(priv, &scancfg, 1); + memcpy(scancfg.specificSSID, prequestedssid->ssid, + prequestedssid->ssidlength); + scancfg.keeppreviousscan = keeppreviousscan; + + wlan_scan_networks(priv, &scancfg); if (adapter->surpriseremoved) return -1; wait_event_interruptible(adapter->cmd_pending, !adapter->nr_cmd_pending); -out: - lbs_deb_leave(LBS_DEB_ASSOC); - return ret; + LEAVE(); + return 0; } /** @@ -1468,235 +1470,304 @@ int libertas_send_specific_ssid_scan(wlan_private * priv, * * @return 0-success, otherwise fail */ -int libertas_send_specific_bssid_scan(wlan_private * priv, u8 * bssid, u8 clear_bssid) +int libertas_send_specific_BSSID_scan(wlan_private * priv, u8 * bssid, u8 keeppreviousscan) { struct wlan_ioctl_user_scan_cfg scancfg; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); - if (bssid == NULL) - goto out; + if (bssid == NULL) { + return -1; + } memset(&scancfg, 0x00, sizeof(scancfg)); - memcpy(scancfg.bssid, bssid, ETH_ALEN); - scancfg.clear_bssid = clear_bssid; + memcpy(scancfg.specificBSSID, bssid, sizeof(scancfg.specificBSSID)); + scancfg.keeppreviousscan = keeppreviousscan; - wlan_scan_networks(priv, &scancfg, 1); + wlan_scan_networks(priv, &scancfg); if (priv->adapter->surpriseremoved) return -1; wait_event_interruptible(priv->adapter->cmd_pending, !priv->adapter->nr_cmd_pending); -out: - lbs_deb_leave(LBS_DEB_ASSOC); + LEAVE(); return 0; } -static inline char *libertas_translate_scan(wlan_private *priv, - char *start, char *stop, - struct bss_descriptor *bss) +/** + * @brief Retrieve the scan table entries via wireless tools IOCTL call + * + * @param dev A pointer to net_device structure + * @param info A pointer to iw_request_info structure + * @param dwrq A pointer to iw_point structure + * @param extra A pointer to extra data buf + * + * @return 0 --success, otherwise fail + */ +int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, + struct iw_point *dwrq, char *extra) { + wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; + int ret = 0; + char *current_ev = extra; + char *end_buf = extra + IW_SCAN_MAX_DATA; struct chan_freq_power *cfp; + struct bss_descriptor *pscantable; char *current_val; /* For rates */ struct iw_event iwe; /* Temporary buffer */ + int i; int j; + int rate; #define PERFECT_RSSI ((u8)50) #define WORST_RSSI ((u8)0) #define RSSI_DIFF ((u8)(PERFECT_RSSI - WORST_RSSI)) u8 rssi; - cfp = libertas_find_cfp_by_band_and_channel(adapter, 0, bss->channel); - if (!cfp) { - lbs_deb_scan("Invalid channel number %d\n", bss->channel); - return NULL; - } + u8 buf[16 + 256 * 2]; + u8 *ptr; - /* First entry *MUST* be the AP BSSID */ - iwe.cmd = SIOCGIWAP; - iwe.u.ap_addr.sa_family = ARPHRD_ETHER; - memcpy(iwe.u.ap_addr.sa_data, &bss->bssid, ETH_ALEN); - start = iwe_stream_add_event(start, stop, &iwe, IW_EV_ADDR_LEN); - - /* SSID */ - iwe.cmd = SIOCGIWESSID; - iwe.u.data.flags = 1; - iwe.u.data.length = min((u32) bss->ssid_len, (u32) IW_ESSID_MAX_SIZE); - start = iwe_stream_add_point(start, stop, &iwe, bss->ssid); - - /* Mode */ - iwe.cmd = SIOCGIWMODE; - iwe.u.mode = bss->mode; - start = iwe_stream_add_event(start, stop, &iwe, IW_EV_UINT_LEN); - - /* Frequency */ - iwe.cmd = SIOCGIWFREQ; - iwe.u.freq.m = (long)cfp->freq * 100000; - iwe.u.freq.e = 1; - start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN); - - /* Add quality statistics */ - iwe.cmd = IWEVQUAL; - iwe.u.qual.updated = IW_QUAL_ALL_UPDATED; - iwe.u.qual.level = SCAN_RSSI(bss->rssi); - - rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE; - iwe.u.qual.qual = - (100 * RSSI_DIFF * RSSI_DIFF - (PERFECT_RSSI - rssi) * - (15 * (RSSI_DIFF) + 62 * (PERFECT_RSSI - rssi))) / - (RSSI_DIFF * RSSI_DIFF); - if (iwe.u.qual.qual > 100) - iwe.u.qual.qual = 100; - - if (adapter->NF[TYPE_BEACON][TYPE_NOAVG] == 0) { - iwe.u.qual.noise = MRVDRV_NF_DEFAULT_SCAN_VALUE; - } else { - iwe.u.qual.noise = - CAL_NF(adapter->NF[TYPE_BEACON][TYPE_NOAVG]); - } + ENTER(); - /* Locally created ad-hoc BSSs won't have beacons if this is the - * only station in the adhoc network; so get signal strength - * from receive statistics. + /* + * if there's either commands in the queue or one being + * processed return -EAGAIN for iwlist to retry later. */ - if ((adapter->mode == IW_MODE_ADHOC) - && adapter->adhoccreate - && !libertas_ssid_cmp(adapter->curbssparams.ssid, - adapter->curbssparams.ssid_len, - bss->ssid, bss->ssid_len)) { - int snr, nf; - snr = adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE; - nf = adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE; - iwe.u.qual.level = CAL_RSSI(snr, nf); - } - start = iwe_stream_add_event(start, stop, &iwe, IW_EV_QUAL_LEN); + if (adapter->nr_cmd_pending) + return -EAGAIN; - /* Add encryption capability */ - iwe.cmd = SIOCGIWENCODE; - if (bss->privacy) { - iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; - } else { - iwe.u.data.flags = IW_ENCODE_DISABLED; - } - iwe.u.data.length = 0; - start = iwe_stream_add_point(start, stop, &iwe, bss->ssid); + if (adapter->connect_status == libertas_connected) + lbs_pr_debug(1, "Current ssid: %32s\n", + adapter->curbssparams.ssid.ssid); - current_val = start + IW_EV_LCP_LEN; + lbs_pr_debug(1, "Scan: Get: numinscantable = %d\n", + adapter->numinscantable); - iwe.cmd = SIOCGIWRATE; - iwe.u.bitrate.fixed = 0; - iwe.u.bitrate.disabled = 0; - iwe.u.bitrate.value = 0; + /* The old API using SIOCGIWAPLIST had a hard limit of IW_MAX_AP. + * The new API using SIOCGIWSCAN is only limited by buffer size + * WE-14 -> WE-16 the buffer is limited to IW_SCAN_MAX_DATA bytes + * which is 4096. + */ + for (i = 0; i < adapter->numinscantable; i++) { + if ((current_ev + MAX_SCAN_CELL_SIZE) >= end_buf) { + lbs_pr_debug(1, "i=%d break out: current_ev=%p end_buf=%p " + "MAX_SCAN_CELL_SIZE=%zd\n", + i, current_ev, end_buf, MAX_SCAN_CELL_SIZE); + break; + } - for (j = 0; j < sizeof(bss->libertas_supported_rates); j++) { - u8 rate = bss->libertas_supported_rates[j]; - if (rate == 0) - break; /* no more rates */ - /* Bit rate given in 500 kb/s units (+ 0x80) */ - iwe.u.bitrate.value = (rate & 0x7f) * 500000; - current_val = iwe_stream_add_value(start, current_val, - stop, &iwe, IW_EV_PARAM_LEN); - } - if ((bss->mode == IW_MODE_ADHOC) - && !libertas_ssid_cmp(adapter->curbssparams.ssid, - adapter->curbssparams.ssid_len, - bss->ssid, bss->ssid_len) - && adapter->adhoccreate) { - iwe.u.bitrate.value = 22 * 500000; - current_val = iwe_stream_add_value(start, current_val, - stop, &iwe, IW_EV_PARAM_LEN); - } - /* Check if we added any event */ - if((current_val - start) > IW_EV_LCP_LEN) - start = current_val; - - memset(&iwe, 0, sizeof(iwe)); - if (bss->wpa_ie_len) { - char buf[MAX_WPA_IE_LEN]; - memcpy(buf, bss->wpa_ie, bss->wpa_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss->wpa_ie_len; - start = iwe_stream_add_point(start, stop, &iwe, buf); - } + pscantable = &adapter->scantable[i]; - memset(&iwe, 0, sizeof(iwe)); - if (bss->rsn_ie_len) { - char buf[MAX_WPA_IE_LEN]; - memcpy(buf, bss->rsn_ie, bss->rsn_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss->rsn_ie_len; - start = iwe_stream_add_point(start, stop, &iwe, buf); - } + lbs_pr_debug(1, "i=%d ssid: %32s\n", i, pscantable->ssid.ssid); - return start; -} + cfp = + libertas_find_cfp_by_band_and_channel(adapter, 0, + pscantable->channel); + if (!cfp) { + lbs_pr_debug(1, "Invalid channel number %d\n", + pscantable->channel); + continue; + } -/** - * @brief Retrieve the scan table entries via wireless tools IOCTL call - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param dwrq A pointer to iw_point structure - * @param extra A pointer to extra data buf - * - * @return 0 --success, otherwise fail - */ -int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ -#define SCAN_ITEM_SIZE 128 - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; - int err = 0; - char *ev = extra; - char *stop = ev + dwrq->length; - struct bss_descriptor * iter_bss; - struct bss_descriptor * safe; - - lbs_deb_enter(LBS_DEB_ASSOC); - - /* If we've got an uncompleted scan, schedule the next part */ - if (!adapter->nr_cmd_pending && adapter->last_scanned_channel) - wlan_scan_networks(priv, NULL, 0); - - /* Update RSSI if current BSS is a locally created ad-hoc BSS */ - if ((adapter->mode == IW_MODE_ADHOC) && adapter->adhoccreate) { - libertas_prepare_and_send_command(priv, cmd_802_11_rssi, 0, - cmd_option_waitforrsp, 0, NULL); - } + if (!ssid_valid(&adapter->scantable[i].ssid)) { + continue; + } - mutex_lock(&adapter->lock); - list_for_each_entry_safe (iter_bss, safe, &adapter->network_list, list) { - char * next_ev; - unsigned long stale_time; + /* First entry *MUST* be the AP MAC address */ + iwe.cmd = SIOCGIWAP; + iwe.u.ap_addr.sa_family = ARPHRD_ETHER; + memcpy(iwe.u.ap_addr.sa_data, + &adapter->scantable[i].macaddress, ETH_ALEN); - if (stop - ev < SCAN_ITEM_SIZE) { - err = -E2BIG; - break; + iwe.len = IW_EV_ADDR_LEN; + current_ev = + iwe_stream_add_event(current_ev, end_buf, &iwe, iwe.len); + + //Add the ESSID + iwe.u.data.length = adapter->scantable[i].ssid.ssidlength; + + if (iwe.u.data.length > 32) { + iwe.u.data.length = 32; } - /* Prune old an old scan result */ - stale_time = iter_bss->last_scanned + DEFAULT_MAX_SCAN_AGE; - if (time_after(jiffies, stale_time)) { - list_move_tail (&iter_bss->list, - &adapter->network_free_list); - clear_bss_descriptor(iter_bss); - continue; + iwe.cmd = SIOCGIWESSID; + iwe.u.data.flags = 1; + iwe.len = IW_EV_POINT_LEN + iwe.u.data.length; + current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, + adapter->scantable[i].ssid. + ssid); + + //Add mode + iwe.cmd = SIOCGIWMODE; + iwe.u.mode = adapter->scantable[i].mode; + iwe.len = IW_EV_UINT_LEN; + current_ev = + iwe_stream_add_event(current_ev, end_buf, &iwe, iwe.len); + + //frequency + iwe.cmd = SIOCGIWFREQ; + iwe.u.freq.m = (long)cfp->freq * 100000; + iwe.u.freq.e = 1; + iwe.len = IW_EV_FREQ_LEN; + current_ev = + iwe_stream_add_event(current_ev, end_buf, &iwe, iwe.len); + + /* Add quality statistics */ + iwe.cmd = IWEVQUAL; + iwe.u.qual.updated = IW_QUAL_ALL_UPDATED; + iwe.u.qual.level = SCAN_RSSI(adapter->scantable[i].rssi); + + rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE; + iwe.u.qual.qual = + (100 * RSSI_DIFF * RSSI_DIFF - (PERFECT_RSSI - rssi) * + (15 * (RSSI_DIFF) + 62 * (PERFECT_RSSI - rssi))) / + (RSSI_DIFF * RSSI_DIFF); + if (iwe.u.qual.qual > 100) + iwe.u.qual.qual = 100; + else if (iwe.u.qual.qual < 1) + iwe.u.qual.qual = 0; + + if (adapter->NF[TYPE_BEACON][TYPE_NOAVG] == 0) { + iwe.u.qual.noise = MRVDRV_NF_DEFAULT_SCAN_VALUE; + } else { + iwe.u.qual.noise = + CAL_NF(adapter->NF[TYPE_BEACON][TYPE_NOAVG]); + } + if ((adapter->mode == IW_MODE_ADHOC) && + !libertas_SSID_cmp(&adapter->curbssparams.ssid, + &adapter->scantable[i].ssid) + && adapter->adhoccreate) { + ret = libertas_prepare_and_send_command(priv, + cmd_802_11_rssi, + 0, + cmd_option_waitforrsp, + 0, NULL); + + if (!ret) { + iwe.u.qual.level = + CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_AVG] / + AVG_SCALE, + adapter->NF[TYPE_RXPD][TYPE_AVG] / + AVG_SCALE); + } + } + iwe.len = IW_EV_QUAL_LEN; + current_ev = + iwe_stream_add_event(current_ev, end_buf, &iwe, iwe.len); + + /* Add encryption capability */ + iwe.cmd = SIOCGIWENCODE; + if (adapter->scantable[i].privacy) { + iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; + } else { + iwe.u.data.flags = IW_ENCODE_DISABLED; } + iwe.u.data.length = 0; + iwe.len = IW_EV_POINT_LEN + iwe.u.data.length; + current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, + adapter->scantable->ssid. + ssid); - /* Translate to WE format this entry */ - next_ev = libertas_translate_scan(priv, ev, stop, iter_bss); - if (next_ev == NULL) - continue; - ev = next_ev; + current_val = current_ev + IW_EV_LCP_LEN; + + iwe.cmd = SIOCGIWRATE; + + iwe.u.bitrate.fixed = 0; + iwe.u.bitrate.disabled = 0; + iwe.u.bitrate.value = 0; + + /* Bit rate given in 500 kb/s units (+ 0x80) */ + for (j = 0; j < sizeof(adapter->scantable[i].libertas_supported_rates); + j++) { + if (adapter->scantable[i].libertas_supported_rates[j] == 0) { + break; + } + rate = + (adapter->scantable[i].libertas_supported_rates[j] & 0x7F) * + 500000; + if (rate > iwe.u.bitrate.value) { + iwe.u.bitrate.value = rate; + } + + iwe.u.bitrate.value = + (adapter->scantable[i].libertas_supported_rates[j] + & 0x7f) * 500000; + iwe.len = IW_EV_PARAM_LEN; + current_ev = + iwe_stream_add_value(current_ev, current_val, + end_buf, &iwe, iwe.len); + + } + if ((adapter->scantable[i].mode == IW_MODE_ADHOC) + && !libertas_SSID_cmp(&adapter->curbssparams.ssid, + &adapter->scantable[i].ssid) + && adapter->adhoccreate) { + iwe.u.bitrate.value = 22 * 500000; + } + iwe.len = IW_EV_PARAM_LEN; + current_ev = + iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, + iwe.len); + + /* Add new value to event */ + current_val = current_ev + IW_EV_LCP_LEN; + + if (adapter->scantable[i].rsn_ie[0] == WPA2_IE) { + memset(&iwe, 0, sizeof(iwe)); + memset(buf, 0, sizeof(buf)); + memcpy(buf, adapter->scantable[i].rsn_ie, + adapter->scantable[i].rsn_ie_len); + iwe.cmd = IWEVGENIE; + iwe.u.data.length = adapter->scantable[i].rsn_ie_len; + iwe.len = IW_EV_POINT_LEN + iwe.u.data.length; + current_ev = iwe_stream_add_point(current_ev, end_buf, + &iwe, buf); + } + if (adapter->scantable[i].wpa_ie[0] == WPA_IE) { + memset(&iwe, 0, sizeof(iwe)); + memset(buf, 0, sizeof(buf)); + memcpy(buf, adapter->scantable[i].wpa_ie, + adapter->scantable[i].wpa_ie_len); + iwe.cmd = IWEVGENIE; + iwe.u.data.length = adapter->scantable[i].wpa_ie_len; + iwe.len = IW_EV_POINT_LEN + iwe.u.data.length; + current_ev = iwe_stream_add_point(current_ev, end_buf, + &iwe, buf); + } + + + if (adapter->scantable[i].extra_ie != 0) { + memset(&iwe, 0, sizeof(iwe)); + memset(buf, 0, sizeof(buf)); + ptr = buf; + ptr += sprintf(ptr, "extra_ie"); + iwe.u.data.length = strlen(buf); + + lbs_pr_debug(1, "iwe.u.data.length %d\n", + iwe.u.data.length); + lbs_pr_debug(1, "BUF: %s \n", buf); + + iwe.cmd = IWEVCUSTOM; + iwe.len = IW_EV_POINT_LEN + iwe.u.data.length; + current_ev = + iwe_stream_add_point(current_ev, end_buf, &iwe, + buf); + } + + current_val = current_ev + IW_EV_LCP_LEN; + + /* + * Check if we added any event + */ + if ((current_val - current_ev) > IW_EV_LCP_LEN) + current_ev = current_val; } - mutex_unlock(&adapter->lock); - dwrq->length = (ev - extra); + dwrq->length = (current_ev - extra); dwrq->flags = 0; - lbs_deb_leave(LBS_DEB_ASSOC); - return err; + LEAVE(); + return 0; } /** @@ -1725,13 +1796,13 @@ int libertas_cmd_80211_scan(wlan_private * priv, struct cmd_ds_802_11_scan *pscan = &cmd->params.scan; struct wlan_scan_cmd_config *pscancfg; - lbs_deb_enter(LBS_DEB_ASSOC); + ENTER(); pscancfg = pdata_buf; /* Set fixed field variables in scan command */ pscan->bsstype = pscancfg->bsstype; - memcpy(pscan->BSSID, pscancfg->bssid, sizeof(pscan->BSSID)); + memcpy(pscan->BSSID, pscancfg->specificBSSID, sizeof(pscan->BSSID)); memcpy(pscan->tlvbuffer, pscancfg->tlvbuffer, pscancfg->tlvbufferlen); cmd->command = cpu_to_le16(cmd_802_11_scan); @@ -1741,26 +1812,12 @@ int libertas_cmd_80211_scan(wlan_private * priv, + sizeof(pscan->BSSID) + pscancfg->tlvbufferlen + S_DS_GEN); - lbs_deb_scan("SCAN_CMD: command=%x, size=%x, seqnum=%x\n", - le16_to_cpu(cmd->command), le16_to_cpu(cmd->size), - le16_to_cpu(cmd->seqnum)); - - lbs_deb_leave(LBS_DEB_ASSOC); + lbs_pr_debug(1, "SCAN_CMD: command=%x, size=%x, seqnum=%x\n", + cmd->command, cmd->size, cmd->seqnum); + LEAVE(); return 0; } -static inline int is_same_network(struct bss_descriptor *src, - struct bss_descriptor *dst) -{ - /* A network is only a duplicate if the channel, BSSID, and ESSID - * all match. We treat all with the same BSSID and channel - * as one network */ - return ((src->ssid_len == dst->ssid_len) && - (src->channel == dst->channel) && - !compare_ether_addr(src->bssid, dst->bssid) && - !memcmp(src->ssid, dst->ssid, src->ssid_len)); -} - /** * @brief This function handles the command response of scan * @@ -1789,45 +1846,38 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp) { wlan_adapter *adapter = priv->adapter; struct cmd_ds_802_11_scan_rsp *pscan; + struct bss_descriptor newbssentry; struct mrvlietypes_data *ptlv; struct mrvlietypes_tsftimestamp *ptsftlv; - struct bss_descriptor * iter_bss; - struct bss_descriptor * safe; u8 *pbssinfo; u16 scanrespsize; int bytesleft; + int numintable; + int bssIdx; int idx; int tlvbufsize; - int ret; + u64 tsfval; - lbs_deb_enter(LBS_DEB_ASSOC); - - /* Prune old entries from scan table */ - list_for_each_entry_safe (iter_bss, safe, &adapter->network_list, list) { - unsigned long stale_time = iter_bss->last_scanned + DEFAULT_MAX_SCAN_AGE; - if (time_before(jiffies, stale_time)) - continue; - list_move_tail (&iter_bss->list, &adapter->network_free_list); - clear_bss_descriptor(iter_bss); - } + ENTER(); pscan = &resp->params.scanresp; - if (pscan->nr_sets > MAX_NETWORK_COUNT) { - lbs_deb_scan( - "SCAN_RESP: too many scan results (%d, max %d)!!\n", - pscan->nr_sets, MAX_NETWORK_COUNT); - ret = -1; - goto done; + if (pscan->nr_sets > MRVDRV_MAX_BSSID_LIST) { + lbs_pr_debug(1, + "SCAN_RESP: Invalid number of AP returned (%d)!!\n", + pscan->nr_sets); + LEAVE(); + return -1; } bytesleft = le16_to_cpu(pscan->bssdescriptsize); - lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft); + lbs_pr_debug(1, "SCAN_RESP: bssdescriptsize %d\n", bytesleft); scanrespsize = le16_to_cpu(resp->size); - lbs_deb_scan("SCAN_RESP: returned %d AP before parsing\n", + lbs_pr_debug(1, "SCAN_RESP: returned %d AP before parsing\n", pscan->nr_sets); + numintable = adapter->numinscantable; pbssinfo = pscan->bssdesc_and_tlvbuffer; /* The size of the TLV buffer is equal to the entire command response @@ -1851,68 +1901,105 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp) * or as an addition at the end of the table */ for (idx = 0; idx < pscan->nr_sets && bytesleft; idx++) { - struct bss_descriptor new; - struct bss_descriptor * found = NULL; - struct bss_descriptor * oldest = NULL; + /* Zero out the newbssentry we are about to store info in */ + memset(&newbssentry, 0x00, sizeof(newbssentry)); /* Process the data fields and IEs returned for this BSS */ - memset(&new, 0, sizeof (struct bss_descriptor)); - if (libertas_process_bss(&new, &pbssinfo, &bytesleft) != 0) { - /* error parsing the scan response, skipped */ - lbs_deb_scan("SCAN_RESP: process_bss returned ERROR\n"); - continue; - } + if ((InterpretBSSDescriptionWithIE(&newbssentry, + &pbssinfo, + &bytesleft) == + 0) + && CHECK_SSID_IS_VALID(&newbssentry.ssid)) { + + lbs_pr_debug(1, + "SCAN_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n", + newbssentry.macaddress[0], + newbssentry.macaddress[1], + newbssentry.macaddress[2], + newbssentry.macaddress[3], + newbssentry.macaddress[4], + newbssentry.macaddress[5]); - /* Try to find this bss in the scan table */ - list_for_each_entry (iter_bss, &adapter->network_list, list) { - if (is_same_network(iter_bss, &new)) { - found = iter_bss; - break; + /* + * Search the scan table for the same bssid + */ + for (bssIdx = 0; bssIdx < numintable; bssIdx++) { + if (memcmp(newbssentry.macaddress, + adapter->scantable[bssIdx]. + macaddress, + sizeof(newbssentry.macaddress)) == + 0) { + /* + * If the SSID matches as well, it is a duplicate of + * this entry. Keep the bssIdx set to this + * entry so we replace the old contents in the table + */ + if ((newbssentry.ssid.ssidlength == + adapter->scantable[bssIdx].ssid. + ssidlength) + && + (memcmp + (newbssentry.ssid.ssid, + adapter->scantable[bssIdx].ssid. + ssid, + newbssentry.ssid.ssidlength) == + 0)) { + lbs_pr_debug(1, + "SCAN_RESP: Duplicate of index: %d\n", + bssIdx); + break; + } + } + } + /* + * If the bssIdx is equal to the number of entries in the table, + * the new entry was not a duplicate; append it to the scan + * table + */ + if (bssIdx == numintable) { + /* Range check the bssIdx, keep it limited to the last entry */ + if (bssIdx == MRVDRV_MAX_BSSID_LIST) { + bssIdx--; + } else { + numintable++; + } } - if ((oldest == NULL) || - (iter_bss->last_scanned < oldest->last_scanned)) - oldest = iter_bss; - } + /* + * If the TSF TLV was appended to the scan results, save the + * this entries TSF value in the networktsf field. The + * networktsf is the firmware's TSF value at the time the + * beacon or probe response was received. + */ + if (ptsftlv) { + memcpy(&tsfval, &ptsftlv->tsftable[idx], + sizeof(tsfval)); + tsfval = le64_to_cpu(tsfval); - if (found) { - /* found, clear it */ - clear_bss_descriptor(found); - } else if (!list_empty(&adapter->network_free_list)) { - /* Pull one from the free list */ - found = list_entry(adapter->network_free_list.next, - struct bss_descriptor, list); - list_move_tail(&found->list, &adapter->network_list); - } else if (oldest) { - /* If there are no more slots, expire the oldest */ - found = oldest; - clear_bss_descriptor(found); - list_move_tail(&found->list, &adapter->network_list); - } else { - continue; - } + memcpy(&newbssentry.networktsf, + &tsfval, sizeof(newbssentry.networktsf)); + } - lbs_deb_scan("SCAN_RESP: BSSID = " MAC_FMT "\n", - new.bssid[0], new.bssid[1], new.bssid[2], - new.bssid[3], new.bssid[4], new.bssid[5]); + /* Copy the locally created newbssentry to the scan table */ + memcpy(&adapter->scantable[bssIdx], + &newbssentry, + sizeof(adapter->scantable[bssIdx])); - /* - * If the TSF TLV was appended to the scan results, save the - * this entries TSF value in the networktsf field. The - * networktsf is the firmware's TSF value at the time the - * beacon or probe response was received. - */ - if (ptsftlv) { - new.networktsf = le64_to_cpup(&ptsftlv->tsftable[idx]); - } + } else { - /* Copy the locally created newbssentry to the scan table */ - memcpy(found, &new, offsetof(struct bss_descriptor, list)); + /* error parsing/interpreting the scan response, skipped */ + lbs_pr_debug(1, "SCAN_RESP: " + "InterpretBSSDescriptionWithIE returned ERROR\n"); + } } - ret = 0; + lbs_pr_debug(1, "SCAN_RESP: Scanned %2d APs, %d valid, %d total\n", + pscan->nr_sets, numintable - adapter->numinscantable, + numintable); -done: - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); - return ret; + /* Update the total number of BSSIDs in the scan table */ + adapter->numinscantable = numintable; + + LEAVE(); + return 0; } diff --git a/trunk/drivers/net/wireless/libertas/scan.h b/trunk/drivers/net/wireless/libertas/scan.h index bd019e5ff1eb..405f4f0fe575 100644 --- a/trunk/drivers/net/wireless/libertas/scan.h +++ b/trunk/drivers/net/wireless/libertas/scan.h @@ -51,7 +51,7 @@ struct wlan_scan_cmd_config { /** * @brief Specific BSSID used to filter scan results in the firmware */ - u8 bssid[ETH_ALEN]; + u8 specificBSSID[ETH_ALEN]; /** * @brief length of TLVs sent in command starting at tlvBuffer @@ -91,6 +91,15 @@ struct wlan_ioctl_user_scan_chan { * @sa libertas_set_user_scan_ioctl */ struct wlan_ioctl_user_scan_cfg { + + /** + * @brief Flag set to keep the previous scan table intact + * + * If set, the scan results will accumulate, replacing any previous + * matched entries for a BSS with the new scan data + */ + u8 keeppreviousscan; //!< Do not erase the existing scan results + /** * @brief BSS type to be sent in the firmware command * @@ -108,22 +117,15 @@ struct wlan_ioctl_user_scan_cfg { */ u8 numprobes; - /** - * @brief BSSID filter sent in the firmware command to limit the results - */ - u8 bssid[ETH_ALEN]; - - /* Clear existing scan results matching this BSSID */ - u8 clear_bssid; - - /** - * @brief SSID filter sent in the firmware command to limit the results - */ - char ssid[IW_ESSID_MAX_SIZE]; - u8 ssid_len; + /** + * @brief BSSID filter sent in the firmware command to limit the results + */ + u8 specificBSSID[ETH_ALEN]; - /* Clear existing scan results matching this SSID */ - u8 clear_ssid; + /** + * @brief SSID filter sent in the firmware command to limit the results + */ + char specificSSID[IW_ESSID_MAX_SIZE + 1]; /** * @brief Variable number (fixed maximum) of channels to scan up @@ -135,10 +137,9 @@ struct wlan_ioctl_user_scan_cfg { * @brief Structure used to store information for each beacon/probe response */ struct bss_descriptor { - u8 bssid[ETH_ALEN]; + u8 macaddress[ETH_ALEN]; - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len; + struct WLAN_802_11_SSID ssid; /* WEP encryption requirement */ u32 privacy; @@ -155,15 +156,15 @@ struct bss_descriptor { u8 mode; u8 libertas_supported_rates[WLAN_SUPPORTED_RATES]; - __le64 timestamp; //!< TSF value included in the beacon/probe response - unsigned long last_scanned; + int extra_ie; + u8 timestamp[8]; //!< TSF value included in the beacon/probe response union ieeetypes_phyparamset phyparamset; union IEEEtypes_ssparamset ssparamset; struct ieeetypes_capinfo cap; u8 datarates[WLAN_SUPPORTED_RATES]; - u64 networktsf; //!< TSF timestamp from the current firmware TSF + __le64 networktsf; //!< TSF timestamp from the current firmware TSF struct ieeetypes_countryinfofullset countryinfo; @@ -171,29 +172,24 @@ struct bss_descriptor { size_t wpa_ie_len; u8 rsn_ie[MAX_WPA_IE_LEN]; size_t rsn_ie_len; - - struct list_head list; }; -extern int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len); - -struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter, - u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode, - int channel); - -struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter, - u8 mode); - -extern struct bss_descriptor * libertas_find_bssid_in_list(wlan_adapter * adapter, - u8 * bssid, u8 mode); +extern int libertas_SSID_cmp(struct WLAN_802_11_SSID *ssid1, + struct WLAN_802_11_SSID *ssid2); +extern int libertas_find_SSID_in_list(wlan_adapter * adapter, struct WLAN_802_11_SSID *ssid, + u8 * bssid, u8 mode); +int libertas_find_best_SSID_in_list(wlan_adapter * adapter, u8 mode); +extern int libertas_find_BSSID_in_list(wlan_adapter * adapter, u8 * bssid, u8 mode); -int libertas_find_best_network_ssid(wlan_private * priv, u8 *out_ssid, - u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode); +int libertas_find_best_network_SSID(wlan_private * priv, + struct WLAN_802_11_SSID *pSSID, + u8 preferred_mode, u8 *out_mode); -extern int libertas_send_specific_ssid_scan(wlan_private * priv, u8 *ssid, - u8 ssid_len, u8 clear_ssid); -extern int libertas_send_specific_bssid_scan(wlan_private * priv, - u8 * bssid, u8 clear_bssid); +extern int libertas_send_specific_SSID_scan(wlan_private * priv, + struct WLAN_802_11_SSID *prequestedssid, + u8 keeppreviousscan); +extern int libertas_send_specific_BSSID_scan(wlan_private * priv, + u8 * bssid, u8 keeppreviousscan); extern int libertas_cmd_80211_scan(wlan_private * priv, struct cmd_ds_command *cmd, @@ -203,8 +199,7 @@ extern int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp); int wlan_scan_networks(wlan_private * priv, - const struct wlan_ioctl_user_scan_cfg * puserscanin, - int full_scan); + const struct wlan_ioctl_user_scan_cfg * puserscanin); struct ifreq; diff --git a/trunk/drivers/net/wireless/libertas/thread.h b/trunk/drivers/net/wireless/libertas/thread.h index b1f34d92ff3e..207b8a6cc33d 100644 --- a/trunk/drivers/net/wireless/libertas/thread.h +++ b/trunk/drivers/net/wireless/libertas/thread.h @@ -21,11 +21,11 @@ static inline void wlan_activate_thread(struct wlan_thread * thr) static inline void wlan_deactivate_thread(struct wlan_thread * thr) { - lbs_deb_enter(LBS_DEB_THREAD); + ENTER(); thr->pid = 0; - lbs_deb_leave(LBS_DEB_THREAD); + LEAVE(); } static inline void wlan_create_thread(int (*wlanfunc) (void *), @@ -36,7 +36,7 @@ static inline void wlan_create_thread(int (*wlanfunc) (void *), static inline int wlan_terminate_thread(struct wlan_thread * thr) { - lbs_deb_enter(LBS_DEB_THREAD); + ENTER(); /* Check if the thread is active or not */ if (!thr->pid) { @@ -45,7 +45,7 @@ static inline int wlan_terminate_thread(struct wlan_thread * thr) } kthread_stop(thr->task); - lbs_deb_leave(LBS_DEB_THREAD); + LEAVE(); return 0; } diff --git a/trunk/drivers/net/wireless/libertas/tx.c b/trunk/drivers/net/wireless/libertas/tx.c index 17c437635a00..d4b13478c9a7 100644 --- a/trunk/drivers/net/wireless/libertas/tx.c +++ b/trunk/drivers/net/wireless/libertas/tx.c @@ -5,6 +5,7 @@ #include "hostcmd.h" #include "radiotap.h" +#include "sbi.h" #include "decl.h" #include "defs.h" #include "dev.h" @@ -67,7 +68,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) u32 new_rate; u8 *ptr = priv->adapter->tmptxbuf; - lbs_deb_enter(LBS_DEB_TX); + ENTER(); if (priv->adapter->surpriseremoved) return -1; @@ -77,7 +78,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) min_t(unsigned int, skb->len, 100)); if (!skb->len || (skb->len > MRVDRV_ETH_TX_PACKET_BUFFER_SIZE)) { - lbs_deb_tx("tx err: skb length %d 0 or > %zd\n", + lbs_pr_debug(1, "Tx error: Bad skb length %d : %zd\n", skb->len, MRVDRV_ETH_TX_PACKET_BUFFER_SIZE); ret = -1; goto done; @@ -85,13 +86,13 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) memset(plocaltxpd, 0, sizeof(struct txpd)); - plocaltxpd->tx_packet_length = cpu_to_le16(skb->len); + plocaltxpd->tx_packet_length = skb->len; /* offset of actual data */ - plocaltxpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd)); + plocaltxpd->tx_packet_location = sizeof(struct txpd); /* TxCtrl set by user or default */ - plocaltxpd->tx_control = cpu_to_le32(adapter->pkttxctrl); + plocaltxpd->tx_control = adapter->pkttxctrl; p802x_hdr = skb->data; if (priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP) { @@ -102,16 +103,15 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) /* set txpd fields from the radiotap header */ new_rate = convert_radiotap_rate_to_mv(pradiotap_hdr->rate); if (new_rate != 0) { - /* use new tx_control[4:0] */ - new_rate |= (adapter->pkttxctrl & ~0x1f); - plocaltxpd->tx_control = cpu_to_le32(new_rate); + /* erase tx_control[4:0] */ + plocaltxpd->tx_control &= ~0x1f; + /* write new tx_control[4:0] */ + plocaltxpd->tx_control |= new_rate; } /* skip the radiotap header */ p802x_hdr += sizeof(struct tx_radiotap_hdr); - plocaltxpd->tx_packet_length = - cpu_to_le16(le16_to_cpu(plocaltxpd->tx_packet_length) - - sizeof(struct tx_radiotap_hdr)); + plocaltxpd->tx_packet_length -= sizeof(struct tx_radiotap_hdr); } /* copy destination address from 802.3 or 802.11 header */ @@ -123,28 +123,28 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) lbs_dbg_hex("txpd", (u8 *) plocaltxpd, sizeof(struct txpd)); if (IS_MESH_FRAME(skb)) { - plocaltxpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME); + plocaltxpd->tx_control |= TxPD_MESH_FRAME; } memcpy(ptr, plocaltxpd, sizeof(struct txpd)); ptr += sizeof(struct txpd); - lbs_dbg_hex("Tx Data", (u8 *) p802x_hdr, le16_to_cpu(plocaltxpd->tx_packet_length)); - memcpy(ptr, p802x_hdr, le16_to_cpu(plocaltxpd->tx_packet_length)); - ret = priv->hw_host_to_card(priv, MVMS_DAT, - priv->adapter->tmptxbuf, - le16_to_cpu(plocaltxpd->tx_packet_length) + - sizeof(struct txpd)); + lbs_dbg_hex("Tx Data", (u8 *) p802x_hdr, plocaltxpd->tx_packet_length); + memcpy(ptr, p802x_hdr, plocaltxpd->tx_packet_length); + ret = libertas_sbi_host_to_card(priv, MVMS_DAT, + priv->adapter->tmptxbuf, + plocaltxpd->tx_packet_length + + sizeof(struct txpd)); if (ret) { - lbs_deb_tx("tx err: hw_host_to_card returned 0x%X\n", ret); + lbs_pr_debug(1, "Tx error: libertas_sbi_host_to_card failed: 0x%X\n", ret); goto done; } - lbs_deb_tx("SendSinglePacket succeeds\n"); + lbs_pr_debug(1, "SendSinglePacket succeeds\n"); -done: + done: if (!ret) { priv->stats.tx_packets++; priv->stats.tx_bytes += skb->len; @@ -158,8 +158,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) received from FW */ skb_orphan(skb); /* stop processing outgoing pkts */ - netif_stop_queue(priv->dev); - netif_stop_queue(priv->mesh_dev); + netif_stop_queue(priv->wlan_dev.netdev); /* freeze any packets already in our queues */ priv->adapter->TxLockFlag = 1; } else { @@ -167,7 +166,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) priv->adapter->currenttxskb = NULL; } - lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret); + LEAVE(); return ret; } @@ -196,13 +195,10 @@ static void wlan_tx_queue(wlan_private *priv, struct sk_buff *skb) WARN_ON(priv->adapter->tx_queue_idx >= NR_TX_QUEUE); adapter->tx_queue_ps[adapter->tx_queue_idx++] = skb; - if (adapter->tx_queue_idx == NR_TX_QUEUE) { - netif_stop_queue(priv->dev); - netif_stop_queue(priv->mesh_dev); - } else { - netif_start_queue(priv->dev); - netif_start_queue(priv->mesh_dev); - } + if (adapter->tx_queue_idx == NR_TX_QUEUE) + netif_stop_queue(priv->wlan_dev.netdev); + else + netif_start_queue(priv->wlan_dev.netdev); spin_unlock(&adapter->txqueue_lock); } @@ -218,12 +214,13 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb) { int ret = -1; - lbs_deb_enter(LBS_DEB_TX); + ENTER(); + lbs_dbg_hex("TX Data", skb->data, min_t(unsigned int, skb->len, 100)); - if (priv->dnld_sent) { + if (priv->wlan_dev.dnld_sent) { lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n", - priv->dnld_sent); + priv->wlan_dev.dnld_sent); goto done; } @@ -237,7 +234,7 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb) ret = SendSinglePacket(priv, skb); done: - lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret); + LEAVE(); return ret; } @@ -283,9 +280,6 @@ void libertas_send_tx_feedback(wlan_private * priv) libertas_upload_rx_packet(priv, adapter->currenttxskb); adapter->currenttxskb = NULL; priv->adapter->TxLockFlag = 0; - if (priv->adapter->connect_status == libertas_connected) { - netif_wake_queue(priv->dev); - netif_wake_queue(priv->mesh_dev); - } + if (priv->adapter->connect_status == libertas_connected) + netif_wake_queue(priv->wlan_dev.netdev); } -EXPORT_SYMBOL_GPL(libertas_send_tx_feedback); diff --git a/trunk/drivers/net/wireless/libertas/types.h b/trunk/drivers/net/wireless/libertas/types.h index 028e2f3b53d6..09d62f8b1a16 100644 --- a/trunk/drivers/net/wireless/libertas/types.h +++ b/trunk/drivers/net/wireless/libertas/types.h @@ -5,7 +5,6 @@ #define _WLAN_TYPES_ #include -#include /** IEEE type definitions */ enum ieeetypes_elementid { @@ -30,30 +29,9 @@ enum ieeetypes_elementid { EXTRA_IE = 133, } __attribute__ ((packed)); -#ifdef __BIG_ENDIAN #define CAPINFO_MASK (~(0xda00)) -#else -#define CAPINFO_MASK (~(0x00da)) -#endif struct ieeetypes_capinfo { -#ifdef __BIG_ENDIAN_BITFIELD - u8 chanagility:1; - u8 pbcc:1; - u8 shortpreamble:1; - u8 privacy:1; - u8 cfpollrqst:1; - u8 cfpollable:1; - u8 ibss:1; - u8 ess:1; - u8 rsrvd1:2; - u8 dsssofdm:1; - u8 rsvrd2:1; - u8 apsd:1; - u8 shortslottime:1; - u8 rsrvd3:1; - u8 spectrummgmt:1; -#else u8 ess:1; u8 ibss:1; u8 cfpollable:1; @@ -69,7 +47,6 @@ struct ieeetypes_capinfo { u8 rsvrd2:1; u8 dsssofdm:1; u8 rsrvd1:2; -#endif } __attribute__ ((packed)); struct ieeetypes_cfparamset { @@ -77,15 +54,15 @@ struct ieeetypes_cfparamset { u8 len; u8 cfpcnt; u8 cfpperiod; - __le16 cfpmaxduration; - __le16 cfpdurationremaining; + u16 cfpmaxduration; + u16 cfpdurationremaining; } __attribute__ ((packed)); struct ieeetypes_ibssparamset { u8 elementid; u8 len; - __le16 atimwindow; + u16 atimwindow; } __attribute__ ((packed)); union IEEEtypes_ssparamset { @@ -96,7 +73,7 @@ union IEEEtypes_ssparamset { struct ieeetypes_fhparamset { u8 elementid; u8 len; - __le16 dwelltime; + u16 dwelltime; u8 hopset; u8 hoppattern; u8 hopindex; @@ -115,8 +92,8 @@ union ieeetypes_phyparamset { struct ieeetypes_assocrsp { struct ieeetypes_capinfo capability; - __le16 statuscode; - __le16 aid; + u16 statuscode; + u16 aid; u8 iebuffer[1]; } __attribute__ ((packed)); @@ -161,8 +138,8 @@ struct ieeetypes_assocrsp { /** TLV related data structures*/ struct mrvlietypesheader { - __le16 type; - __le16 len; + u16 type; + u16 len; } __attribute__ ((packed)); struct mrvlietypes_data { @@ -187,23 +164,17 @@ struct mrvlietypes_wildcardssidparamset { } __attribute__ ((packed)); struct chanscanmode { -#ifdef __BIG_ENDIAN_BITFIELD - u8 reserved_2_7:6; - u8 disablechanfilt:1; - u8 passivescan:1; -#else u8 passivescan:1; u8 disablechanfilt:1; u8 reserved_2_7:6; -#endif } __attribute__ ((packed)); struct chanscanparamset { u8 radiotype; u8 channumber; struct chanscanmode chanscanmode; - __le16 minscantime; - __le16 maxscantime; + u16 minscantime; + u16 maxscantime; } __attribute__ ((packed)); struct mrvlietypes_chanlistparamset { @@ -214,12 +185,12 @@ struct mrvlietypes_chanlistparamset { struct cfparamset { u8 cfpcnt; u8 cfpperiod; - __le16 cfpmaxduration; - __le16 cfpdurationremaining; + u16 cfpmaxduration; + u16 cfpdurationremaining; } __attribute__ ((packed)); struct ibssparamset { - __le16 atimwindow; + u16 atimwindow; } __attribute__ ((packed)); struct mrvlietypes_ssparamset { @@ -231,7 +202,7 @@ struct mrvlietypes_ssparamset { } __attribute__ ((packed)); struct fhparamset { - __le16 dwelltime; + u16 dwelltime; u8 hopset; u8 hoppattern; u8 hopindex; @@ -292,17 +263,17 @@ struct mrvlietypes_beaconsmissed { struct mrvlietypes_numprobes { struct mrvlietypesheader header; - __le16 numprobes; + u16 numprobes; } __attribute__ ((packed)); struct mrvlietypes_bcastprobe { struct mrvlietypesheader header; - __le16 bcastprobe; + u16 bcastprobe; } __attribute__ ((packed)); struct mrvlietypes_numssidprobe { struct mrvlietypesheader header; - __le16 numssidprobe; + u16 numssidprobe; } __attribute__ ((packed)); struct led_pin { diff --git a/trunk/drivers/net/wireless/libertas/wext.c b/trunk/drivers/net/wireless/libertas/wext.c index 8939251a2f4c..69f52b6e59c8 100644 --- a/trunk/drivers/net/wireless/libertas/wext.c +++ b/trunk/drivers/net/wireless/libertas/wext.c @@ -21,14 +21,6 @@ #include "assoc.h" -/** - * the rates supported by the card - */ -static u8 libertas_wlan_data_rates[WLAN_SUPPORTED_RATES] = - { 0x02, 0x04, 0x0B, 0x16, 0x00, 0x0C, 0x12, - 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x00 -}; - /** * @brief Convert mw value to dbm value * @@ -110,8 +102,8 @@ struct chan_freq_power *libertas_find_cfp_by_band_and_channel(wlan_adapter * ada } if (!cfp && channel) - lbs_deb_wext("libertas_find_cfp_by_band_and_channel: can't find " - "cfp by band %d / channel %d\n", band, channel); + lbs_pr_debug(1, "libertas_find_cfp_by_band_and_channel(): cannot find " + "cfp by band %d & channel %d\n", band, channel); return cfp; } @@ -151,12 +143,113 @@ static struct chan_freq_power *find_cfp_by_band_and_freq(wlan_adapter * adapter, } if (!cfp && freq) - lbs_deb_wext("find_cfp_by_band_and_freql: can't find cfp by " - "band %d / freq %d\n", band, freq); + lbs_pr_debug(1, "find_cfp_by_band_and_freql(): cannot find cfp by " + "band %d & freq %d\n", band, freq); return cfp; } +static int updatecurrentchannel(wlan_private * priv) +{ + int ret; + + /* + ** the channel in f/w could be out of sync, get the current channel + */ + ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_channel, + cmd_opt_802_11_rf_channel_get, + cmd_option_waitforrsp, 0, NULL); + + lbs_pr_debug(1, "Current channel = %d\n", + priv->adapter->curbssparams.channel); + + return ret; +} + +static int setcurrentchannel(wlan_private * priv, int channel) +{ + lbs_pr_debug(1, "Set channel = %d\n", channel); + + /* + ** Current channel is not set to adhocchannel requested, set channel + */ + return (libertas_prepare_and_send_command(priv, cmd_802_11_rf_channel, + cmd_opt_802_11_rf_channel_set, + cmd_option_waitforrsp, 0, &channel)); +} + +static int changeadhocchannel(wlan_private * priv, int channel) +{ + int ret = 0; + wlan_adapter *adapter = priv->adapter; + + adapter->adhocchannel = channel; + + updatecurrentchannel(priv); + + if (adapter->curbssparams.channel == adapter->adhocchannel) { + /* adhocchannel is set to the current channel already */ + LEAVE(); + return 0; + } + + lbs_pr_debug(1, "Updating channel from %d to %d\n", + adapter->curbssparams.channel, adapter->adhocchannel); + + setcurrentchannel(priv, adapter->adhocchannel); + + updatecurrentchannel(priv); + + if (adapter->curbssparams.channel != adapter->adhocchannel) { + lbs_pr_debug(1, "failed to updated channel to %d, channel = %d\n", + adapter->adhocchannel, adapter->curbssparams.channel); + LEAVE(); + return -1; + } + + if (adapter->connect_status == libertas_connected) { + int i; + struct WLAN_802_11_SSID curadhocssid; + + lbs_pr_debug(1, "channel Changed while in an IBSS\n"); + + /* Copy the current ssid */ + memcpy(&curadhocssid, &adapter->curbssparams.ssid, + sizeof(struct WLAN_802_11_SSID)); + + /* Exit Adhoc mode */ + lbs_pr_debug(1, "In changeadhocchannel(): Sending Adhoc Stop\n"); + ret = libertas_stop_adhoc_network(priv); + + if (ret) { + LEAVE(); + return ret; + } + /* Scan for the network, do not save previous results. Stale + * scan data will cause us to join a non-existant adhoc network + */ + libertas_send_specific_SSID_scan(priv, &curadhocssid, 0); + + // find out the BSSID that matches the current SSID + i = libertas_find_SSID_in_list(adapter, &curadhocssid, NULL, + IW_MODE_ADHOC); + + if (i >= 0) { + lbs_pr_debug(1, "SSID found at %d in List," + "so join\n", i); + libertas_join_adhoc_network(priv, &adapter->scantable[i]); + } else { + // else send START command + lbs_pr_debug(1, "SSID not found in list, " + "so creating adhoc with ssid = %s\n", + curadhocssid.ssid); + libertas_start_adhoc_network(priv, &curadhocssid); + } // end of else (START command) + } + + LEAVE(); + return 0; +} /** * @brief Set Radio On/OFF @@ -170,10 +263,10 @@ int wlan_radio_ioctl(wlan_private * priv, u8 option) int ret = 0; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (adapter->radioon != option) { - lbs_deb_wext("switching radio %s\n", option ? "on" : "off"); + lbs_pr_debug(1, "Switching %s the Radio\n", option ? "On" : "Off"); adapter->radioon = option; ret = libertas_prepare_and_send_command(priv, @@ -182,7 +275,7 @@ int wlan_radio_ioctl(wlan_private * priv, u8 option) cmd_option_waitforrsp, 0, NULL); } - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -219,15 +312,15 @@ static int get_active_data_rates(wlan_adapter * adapter, { int k = 0; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (adapter->connect_status != libertas_connected) { if (adapter->mode == IW_MODE_INFRA) { - lbs_deb_wext("infra\n"); + lbs_pr_debug(1, "Infra\n"); k = copyrates(rates, k, libertas_supported_rates, sizeof(libertas_supported_rates)); } else { - lbs_deb_wext("Adhoc G\n"); + lbs_pr_debug(1, "Adhoc G\n"); k = copyrates(rates, k, libertas_adhoc_rates_g, sizeof(libertas_adhoc_rates_g)); } @@ -236,7 +329,8 @@ static int get_active_data_rates(wlan_adapter * adapter, adapter->curbssparams.numofrates); } - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", k); + LEAVE(); + return k; } @@ -248,7 +342,7 @@ static int wlan_get_name(struct net_device *dev, struct iw_request_info *info, char mrvl[6] = { "MRVL-" }; int cnt; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); strcpy(cwrq, mrvl); @@ -266,7 +360,8 @@ static int wlan_get_name(struct net_device *dev, struct iw_request_info *info, } *cwrq = '\0'; - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); + return 0; } @@ -277,14 +372,14 @@ static int wlan_get_freq(struct net_device *dev, struct iw_request_info *info, wlan_adapter *adapter = priv->adapter; struct chan_freq_power *cfp; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); cfp = libertas_find_cfp_by_band_and_channel(adapter, 0, adapter->curbssparams.channel); if (!cfp) { if (adapter->curbssparams.channel) - lbs_deb_wext("invalid channel %d\n", + lbs_pr_debug(1, "Invalid channel=%d\n", adapter->curbssparams.channel); return -EINVAL; } @@ -292,8 +387,9 @@ static int wlan_get_freq(struct net_device *dev, struct iw_request_info *info, fwrq->m = (long)cfp->freq * 100000; fwrq->e = 1; - lbs_deb_wext("freq %u\n", fwrq->m); - lbs_deb_leave(LBS_DEB_WEXT); + lbs_pr_debug(1, "freq=%u\n", fwrq->m); + + LEAVE(); return 0; } @@ -303,7 +399,7 @@ static int wlan_get_wap(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (adapter->connect_status == libertas_connected) { memcpy(awrq->sa_data, adapter->curbssparams.bssid, ETH_ALEN); @@ -312,7 +408,7 @@ static int wlan_get_wap(struct net_device *dev, struct iw_request_info *info, } awrq->sa_family = ARPHRD_ETHER; - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -322,7 +418,7 @@ static int wlan_set_nick(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); /* * Check the size of the string @@ -337,7 +433,7 @@ static int wlan_set_nick(struct net_device *dev, struct iw_request_info *info, memcpy(adapter->nodename, extra, dwrq->length); mutex_unlock(&adapter->lock); - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -347,7 +443,7 @@ static int wlan_get_nick(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); /* * Get the Nick Name saved @@ -368,43 +464,19 @@ static int wlan_get_nick(struct net_device *dev, struct iw_request_info *info, */ dwrq->length = strlen(extra) + 1; - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } -static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; - - lbs_deb_enter(LBS_DEB_WEXT); - - /* Use nickname to indicate that mesh is on */ - - if (adapter->connect_status == libertas_connected) { - strncpy(extra, "Mesh", 12); - extra[12] = '\0'; - dwrq->length = strlen(extra) + 1; - } - - else { - extra[0] = '\0'; - dwrq->length = 1 ; - } - - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - u32 rthr = vwrq->value; + int rthr = vwrq->value; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (vwrq->disabled) { adapter->rtsthsd = rthr = MRVDRV_RTS_MAX_VALUE; @@ -418,7 +490,7 @@ static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, cmd_act_set, cmd_option_waitforrsp, OID_802_11_RTS_THRESHOLD, &rthr); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -429,34 +501,35 @@ static int wlan_get_rts(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); adapter->rtsthsd = 0; ret = libertas_prepare_and_send_command(priv, cmd_802_11_snmp_mib, cmd_act_get, cmd_option_waitforrsp, OID_802_11_RTS_THRESHOLD, NULL); - if (ret) - goto out; + if (ret) { + LEAVE(); + return ret; + } vwrq->value = adapter->rtsthsd; vwrq->disabled = ((vwrq->value < MRVDRV_RTS_MIN_VALUE) || (vwrq->value > MRVDRV_RTS_MAX_VALUE)); vwrq->fixed = 1; -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; + LEAVE(); + return 0; } static int wlan_set_frag(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; - u32 fthr = vwrq->value; + int fthr = vwrq->value; wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (vwrq->disabled) { adapter->fragthsd = fthr = MRVDRV_FRAG_MAX_VALUE; @@ -470,8 +543,7 @@ static int wlan_set_frag(struct net_device *dev, struct iw_request_info *info, ret = libertas_prepare_and_send_command(priv, cmd_802_11_snmp_mib, cmd_act_set, cmd_option_waitforrsp, OID_802_11_FRAGMENTATION_THRESHOLD, &fthr); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -482,23 +554,24 @@ static int wlan_get_frag(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); adapter->fragthsd = 0; ret = libertas_prepare_and_send_command(priv, cmd_802_11_snmp_mib, cmd_act_get, cmd_option_waitforrsp, OID_802_11_FRAGMENTATION_THRESHOLD, NULL); - if (ret) - goto out; + if (ret) { + LEAVE(); + return ret; + } vwrq->value = adapter->fragthsd; vwrq->disabled = ((vwrq->value < MRVDRV_FRAG_MIN_VALUE) || (vwrq->value > MRVDRV_FRAG_MAX_VALUE)); vwrq->fixed = 1; -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -508,23 +581,11 @@ static int wlan_get_mode(struct net_device *dev, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); *uwrq = adapter->mode; - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int mesh_wlan_get_mode(struct net_device *dev, - struct iw_request_info *info, u32 * uwrq, - char *extra) -{ - lbs_deb_enter(LBS_DEB_WEXT); - - *uwrq = IW_MODE_REPEAT ; - - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -536,17 +597,19 @@ static int wlan_get_txpow(struct net_device *dev, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_tx_power, cmd_act_tx_power_opt_get, cmd_option_waitforrsp, 0, NULL); - if (ret) - goto out; + if (ret) { + LEAVE(); + return ret; + } - lbs_deb_wext("tx power level %d dbm\n", adapter->txpowerlevel); + lbs_pr_debug(1, "TXPOWER GET %d dbm.\n", adapter->txpowerlevel); vwrq->value = adapter->txpowerlevel; vwrq->fixed = 1; if (adapter->radioon) { @@ -556,9 +619,8 @@ static int wlan_get_txpow(struct net_device *dev, vwrq->disabled = 1; } -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; + LEAVE(); + return 0; } static int wlan_set_retry(struct net_device *dev, struct iw_request_info *info, @@ -568,7 +630,7 @@ static int wlan_set_retry(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (vwrq->flags == IW_RETRY_LIMIT) { /* The MAC has a 4-bit Total_Tx_Count register @@ -586,15 +648,16 @@ static int wlan_set_retry(struct net_device *dev, struct iw_request_info *info, cmd_option_waitforrsp, OID_802_11_TX_RETRYCOUNT, NULL); - if (ret) - goto out; + if (ret) { + LEAVE(); + return ret; + } } else { return -EOPNOTSUPP; } -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; + LEAVE(); + return 0; } static int wlan_get_retry(struct net_device *dev, struct iw_request_info *info, @@ -604,16 +667,16 @@ static int wlan_get_retry(struct net_device *dev, struct iw_request_info *info, wlan_adapter *adapter = priv->adapter; int ret = 0; - lbs_deb_enter(LBS_DEB_WEXT); - + ENTER(); adapter->txretrycount = 0; ret = libertas_prepare_and_send_command(priv, cmd_802_11_snmp_mib, cmd_act_get, cmd_option_waitforrsp, OID_802_11_TX_RETRYCOUNT, NULL); - if (ret) - goto out; - + if (ret) { + LEAVE(); + return ret; + } vwrq->disabled = 0; if (!vwrq->flags) { vwrq->flags = IW_RETRY_LIMIT; @@ -621,9 +684,8 @@ static int wlan_get_retry(struct net_device *dev, struct iw_request_info *info, vwrq->value = adapter->txretrycount - 1; } -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; + LEAVE(); + return 0; } static inline void sort_channels(struct iw_freq *freq, int num) @@ -677,7 +739,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, u8 flag = 0; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); dwrq->length = sizeof(struct iw_range); memset(range, 0, sizeof(struct iw_range)); @@ -693,7 +755,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, range->bitrate[i] = (rates[i] & 0x7f) * 500000; } range->num_bitrates = i; - lbs_deb_wext("IW_MAX_BITRATES %d, num_bitrates %d\n", IW_MAX_BITRATES, + lbs_pr_debug(1, "IW_MAX_BITRATES=%d num_bitrates=%d\n", IW_MAX_BITRATES, range->num_bitrates); range->num_frequency = 0; @@ -706,17 +768,18 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, &adapter->parsed_region_chan; if (parsed_region_chan == NULL) { - lbs_deb_wext("11d: parsed_region_chan is NULL\n"); - goto out; + lbs_pr_debug(1, "11D:parsed_region_chan is NULL\n"); + LEAVE(); + return 0; } band = parsed_region_chan->band; - lbs_deb_wext("band %d, nr_char %d\n", band, + lbs_pr_debug(1, "band=%d NoOfChan=%d\n", band, parsed_region_chan->nr_chan); for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES) && (i < parsed_region_chan->nr_chan); i++) { chan_no = parsed_region_chan->chanpwr[i].chan; - lbs_deb_wext("chan_no %d\n", chan_no); + lbs_pr_debug(1, "chan_no=%d\n", chan_no); range->freq[range->num_frequency].i = (long)chan_no; range->freq[range->num_frequency].m = (long)libertas_chan_2_freq(chan_no, band) * 100000; @@ -745,7 +808,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, } } - lbs_deb_wext("IW_MAX_FREQUENCIES %d, num_frequency %d\n", + lbs_pr_debug(1, "IW_MAX_FREQUENCIES=%d num_frequency=%d\n", IW_MAX_FREQUENCIES, range->num_frequency); range->num_channels = range->num_frequency; @@ -840,8 +903,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, | IW_ENC_CAPA_CIPHER_CCMP; } -out: - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -851,7 +913,7 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); /* PS is currently supported only in Infrastructure mode * Remove this check if it is to be supported in IBSS mode also @@ -867,11 +929,11 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info, } if ((vwrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { - lbs_deb_wext( - "setting power timeout is not supported\n"); + lbs_pr_debug(1, + "Setting power timeout command is not supported\n"); return -EINVAL; } else if ((vwrq->flags & IW_POWER_TYPE) == IW_POWER_PERIOD) { - lbs_deb_wext("setting power period not supported\n"); + lbs_pr_debug(1, "Setting power period command is not supported\n"); return -EINVAL; } @@ -885,7 +947,7 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info, libertas_ps_sleep(priv, cmd_option_waitforrsp); } - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -896,20 +958,19 @@ static int wlan_get_power(struct net_device *dev, struct iw_request_info *info, wlan_adapter *adapter = priv->adapter; int mode; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); mode = adapter->psmode; if ((vwrq->disabled = (mode == wlan802_11powermodecam)) - || adapter->connect_status == libertas_disconnected) - { - goto out; + || adapter->connect_status == libertas_disconnected) { + LEAVE(); + return 0; } vwrq->value = 0; -out: - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -1002,16 +1063,6 @@ static const struct iw_priv_args wlan_private_args[] = { IW_PRIV_TYPE_CHAR | 128, IW_PRIV_TYPE_CHAR | 128, "bt_list"}, - { - WLAN_SUBCMD_BT_SET_INVERT, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, - IW_PRIV_TYPE_NONE, - "bt_set_invert"}, - { - WLAN_SUBCMD_BT_GET_INVERT, - IW_PRIV_TYPE_NONE, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, - "bt_get_invert"}, /* FWT Management */ { WLAN_SUBCMD_FWT_ADD, @@ -1074,7 +1125,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) u8 rssi; u32 tx_retries; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); priv->wstats.status = adapter->mode; @@ -1094,8 +1145,8 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) CAL_NF(adapter->NF[TYPE_BEACON][TYPE_NOAVG]); } - lbs_deb_wext("signal level %#x\n", priv->wstats.qual.level); - lbs_deb_wext("noise %#x\n", priv->wstats.qual.noise); + lbs_pr_debug(1, "Signal Level = %#x\n", priv->wstats.qual.level); + lbs_pr_debug(1, "Noise = %#x\n", priv->wstats.qual.noise); rssi = priv->wstats.qual.level - priv->wstats.qual.noise; if (rssi < 15) @@ -1115,7 +1166,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) /* Quality by TX errors */ priv->wstats.discard.retries = priv->stats.tx_errors; - tx_retries = le16_to_cpu(adapter->logmsg.retry); + tx_retries = adapter->logmsg.retry; if (tx_retries > 75) tx_qual = (90 - tx_retries) * POOR / 15; @@ -1131,10 +1182,10 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) (PERFECT - VERY_GOOD) / 50 + VERY_GOOD; quality = min(quality, tx_qual); - priv->wstats.discard.code = le16_to_cpu(adapter->logmsg.wepundecryptable); - priv->wstats.discard.fragment = le16_to_cpu(adapter->logmsg.rxfrag); + priv->wstats.discard.code = adapter->logmsg.wepundecryptable; + priv->wstats.discard.fragment = adapter->logmsg.fcserror; priv->wstats.discard.retries = tx_retries; - priv->wstats.discard.misc = le16_to_cpu(adapter->logmsg.ackfailure); + priv->wstats.discard.misc = adapter->logmsg.ackfailure; /* Calculate quality */ priv->wstats.qual.qual = max(quality, (u32)100); @@ -1158,7 +1209,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_INVALID; } - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE (); return &priv->wstats; @@ -1167,59 +1218,81 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) static int wlan_set_freq(struct net_device *dev, struct iw_request_info *info, struct iw_freq *fwrq, char *extra) { - int ret = -EINVAL; + int ret = 0; wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; + int rc = -EINPROGRESS; /* Call commit handler */ struct chan_freq_power *cfp; - struct assoc_request * assoc_req; - lbs_deb_enter(LBS_DEB_WEXT); - - mutex_lock(&adapter->lock); - assoc_req = wlan_get_association_request(adapter); - if (!assoc_req) { - ret = -ENOMEM; - goto out; - } + ENTER(); - /* If setting by frequency, convert to a channel */ + /* + * If setting by frequency, convert to a channel + */ if (fwrq->e == 1) { + long f = fwrq->m / 100000; + int c = 0; cfp = find_cfp_by_band_and_freq(adapter, 0, f); if (!cfp) { - lbs_deb_wext("invalid freq %ld\n", f); - goto out; + lbs_pr_debug(1, "Invalid freq=%ld\n", f); + return -EINVAL; } - fwrq->e = 0; - fwrq->m = (int) cfp->channel; - } + c = (int)cfp->channel; - /* Setting by channel number */ - if (fwrq->m > 1000 || fwrq->e > 0) { - goto out; - } + if (c < 0) + return -EINVAL; - cfp = libertas_find_cfp_by_band_and_channel(adapter, 0, fwrq->m); - if (!cfp) { - goto out; + fwrq->e = 0; + fwrq->m = c; } - assoc_req->channel = fwrq->m; - ret = 0; - -out: - if (ret == 0) { - set_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags); - wlan_postpone_association_work(priv); + /* + * Setting by channel number + */ + if (fwrq->m > 1000 || fwrq->e > 0) { + rc = -EOPNOTSUPP; } else { - wlan_cancel_association_work(priv); + int channel = fwrq->m; + + cfp = libertas_find_cfp_by_band_and_channel(adapter, 0, channel); + if (!cfp) { + rc = -EINVAL; + } else { + if (adapter->mode == IW_MODE_ADHOC) { + rc = changeadhocchannel(priv, channel); + /* If station is WEP enabled, send the + * command to set WEP in firmware + */ + if (adapter->secinfo.wep_enabled) { + lbs_pr_debug(1, "set_freq: WEP enabled\n"); + ret = libertas_prepare_and_send_command(priv, + cmd_802_11_set_wep, + cmd_act_add, + cmd_option_waitforrsp, + 0, + NULL); + + if (ret) { + LEAVE(); + return ret; + } + + adapter->currentpacketfilter |= + cmd_act_mac_wep_enable; + + libertas_set_mac_packet_filter(priv); + } + } else { + rc = -EOPNOTSUPP; + } + } } - mutex_unlock(&adapter->lock); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; + LEAVE(); + return rc; } /** @@ -1265,9 +1338,9 @@ static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info, u8 rates[WLAN_SUPPORTED_RATES]; u8 *rate; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); - lbs_deb_wext("vwrq->value %d\n", vwrq->value); + lbs_pr_debug(1, "Vwrq->value = %d\n", vwrq->value); if (vwrq->value == -1) { action = cmd_act_set_tx_auto; // Auto @@ -1284,15 +1357,15 @@ static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info, get_active_data_rates(adapter, rates); rate = rates; while (*rate) { - lbs_deb_wext("rate=0x%X, wanted data_rate 0x%X\n", *rate, + lbs_pr_debug(1, "Rate=0x%X Wanted=0x%X\n", *rate, data_rate); if ((*rate & 0x7f) == (data_rate & 0x7f)) break; rate++; } if (!*rate) { - lbs_pr_alert("fixed data rate 0x%X out " - "of range\n", data_rate); + lbs_pr_alert( "The fixed data rate 0x%X is out " + "of range.\n", data_rate); return -EINVAL; } @@ -1304,7 +1377,7 @@ static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info, ret = libertas_prepare_and_send_command(priv, cmd_802_11_data_rate, action, cmd_option_waitforrsp, 0, NULL); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -1314,7 +1387,7 @@ static int wlan_get_rate(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (adapter->is_datarate_auto) { vwrq->fixed = 0; @@ -1324,7 +1397,7 @@ static int wlan_get_rate(struct net_device *dev, struct iw_request_info *info, vwrq->value = adapter->datarate * 500000; - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -1336,12 +1409,12 @@ static int wlan_set_mode(struct net_device *dev, wlan_adapter *adapter = priv->adapter; struct assoc_request * assoc_req; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if ( (*uwrq != IW_MODE_ADHOC) && (*uwrq != IW_MODE_INFRA) && (*uwrq != IW_MODE_AUTO)) { - lbs_deb_wext("Invalid mode: 0x%x\n", *uwrq); + lbs_pr_debug(1, "Invalid mode: 0x%x\n", *uwrq); ret = -EINVAL; goto out; } @@ -1355,12 +1428,12 @@ static int wlan_set_mode(struct net_device *dev, assoc_req->mode = *uwrq; set_bit(ASSOC_FLAG_MODE, &assoc_req->flags); wlan_postpone_association_work(priv); - lbs_deb_wext("Switching to mode: 0x%x\n", *uwrq); + lbs_pr_debug(1, "Switching to mode: 0x%x\n", *uwrq); } mutex_unlock(&adapter->lock); out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -1382,9 +1455,9 @@ static int wlan_get_encode(struct net_device *dev, wlan_adapter *adapter = priv->adapter; int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); - lbs_deb_wext("flags 0x%x, index %d, length %d, wep_tx_keyidx %d\n", + lbs_pr_debug(1, "flags=0x%x index=%d length=%d wep_tx_keyidx=%d\n", dwrq->flags, index, dwrq->length, adapter->wep_tx_keyidx); dwrq->flags = 0; @@ -1440,13 +1513,13 @@ static int wlan_get_encode(struct net_device *dev, dwrq->flags |= IW_ENCODE_NOKEY; - lbs_deb_wext("key: " MAC_FMT ", keylen %d\n", + lbs_pr_debug(1, "key:%02x:%02x:%02x:%02x:%02x:%02x keylen=%d\n", extra[0], extra[1], extra[2], extra[3], extra[4], extra[5], dwrq->length); - lbs_deb_wext("return flags 0x%x\n", dwrq->flags); + lbs_pr_debug(1, "Return flags=0x%x\n", dwrq->flags); - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -1466,21 +1539,20 @@ static int wlan_set_wep_key(struct assoc_request *assoc_req, u16 index, int set_tx_key) { - int ret = 0; struct WLAN_802_11_KEY *pkey; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); /* Paranoid validation of key index */ if (index > 3) { - ret = -EINVAL; - goto out; + LEAVE(); + return -EINVAL; } /* validate max key length */ if (key_length > KEY_LEN_WEP_104) { - ret = -EINVAL; - goto out; + LEAVE(); + return -EINVAL; } pkey = &assoc_req->wep_keys[index]; @@ -1498,18 +1570,17 @@ static int wlan_set_wep_key(struct assoc_request *assoc_req, if (set_tx_key) { /* Ensure the chosen key is valid */ if (!pkey->len) { - lbs_deb_wext("key not set, so cannot enable it\n"); - ret = -EINVAL; - goto out; + lbs_pr_debug(1, "key not set, so cannot enable it\n"); + LEAVE(); + return -EINVAL; } assoc_req->wep_tx_keyidx = index; } assoc_req->secinfo.wep_enabled = 1; -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; + LEAVE(); + return 0; } static int validate_key_index(u16 def_index, u16 raw_index, @@ -1534,8 +1605,6 @@ static void disable_wep(struct assoc_request *assoc_req) { int i; - lbs_deb_enter(LBS_DEB_WEXT); - /* Set Open System auth mode */ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; @@ -1546,27 +1615,6 @@ static void disable_wep(struct assoc_request *assoc_req) set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); - - lbs_deb_leave(LBS_DEB_WEXT); -} - -static void disable_wpa(struct assoc_request *assoc_req) -{ - lbs_deb_enter(LBS_DEB_WEXT); - - memset(&assoc_req->wpa_mcast_key, 0, sizeof (struct WLAN_802_11_KEY)); - assoc_req->wpa_mcast_key.flags = KEY_INFO_WPA_MCAST; - set_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); - - memset(&assoc_req->wpa_unicast_key, 0, sizeof (struct WLAN_802_11_KEY)); - assoc_req->wpa_unicast_key.flags = KEY_INFO_WPA_UNICAST; - set_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); - - assoc_req->secinfo.WPAenabled = 0; - assoc_req->secinfo.WPA2enabled = 0; - set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); - - lbs_deb_leave(LBS_DEB_WEXT); } /** @@ -1588,7 +1636,7 @@ static int wlan_set_encode(struct net_device *dev, struct assoc_request * assoc_req; u16 is_default = 0, index = 0, set_tx_key = 0; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); mutex_lock(&adapter->lock); assoc_req = wlan_get_association_request(adapter); @@ -1599,7 +1647,6 @@ static int wlan_set_encode(struct net_device *dev, if (dwrq->flags & IW_ENCODE_DISABLED) { disable_wep (assoc_req); - disable_wpa (assoc_req); goto out; } @@ -1641,7 +1688,7 @@ static int wlan_set_encode(struct net_device *dev, } mutex_unlock(&adapter->lock); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -1665,7 +1712,7 @@ static int wlan_get_encodeext(struct net_device *dev, struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; int index, max_key_len; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); max_key_len = dwrq->length - sizeof(*ext); if (max_key_len < 0) @@ -1701,7 +1748,6 @@ static int wlan_get_encodeext(struct net_device *dev, if ( adapter->secinfo.wep_enabled && !adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled) { - /* WEP */ ext->alg = IW_ENCODE_ALG_WEP; ext->key_len = adapter->wep_keys[index].len; key = &adapter->wep_keys[index].key[0]; @@ -1709,27 +1755,8 @@ static int wlan_get_encodeext(struct net_device *dev, && (adapter->secinfo.WPAenabled || adapter->secinfo.WPA2enabled)) { /* WPA */ - struct WLAN_802_11_KEY * pkey = NULL; - - if ( adapter->wpa_mcast_key.len - && (adapter->wpa_mcast_key.flags & KEY_INFO_WPA_ENABLED)) - pkey = &adapter->wpa_mcast_key; - else if ( adapter->wpa_unicast_key.len - && (adapter->wpa_unicast_key.flags & KEY_INFO_WPA_ENABLED)) - pkey = &adapter->wpa_unicast_key; - - if (pkey) { - if (pkey->type == KEY_TYPE_ID_AES) { - ext->alg = IW_ENCODE_ALG_CCMP; - } else { - ext->alg = IW_ENCODE_ALG_TKIP; - } - ext->key_len = pkey->len; - key = &pkey->key[0]; - } else { - ext->alg = IW_ENCODE_ALG_TKIP; - ext->key_len = 0; - } + ext->alg = IW_ENCODE_ALG_TKIP; + ext->key_len = 0; } else { goto out; } @@ -1748,7 +1775,7 @@ static int wlan_get_encodeext(struct net_device *dev, ret = 0; out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -1773,7 +1800,7 @@ static int wlan_set_encodeext(struct net_device *dev, int alg = ext->alg; struct assoc_request * assoc_req; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); mutex_lock(&adapter->lock); assoc_req = wlan_get_association_request(adapter); @@ -1784,7 +1811,6 @@ static int wlan_set_encodeext(struct net_device *dev, if ((alg == IW_ENCODE_ALG_NONE) || (dwrq->flags & IW_ENCODE_DISABLED)) { disable_wep (assoc_req); - disable_wpa (assoc_req); } else if (alg == IW_ENCODE_ALG_WEP) { u16 is_default = 0, index, set_tx_key = 0; @@ -1820,6 +1846,7 @@ static int wlan_set_encodeext(struct net_device *dev, set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); if (set_tx_key) set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags); + } else if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) { struct WLAN_802_11_KEY * pkey; @@ -1828,43 +1855,36 @@ static int wlan_set_encodeext(struct net_device *dev, && (ext->key_len != KEY_LEN_WPA_TKIP)) || ((alg == IW_ENCODE_ALG_CCMP) && (ext->key_len != KEY_LEN_WPA_AES))) { - lbs_deb_wext("invalid size %d for key of alg" - "type %d\n", + lbs_pr_debug(1, "Invalid size %d for key of alg" + "type %d.\n", ext->key_len, alg); ret = -EINVAL; goto out; } - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { + if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) pkey = &assoc_req->wpa_mcast_key; - set_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); - } else { + else pkey = &assoc_req->wpa_unicast_key; - set_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); - } memset(pkey, 0, sizeof (struct WLAN_802_11_KEY)); memcpy(pkey->key, ext->key, ext->key_len); pkey->len = ext->key_len; - if (pkey->len) - pkey->flags |= KEY_INFO_WPA_ENABLED; + pkey->flags = KEY_INFO_WPA_ENABLED; - /* Do this after zeroing key structure */ if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { pkey->flags |= KEY_INFO_WPA_MCAST; + set_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); } else { pkey->flags |= KEY_INFO_WPA_UNICAST; + set_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); } - if (alg == IW_ENCODE_ALG_TKIP) { + if (alg == IW_ENCODE_ALG_TKIP) pkey->type = KEY_TYPE_ID_TKIP; - } else if (alg == IW_ENCODE_ALG_CCMP) { + else if (alg == IW_ENCODE_ALG_CCMP) pkey->type = KEY_TYPE_ID_AES; - } else { - ret = -EINVAL; - goto out; - } /* If WPA isn't enabled yet, do that now */ if ( assoc_req->secinfo.WPAenabled == 0 @@ -1885,7 +1905,7 @@ static int wlan_set_encodeext(struct net_device *dev, } mutex_unlock(&adapter->lock); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -1900,7 +1920,7 @@ static int wlan_set_genie(struct net_device *dev, int ret = 0; struct assoc_request * assoc_req; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); mutex_lock(&adapter->lock); assoc_req = wlan_get_association_request(adapter); @@ -1932,7 +1952,7 @@ static int wlan_set_genie(struct net_device *dev, } mutex_unlock(&adapter->lock); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -1941,28 +1961,27 @@ static int wlan_get_genie(struct net_device *dev, struct iw_point *dwrq, char *extra) { - int ret = 0; wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (adapter->wpa_ie_len == 0) { dwrq->length = 0; - goto out; + LEAVE(); + return 0; } if (dwrq->length < adapter->wpa_ie_len) { - ret = -E2BIG; - goto out; + LEAVE(); + return -E2BIG; } dwrq->length = adapter->wpa_ie_len; memcpy(extra, &adapter->wpa_ie[0], adapter->wpa_ie_len); -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; + LEAVE(); + return 0; } @@ -1977,7 +1996,7 @@ static int wlan_set_auth(struct net_device *dev, int ret = 0; int updated = 0; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); mutex_lock(&adapter->lock); assoc_req = wlan_get_association_request(adapter); @@ -1991,7 +2010,6 @@ static int wlan_set_auth(struct net_device *dev, case IW_AUTH_CIPHER_PAIRWISE: case IW_AUTH_CIPHER_GROUP: case IW_AUTH_KEY_MGMT: - case IW_AUTH_DROP_UNENCRYPTED: /* * libertas does not use these parameters */ @@ -2001,7 +2019,6 @@ static int wlan_set_auth(struct net_device *dev, if (dwrq->value & IW_AUTH_WPA_VERSION_DISABLED) { assoc_req->secinfo.WPAenabled = 0; assoc_req->secinfo.WPA2enabled = 0; - disable_wpa (assoc_req); } if (dwrq->value & IW_AUTH_WPA_VERSION_WPA) { assoc_req->secinfo.WPAenabled = 1; @@ -2016,6 +2033,17 @@ static int wlan_set_auth(struct net_device *dev, updated = 1; break; + case IW_AUTH_DROP_UNENCRYPTED: + if (dwrq->value) { + adapter->currentpacketfilter |= + cmd_act_mac_strict_protection_enable; + } else { + adapter->currentpacketfilter &= + ~cmd_act_mac_strict_protection_enable; + } + updated = 1; + break; + case IW_AUTH_80211_AUTH_ALG: if (dwrq->value & IW_AUTH_ALG_SHARED_KEY) { assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY; @@ -2041,7 +2069,6 @@ static int wlan_set_auth(struct net_device *dev, } else { assoc_req->secinfo.WPAenabled = 0; assoc_req->secinfo.WPA2enabled = 0; - disable_wpa (assoc_req); } updated = 1; break; @@ -2061,7 +2088,7 @@ static int wlan_set_auth(struct net_device *dev, } mutex_unlock(&adapter->lock); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -2070,11 +2097,10 @@ static int wlan_get_auth(struct net_device *dev, struct iw_param *dwrq, char *extra) { - int ret = 0; wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); switch (dwrq->flags & IW_AUTH_INDEX) { case IW_AUTH_WPA_VERSION: @@ -2087,6 +2113,13 @@ static int wlan_get_auth(struct net_device *dev, dwrq->value |= IW_AUTH_WPA_VERSION_DISABLED; break; + case IW_AUTH_DROP_UNENCRYPTED: + dwrq->value = 0; + if (adapter->currentpacketfilter & + cmd_act_mac_strict_protection_enable) + dwrq->value = 1; + break; + case IW_AUTH_80211_AUTH_ALG: dwrq->value = adapter->secinfo.auth_mode; break; @@ -2097,11 +2130,12 @@ static int wlan_get_auth(struct net_device *dev, break; default: - ret = -EOPNOTSUPP; + LEAVE(); + return -EOPNOTSUPP; } - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; + LEAVE(); + return 0; } @@ -2114,7 +2148,7 @@ static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info, u16 dbm; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (vwrq->disabled) { wlan_radio_ioctl(priv, RADIO_OFF); @@ -2135,14 +2169,14 @@ static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info, if (vwrq->fixed == 0) dbm = 0xffff; - lbs_deb_wext("txpower set %d dbm\n", dbm); + lbs_pr_debug(1, "<1>TXPOWER SET %d dbm.\n", dbm); ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_tx_power, cmd_act_tx_power_opt_set_low, cmd_option_waitforrsp, 0, (void *)&dbm); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -2152,8 +2186,7 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; - lbs_deb_enter(LBS_DEB_WEXT); - + ENTER(); /* * Note : if dwrq->flags != 0, we should get the relevant SSID from * the SSID list... @@ -2163,12 +2196,12 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, * Get the current SSID */ if (adapter->connect_status == libertas_connected) { - memcpy(extra, adapter->curbssparams.ssid, - adapter->curbssparams.ssid_len); - extra[adapter->curbssparams.ssid_len] = '\0'; + memcpy(extra, adapter->curbssparams.ssid.ssid, + adapter->curbssparams.ssid.ssidlength); + extra[adapter->curbssparams.ssid.ssidlength] = '\0'; } else { memset(extra, 0, 32); - extra[adapter->curbssparams.ssid_len] = '\0'; + extra[adapter->curbssparams.ssid.ssidlength] = '\0'; } /* * If none, we may want to get the one that was set @@ -2176,14 +2209,14 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, /* To make the driver backward compatible with WPA supplicant v0.2.4 */ if (dwrq->length == 32) /* check with WPA supplicant buffer size */ - dwrq->length = min_t(size_t, adapter->curbssparams.ssid_len, + dwrq->length = min_t(size_t, adapter->curbssparams.ssid.ssidlength, IW_ESSID_MAX_SIZE); else - dwrq->length = adapter->curbssparams.ssid_len + 1; + dwrq->length = adapter->curbssparams.ssid.ssidlength + 1; dwrq->flags = 1; /* active */ - lbs_deb_leave(LBS_DEB_WEXT); + LEAVE(); return 0; } @@ -2193,43 +2226,38 @@ static int wlan_set_essid(struct net_device *dev, struct iw_request_info *info, wlan_private *priv = dev->priv; wlan_adapter *adapter = priv->adapter; int ret = 0; - u8 ssid[IW_ESSID_MAX_SIZE]; - u8 ssid_len = 0; + struct WLAN_802_11_SSID ssid; struct assoc_request * assoc_req; - int in_ssid_len = dwrq->length; + int ssid_len = dwrq->length; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); /* * WE-20 and earlier NULL pad the end of the SSID and increment * SSID length so it can be used like a string. WE-21 and later don't, * but some userspace tools aren't able to cope with the change. */ - if ((in_ssid_len > 0) && (extra[in_ssid_len - 1] == '\0')) - in_ssid_len--; + if ((ssid_len > 0) && (extra[ssid_len - 1] == '\0')) + ssid_len--; /* Check the size of the string */ - if (in_ssid_len > IW_ESSID_MAX_SIZE) { + if (ssid_len > IW_ESSID_MAX_SIZE) { ret = -E2BIG; goto out; } - memset(&ssid, 0, sizeof(ssid)); + memset(&ssid, 0, sizeof(struct WLAN_802_11_SSID)); - if (!dwrq->flags || !in_ssid_len) { + if (!dwrq->flags || !ssid_len) { /* "any" SSID requested; leave SSID blank */ } else { /* Specific SSID requested */ - memcpy(&ssid, extra, in_ssid_len); - ssid_len = in_ssid_len; + memcpy(&ssid.ssid, extra, ssid_len); + ssid.ssidlength = ssid_len; } - if (!ssid_len) { - lbs_deb_wext("requested any SSID\n"); - } else { - lbs_deb_wext("requested SSID '%s'\n", - escape_essid(ssid, ssid_len)); - } + lbs_pr_debug(1, "Requested new SSID = %s\n", + (ssid.ssidlength > 0) ? (char *)ssid.ssid : "any"); out: mutex_lock(&adapter->lock); @@ -2240,8 +2268,7 @@ static int wlan_set_essid(struct net_device *dev, struct iw_request_info *info, ret = -ENOMEM; } else { /* Copy the SSID to the association request */ - memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE); - assoc_req->ssid_len = ssid_len; + memcpy(&assoc_req->ssid, &ssid, sizeof(struct WLAN_802_11_SSID)); set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); wlan_postpone_association_work(priv); } @@ -2254,7 +2281,7 @@ static int wlan_set_essid(struct net_device *dev, struct iw_request_info *info, mutex_unlock(&adapter->lock); - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); + LEAVE(); return ret; } @@ -2275,12 +2302,12 @@ static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info, struct assoc_request * assoc_req; int ret = 0; - lbs_deb_enter(LBS_DEB_WEXT); + ENTER(); if (awrq->sa_family != ARPHRD_ETHER) return -EINVAL; - lbs_deb_wext("ASSOC: WAP: sa_data " MAC_FMT "\n", MAC_ARG(awrq->sa_data)); + lbs_pr_debug(1, "ASSOC: WAP: sa_data: " MAC_FMT "\n", MAC_ARG(awrq->sa_data)); mutex_lock(&adapter->lock); @@ -2303,23 +2330,22 @@ static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info, void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen) { + union { + u32 l; + u8 c[4]; + } ver; char fwver[32]; mutex_lock(&adapter->lock); + ver.l = adapter->fwreleasenumber; + mutex_unlock(&adapter->lock); - if (adapter->fwreleasenumber[3] == 0) - sprintf(fwver, "%u.%u.%u", - adapter->fwreleasenumber[2], - adapter->fwreleasenumber[1], - adapter->fwreleasenumber[0]); + if (ver.c[3] == 0) + sprintf(fwver, "%u.%u.%u", ver.c[2], ver.c[1], ver.c[0]); else sprintf(fwver, "%u.%u.%u.p%u", - adapter->fwreleasenumber[2], - adapter->fwreleasenumber[1], - adapter->fwreleasenumber[0], - adapter->fwreleasenumber[3]); + ver.c[2], ver.c[1], ver.c[0], ver.c[3]); - mutex_unlock(&adapter->lock); snprintf(fwversion, maxlen, fwver); } @@ -2385,63 +2411,6 @@ static const iw_handler wlan_handler[] = { (iw_handler) NULL, /* SIOCSIWPMKSA */ }; -static const iw_handler mesh_wlan_handler[] = { - (iw_handler) NULL, /* SIOCSIWCOMMIT */ - (iw_handler) wlan_get_name, /* SIOCGIWNAME */ - (iw_handler) NULL, /* SIOCSIWNWID */ - (iw_handler) NULL, /* SIOCGIWNWID */ - (iw_handler) wlan_set_freq, /* SIOCSIWFREQ */ - (iw_handler) wlan_get_freq, /* SIOCGIWFREQ */ - (iw_handler) NULL, /* SIOCSIWMODE */ - (iw_handler) mesh_wlan_get_mode, /* SIOCGIWMODE */ - (iw_handler) NULL, /* SIOCSIWSENS */ - (iw_handler) NULL, /* SIOCGIWSENS */ - (iw_handler) NULL, /* SIOCSIWRANGE */ - (iw_handler) wlan_get_range, /* SIOCGIWRANGE */ - (iw_handler) NULL, /* SIOCSIWPRIV */ - (iw_handler) NULL, /* SIOCGIWPRIV */ - (iw_handler) NULL, /* SIOCSIWSTATS */ - (iw_handler) NULL, /* SIOCGIWSTATS */ - iw_handler_set_spy, /* SIOCSIWSPY */ - iw_handler_get_spy, /* SIOCGIWSPY */ - iw_handler_set_thrspy, /* SIOCSIWTHRSPY */ - iw_handler_get_thrspy, /* SIOCGIWTHRSPY */ - (iw_handler) NULL, /* SIOCSIWAP */ - (iw_handler) NULL, /* SIOCGIWAP */ - (iw_handler) NULL, /* SIOCSIWMLME */ - (iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */ - (iw_handler) libertas_set_scan, /* SIOCSIWSCAN */ - (iw_handler) libertas_get_scan, /* SIOCGIWSCAN */ - (iw_handler) NULL, /* SIOCSIWESSID */ - (iw_handler) NULL, /* SIOCGIWESSID */ - (iw_handler) NULL, /* SIOCSIWNICKN */ - (iw_handler) mesh_get_nick, /* SIOCGIWNICKN */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) wlan_set_rate, /* SIOCSIWRATE */ - (iw_handler) wlan_get_rate, /* SIOCGIWRATE */ - (iw_handler) wlan_set_rts, /* SIOCSIWRTS */ - (iw_handler) wlan_get_rts, /* SIOCGIWRTS */ - (iw_handler) wlan_set_frag, /* SIOCSIWFRAG */ - (iw_handler) wlan_get_frag, /* SIOCGIWFRAG */ - (iw_handler) wlan_set_txpow, /* SIOCSIWTXPOW */ - (iw_handler) wlan_get_txpow, /* SIOCGIWTXPOW */ - (iw_handler) wlan_set_retry, /* SIOCSIWRETRY */ - (iw_handler) wlan_get_retry, /* SIOCGIWRETRY */ - (iw_handler) wlan_set_encode, /* SIOCSIWENCODE */ - (iw_handler) wlan_get_encode, /* SIOCGIWENCODE */ - (iw_handler) wlan_set_power, /* SIOCSIWPOWER */ - (iw_handler) wlan_get_power, /* SIOCGIWPOWER */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) wlan_set_genie, /* SIOCSIWGENIE */ - (iw_handler) wlan_get_genie, /* SIOCGIWGENIE */ - (iw_handler) wlan_set_auth, /* SIOCSIWAUTH */ - (iw_handler) wlan_get_auth, /* SIOCGIWAUTH */ - (iw_handler) wlan_set_encodeext,/* SIOCSIWENCODEEXT */ - (iw_handler) wlan_get_encodeext,/* SIOCGIWENCODEEXT */ - (iw_handler) NULL, /* SIOCSIWPMKSA */ -}; struct iw_handler_def libertas_handler_def = { .num_standard = sizeof(wlan_handler) / sizeof(iw_handler), .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler), @@ -2452,14 +2421,3 @@ struct iw_handler_def libertas_handler_def = { .private_args = (struct iw_priv_args *)wlan_private_args, .get_wireless_stats = wlan_get_wireless_stats, }; - -struct iw_handler_def mesh_handler_def = { - .num_standard = sizeof(mesh_wlan_handler) / sizeof(iw_handler), - .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler), - .num_private_args = sizeof(wlan_private_args) / - sizeof(struct iw_priv_args), - .standard = (iw_handler *) mesh_wlan_handler, - .private = (iw_handler *) wlan_private_handler, - .private_args = (struct iw_priv_args *)wlan_private_args, - .get_wireless_stats = wlan_get_wireless_stats, -}; diff --git a/trunk/drivers/net/wireless/libertas/wext.h b/trunk/drivers/net/wireless/libertas/wext.h index d555056b25b7..15cfaaf0797f 100644 --- a/trunk/drivers/net/wireless/libertas/wext.h +++ b/trunk/drivers/net/wireless/libertas/wext.h @@ -20,23 +20,21 @@ #define WLAN_SUBCMD_FWT_CLEANUP 15 #define WLAN_SUBCMD_FWT_TIME 16 #define WLAN_SUBCMD_MESH_GET_TTL 17 -#define WLAN_SUBCMD_BT_GET_INVERT 18 #define WLAN_SETONEINT_GETNONE (WLANIOCTL + 24) #define WLANSETREGION 8 #define WLAN_SUBCMD_MESH_SET_TTL 18 -#define WLAN_SUBCMD_BT_SET_INVERT 19 #define WLAN_SET128CHAR_GET128CHAR (WLANIOCTL + 25) #define WLAN_SUBCMD_BT_ADD 18 #define WLAN_SUBCMD_BT_DEL 19 #define WLAN_SUBCMD_BT_LIST 20 -#define WLAN_SUBCMD_FWT_ADD 21 -#define WLAN_SUBCMD_FWT_DEL 22 -#define WLAN_SUBCMD_FWT_LOOKUP 23 -#define WLAN_SUBCMD_FWT_LIST_NEIGHBOR 24 +#define WLAN_SUBCMD_FWT_ADD 21 +#define WLAN_SUBCMD_FWT_DEL 22 +#define WLAN_SUBCMD_FWT_LOOKUP 23 +#define WLAN_SUBCMD_FWT_LIST_NEIGHBOR 24 #define WLAN_SUBCMD_FWT_LIST 25 -#define WLAN_SUBCMD_FWT_LIST_ROUTE 26 +#define WLAN_SUBCMD_FWT_LIST_ROUTE 26 #define WLAN_SET_GET_SIXTEEN_INT (WLANIOCTL + 29) #define WLAN_LED_GPIO_CTRL 5 @@ -58,7 +56,6 @@ struct wlan_ioctl_regrdwr { }; extern struct iw_handler_def libertas_handler_def; -extern struct iw_handler_def mesh_handler_def; int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int i); int wlan_radio_ioctl(wlan_private * priv, u8 option); diff --git a/trunk/drivers/parisc/ccio-dma.c b/trunk/drivers/parisc/ccio-dma.c index b3c4dbff26b8..894fdb9d44c0 100644 --- a/trunk/drivers/parisc/ccio-dma.c +++ b/trunk/drivers/parisc/ccio-dma.c @@ -32,7 +32,6 @@ */ #include -#include #include #include #include @@ -293,6 +292,7 @@ static int ioc_count; #define PDIR_INDEX(iovp) ((iovp)>>IOVP_SHIFT) #define MKIOVP(pdir_idx) ((long)(pdir_idx) << IOVP_SHIFT) #define MKIOVA(iovp,offset) (dma_addr_t)((long)iovp | (long)offset) +#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) /* ** Don't worry about the 150% average search length on a miss. @@ -668,7 +668,7 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt) size_t saved_byte_cnt; /* round up to nearest page size */ - saved_byte_cnt = byte_cnt = ALIGN(byte_cnt, IOVP_SIZE); + saved_byte_cnt = byte_cnt = ROUNDUP(byte_cnt, IOVP_SIZE); while(byte_cnt > 0) { /* invalidate one page at a time */ @@ -751,7 +751,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size, offset = ((unsigned long) addr) & ~IOVP_MASK; /* round up to nearest IOVP_SIZE */ - size = ALIGN(size + offset, IOVP_SIZE); + size = ROUNDUP(size + offset, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); #ifdef CCIO_MAP_STATS @@ -814,7 +814,7 @@ ccio_unmap_single(struct device *dev, dma_addr_t iova, size_t size, iova ^= offset; /* clear offset bits */ size += offset; - size = ALIGN(size, IOVP_SIZE); + size = ROUNDUP(size, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); @@ -1227,7 +1227,7 @@ ccio_get_iotlb_size(struct parisc_device *dev) #endif /* 0 */ /* We *can't* support JAVA (T600). Venture there at your own risk. */ -static const struct parisc_device_id ccio_tbl[] = { +static struct parisc_device_id ccio_tbl[] = { { HPHW_IOA, HVERSION_REV_ANY_ID, U2_IOA_RUNWAY, 0xb }, /* U2 */ { HPHW_IOA, HVERSION_REV_ANY_ID, UTURN_IOA_RUNWAY, 0xb }, /* UTurn */ { 0, } @@ -1370,7 +1370,7 @@ ccio_ioc_init(struct ioc *ioc) } } -static void __init +static void ccio_init_resource(struct resource *res, char *name, void __iomem *ioaddr) { int result; @@ -1537,7 +1537,7 @@ int ccio_request_resource(const struct parisc_device *dev, * If so, initialize the chip and tell other partners in crime they * have work to do. */ -static int __init ccio_probe(struct parisc_device *dev) +static int ccio_probe(struct parisc_device *dev) { int i; struct ioc *ioc, **ioc_p = &ioc_list; diff --git a/trunk/drivers/parisc/eisa.c b/trunk/drivers/parisc/eisa.c index 771cef592542..309076b39853 100644 --- a/trunk/drivers/parisc/eisa.c +++ b/trunk/drivers/parisc/eisa.c @@ -307,7 +307,7 @@ static void init_eisa_pic(void) #define is_mongoose(dev) (dev->id.sversion == 0x00076) -static int __init eisa_probe(struct parisc_device *dev) +static int __devinit eisa_probe(struct parisc_device *dev) { int i, result; @@ -387,7 +387,7 @@ static int __init eisa_probe(struct parisc_device *dev) return 0; } -static const struct parisc_device_id eisa_tbl[] = { +static struct parisc_device_id eisa_tbl[] = { { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00076 }, /* Mongoose */ { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00090 }, /* Wax EISA */ { 0, } diff --git a/trunk/drivers/parisc/iommu-helpers.h b/trunk/drivers/parisc/iommu-helpers.h index 0a1f99a2e93e..38d9e1aba1d0 100644 --- a/trunk/drivers/parisc/iommu-helpers.h +++ b/trunk/drivers/parisc/iommu-helpers.h @@ -138,7 +138,7 @@ iommu_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents, ** exceed DMA_CHUNK_SIZE if we coalesce the ** next entry. */ - if(unlikely(ALIGN(dma_len + dma_offset + startsg->length, + if(unlikely(ROUNDUP(dma_len + dma_offset + startsg->length, IOVP_SIZE) > DMA_CHUNK_SIZE)) break; @@ -158,7 +158,7 @@ iommu_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents, ** Allocate space for DMA stream. */ sg_dma_len(contig_sg) = dma_len; - dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE); + dma_len = ROUNDUP(dma_len + dma_offset, IOVP_SIZE); sg_dma_address(contig_sg) = PIDE_FLAG | (iommu_alloc_range(ioc, dma_len) << IOVP_SHIFT) diff --git a/trunk/drivers/parisc/pdc_stable.c b/trunk/drivers/parisc/pdc_stable.c index 924ef0609460..815e445c3125 100644 --- a/trunk/drivers/parisc/pdc_stable.c +++ b/trunk/drivers/parisc/pdc_stable.c @@ -1067,7 +1067,7 @@ pdc_stable_init(void) error = subsys_create_file(&stable_subsys, attr); /* register the paths subsys as a subsystem of stable subsys */ - kobj_set_kset_s(&paths_subsys, stable_subsys); + kset_set_kset_s(&paths_subsys, stable_subsys); if ((rc = subsystem_register(&paths_subsys))) goto fail_subsysreg; diff --git a/trunk/drivers/parisc/power.c b/trunk/drivers/parisc/power.c index 90cca5e3805f..6dedbdef7106 100644 --- a/trunk/drivers/parisc/power.c +++ b/trunk/drivers/parisc/power.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/parisc/sba_iommu.c b/trunk/drivers/parisc/sba_iommu.c index d044c48323e6..322957ac2ad1 100644 --- a/trunk/drivers/parisc/sba_iommu.c +++ b/trunk/drivers/parisc/sba_iommu.c @@ -113,6 +113,8 @@ module_param(sba_reserve_agpgart, int, 0444); MODULE_PARM_DESC(sba_reserve_agpgart, "Reserve half of IO pdir as AGPGART"); #endif +#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) + /************************************ ** SBA register read and write support @@ -350,7 +352,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted) ** SBA HW features in the unmap path. */ unsigned long o = 1 << get_order(bits_wanted << PAGE_SHIFT); - uint bitshiftcnt = ALIGN(ioc->res_bitshift, o); + uint bitshiftcnt = ROUNDUP(ioc->res_bitshift, o); unsigned long mask; if (bitshiftcnt >= BITS_PER_LONG) { @@ -777,7 +779,7 @@ sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, offset = iova & ~IOVP_MASK; iova ^= offset; /* clear offset bits */ size += offset; - size = ALIGN(size, IOVP_SIZE); + size = ROUNDUP(size, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); diff --git a/trunk/drivers/parisc/superio.c b/trunk/drivers/parisc/superio.c index a708c329675e..1fd97f7c8b98 100644 --- a/trunk/drivers/parisc/superio.c +++ b/trunk/drivers/parisc/superio.c @@ -389,7 +389,7 @@ int superio_fixup_irq(struct pci_dev *pcidev) return local_irq; } -static void __init superio_serial_init(void) +static void __devinit superio_serial_init(void) { #ifdef CONFIG_SERIAL_8250 int retval; @@ -423,7 +423,7 @@ static void __init superio_serial_init(void) } -static void __init superio_parport_init(void) +static void __devinit superio_parport_init(void) { #ifdef CONFIG_PARPORT_PC if (!parport_pc_probe_port(sio_dev.pp_base, @@ -450,7 +450,7 @@ static void superio_fixup_pci(struct pci_dev *pdev) DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, superio_fixup_pci); -static int __init +static int __devinit superio_probe(struct pci_dev *dev, const struct pci_device_id *id) { struct superio_device *sio = &sio_dev; @@ -485,7 +485,7 @@ superio_probe(struct pci_dev *dev, const struct pci_device_id *id) return -ENODEV; } -static const struct pci_device_id superio_tbl[] = { +static struct pci_device_id superio_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO) }, { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_USB) }, { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415) }, diff --git a/trunk/drivers/parport/parport_gsc.c b/trunk/drivers/parport/parport_gsc.c index 43652ba523eb..17bf9937d276 100644 --- a/trunk/drivers/parport/parport_gsc.c +++ b/trunk/drivers/parport/parport_gsc.c @@ -350,7 +350,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, #define PARPORT_GSC_OFFSET 0x800 -static int __devinitdata parport_count; +static int __initdata parport_count; static int __devinit parport_init_chip(struct parisc_device *dev) { diff --git a/trunk/drivers/scsi/esp_scsi.c b/trunk/drivers/scsi/esp_scsi.c index 71caf2ded6ba..ec71061aef61 100644 --- a/trunk/drivers/scsi/esp_scsi.c +++ b/trunk/drivers/scsi/esp_scsi.c @@ -2033,7 +2033,6 @@ static void esp_reset_cleanup(struct esp *esp) starget_for_each_device(tp->starget, NULL, esp_clear_hold); } - esp->flags &= ~ESP_FLAG_RESETTING; } /* Runs under host->lock */ diff --git a/trunk/drivers/scsi/ide-scsi.c b/trunk/drivers/scsi/ide-scsi.c index bb90df8bdce4..8263f752809d 100644 --- a/trunk/drivers/scsi/ide-scsi.c +++ b/trunk/drivers/scsi/ide-scsi.c @@ -463,7 +463,7 @@ static inline unsigned long get_timeout(idescsi_pc_t *pc) static int idescsi_expiry(ide_drive_t *drive) { - idescsi_scsi_t *scsi = drive_to_idescsi(drive); + idescsi_scsi_t *scsi = drive->driver_data; idescsi_pc_t *pc = scsi->pc; #if IDESCSI_DEBUG_LOG diff --git a/trunk/drivers/serial/bfin_5xx.c b/trunk/drivers/serial/bfin_5xx.c index 22569bd5d821..787dc7168f3e 100644 --- a/trunk/drivers/serial/bfin_5xx.c +++ b/trunk/drivers/serial/bfin_5xx.c @@ -185,7 +185,6 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) uart->port.icount.brk++; if (uart_handle_break(&uart->port)) goto ignore_char; - status &= ~(PE | FE); } if (status & PE) uart->port.icount.parity++; @@ -342,7 +341,6 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) uart->port.icount.brk++; if (uart_handle_break(&uart->port)) goto dma_ignore_char; - status &= ~(PE | FE); } if (status & PE) uart->port.icount.parity++; @@ -519,14 +517,6 @@ static void bfin_serial_mctrl_check(struct bfin_serial_port *uart) */ static void bfin_serial_break_ctl(struct uart_port *port, int break_state) { - struct bfin_serial_port *uart = (struct bfin_serial_port *)port; - u16 lcr = UART_GET_LCR(uart); - if (break_state) - lcr |= SB; - else - lcr &= ~SB; - UART_PUT_LCR(uart, lcr); - SSYNC(); } static int bfin_serial_startup(struct uart_port *port) @@ -635,12 +625,11 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, if (termios->c_cflag & CSTOPB) lcr |= STB; - if (termios->c_cflag & PARENB) + if (termios->c_cflag & PARENB) { lcr |= PEN; - if (!(termios->c_cflag & PARODD)) - lcr |= EPS; - if (termios->c_cflag & CMSPAR) - lcr |= STP; + if (!(termios->c_cflag & PARODD)) + lcr |= EPS; + } port->read_status_mask = OE; if (termios->c_iflag & INPCK) diff --git a/trunk/drivers/spi/spi_bfin5xx.c b/trunk/drivers/spi/spi_bfin5xx.c index 48587c27050d..7d2d9ec6cac3 100644 --- a/trunk/drivers/spi/spi_bfin5xx.c +++ b/trunk/drivers/spi/spi_bfin5xx.c @@ -582,19 +582,14 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id) dev_dbg(&drv_data->pdev->dev, "in dma_irq_handler\n"); clear_dma_irqstat(CH_SPI); - /* Wait for DMA to complete */ - while (get_dma_curr_irqstat(CH_SPI) & DMA_RUN) - continue; - /* - * wait for the last transaction shifted out. HRM states: - * at this point there may still be data in the SPI DMA FIFO waiting - * to be transmitted ... software needs to poll TXS in the SPI_STAT - * register until it goes low for 2 successive reads + * wait for the last transaction shifted out. yes, these two + * while loops are supposed to be the same (see the HRM). */ if (drv_data->tx != NULL) { - while ((bfin_read_SPI_STAT() & TXS) || - (bfin_read_SPI_STAT() & TXS)) + while (bfin_read_SPI_STAT() & TXS) + continue; + while (bfin_read_SPI_STAT() & TXS) continue; } @@ -1087,7 +1082,7 @@ static int setup(struct spi_device *spi) */ static void cleanup(struct spi_device *spi) { - struct chip_data *chip = spi_get_ctldata(spi); + struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi); kfree(chip); } diff --git a/trunk/drivers/video/console/sticore.c b/trunk/drivers/video/console/sticore.c index 870017d44970..717b360d0415 100644 --- a/trunk/drivers/video/console/sticore.c +++ b/trunk/drivers/video/console/sticore.c @@ -240,7 +240,7 @@ static void sti_flush(unsigned long from, unsigned long len) flush_icache_range(from, from+len); } -void __devinit +void __init sti_rom_copy(unsigned long base, unsigned long count, void *dest) { unsigned long dest_len = count; @@ -269,7 +269,7 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest) static char default_sti_path[21] __read_mostly; #ifndef MODULE -static int __devinit sti_setup(char *str) +static int __init sti_setup(char *str) { if (str) strlcpy (default_sti_path, str, sizeof (default_sti_path)); @@ -288,12 +288,12 @@ __setup("sti=", sti_setup); -static char __devinitdata *font_name[MAX_STI_ROMS] = { "VGA8x16", }; -static int __devinitdata font_index[MAX_STI_ROMS], - font_height[MAX_STI_ROMS], - font_width[MAX_STI_ROMS]; +static char __initdata *font_name[MAX_STI_ROMS] = { "VGA8x16", }; +static int __initdata font_index[MAX_STI_ROMS], + font_height[MAX_STI_ROMS], + font_width[MAX_STI_ROMS]; #ifndef MODULE -static int __devinit sti_font_setup(char *str) +static int __init sti_font_setup(char *str) { char *x; int i = 0; @@ -346,7 +346,7 @@ __setup("sti_font=", sti_font_setup); -static void __devinit +static void __init sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request) { struct sti_glob_cfg_ext *cfg; @@ -386,7 +386,7 @@ sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request) cfg->sti_mem_addr, sti_mem_request)); } -static void __devinit +static void __init sti_dump_outptr(struct sti_struct *sti) { DPRINTK((KERN_INFO @@ -400,7 +400,7 @@ sti_dump_outptr(struct sti_struct *sti) sti->outptr.attributes)); } -static int __devinit +static int __init sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address, unsigned long hpa) { @@ -482,7 +482,7 @@ sti_init_glob_cfg(struct sti_struct *sti, } #ifdef CONFIG_FB -struct sti_cooked_font * __devinit +struct sti_cooked_font * __init sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) { const struct font_desc *fbfont; @@ -538,14 +538,14 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) return cooked_font; } #else -struct sti_cooked_font * __devinit +struct sti_cooked_font * __init sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) { return NULL; } #endif -struct sti_cooked_font * __devinit +struct sti_cooked_font * __init sti_select_font(struct sti_cooked_rom *rom, int (*search_font_fnc) (struct sti_cooked_rom *,int,int) ) { @@ -572,7 +572,7 @@ sti_select_font(struct sti_cooked_rom *rom, } -static void __devinit +static void __init sti_dump_rom(struct sti_rom *rom) { printk(KERN_INFO " id %04x-%04x, conforms to spec rev. %d.%02x\n", @@ -590,7 +590,7 @@ sti_dump_rom(struct sti_rom *rom) } -static int __devinit +static int __init sti_cook_fonts(struct sti_cooked_rom *cooked_rom, struct sti_rom *raw_rom) { @@ -625,7 +625,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom, } -static int __devinit +static int __init sti_search_font(struct sti_cooked_rom *rom, int height, int width) { struct sti_cooked_font *font; @@ -642,7 +642,7 @@ sti_search_font(struct sti_cooked_rom *rom, int height, int width) #define BMODE_RELOCATE(offset) offset = (offset) / 4; #define BMODE_LAST_ADDR_OFFS 0x50 -static void * __devinit +static void * __init sti_bmode_font_raw(struct sti_cooked_font *f) { unsigned char *n, *p, *q; @@ -660,7 +660,7 @@ sti_bmode_font_raw(struct sti_cooked_font *f) return n + 3; } -static void __devinit +static void __init sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) { unsigned long dest_len = count; @@ -675,7 +675,7 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) sti_flush(dest_start, dest_len); } -static struct sti_rom * __devinit +static struct sti_rom * __init sti_get_bmode_rom (unsigned long address) { struct sti_rom *raw; @@ -711,7 +711,7 @@ sti_get_bmode_rom (unsigned long address) return raw; } -struct sti_rom * __devinit +struct sti_rom * __init sti_get_wmode_rom (unsigned long address) { struct sti_rom *raw; @@ -727,7 +727,7 @@ sti_get_wmode_rom (unsigned long address) return raw; } -int __devinit +int __init sti_read_rom(int wordmode, struct sti_struct *sti, unsigned long address) { struct sti_cooked_rom *cooked; @@ -783,7 +783,7 @@ sti_read_rom(int wordmode, struct sti_struct *sti, unsigned long address) return 0; } -static struct sti_struct * __devinit +static struct sti_struct * __init sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd) { struct sti_struct *sti; @@ -898,7 +898,7 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd return NULL; } -static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char *path) +static void __init sticore_check_for_default_sti(struct sti_struct *sti, char *path) { if (strcmp (path, default_sti_path) == 0) default_sti = sti; @@ -909,7 +909,7 @@ static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char * in the additional address field addr[1] while on * older Systems the PDC stores it in page0->proc_sti */ -static int __devinit sticore_pa_init(struct parisc_device *dev) +static int __init sticore_pa_init(struct parisc_device *dev) { char pa_path[21]; struct sti_struct *sti = NULL; @@ -1015,7 +1015,7 @@ static struct parisc_driver pa_sti_driver = { static int sticore_initialized __read_mostly; -static void __devinit sti_init_roms(void) +static void __init sti_init_roms(void) { if (sticore_initialized) return; diff --git a/trunk/fs/fuse/inode.c b/trunk/fs/fuse/inode.c index cc5efc13496a..9804c0cdcb42 100644 --- a/trunk/fs/fuse/inode.c +++ b/trunk/fs/fuse/inode.c @@ -655,9 +655,10 @@ static int fuse_get_sb_blk(struct file_system_type *fs_type, static struct file_system_type fuseblk_fs_type = { .owner = THIS_MODULE, .name = "fuseblk", + .fs_flags = FS_HAS_SUBTYPE, .get_sb = fuse_get_sb_blk, .kill_sb = kill_block_super, - .fs_flags = FS_REQUIRES_DEV | FS_HAS_SUBTYPE, + .fs_flags = FS_REQUIRES_DEV, }; static inline int register_fuseblk(void) diff --git a/trunk/fs/hugetlbfs/inode.c b/trunk/fs/hugetlbfs/inode.c index e6b46b3ac2fe..aa083dd34e92 100644 --- a/trunk/fs/hugetlbfs/inode.c +++ b/trunk/fs/hugetlbfs/inode.c @@ -736,13 +736,15 @@ static int can_do_hugetlb_shm(void) can_do_mlock()); } -struct file *hugetlb_file_setup(const char *name, size_t size) +struct file *hugetlb_zero_setup(size_t size) { int error = -ENOMEM; struct file *file; struct inode *inode; struct dentry *dentry, *root; struct qstr quick_string; + char buf[16]; + static atomic_t counter; if (!hugetlbfs_vfsmount) return ERR_PTR(-ENOENT); @@ -754,7 +756,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size) return ERR_PTR(-ENOMEM); root = hugetlbfs_vfsmount->mnt_root; - quick_string.name = name; + snprintf(buf, 16, "%u", atomic_inc_return(&counter)); + quick_string.name = buf; quick_string.len = strlen(quick_string.name); quick_string.hash = 0; dentry = d_alloc(root, &quick_string); diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index e7d7080de2f9..cb211360273a 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -176,7 +176,6 @@ static const struct pipe_buf_operations user_page_pipe_buf_ops = { static ssize_t splice_to_pipe(struct pipe_inode_info *pipe, struct splice_pipe_desc *spd) { - unsigned int spd_pages = spd->nr_pages; int ret, do_wakeup, page_nr; ret = 0; @@ -245,18 +244,17 @@ static ssize_t splice_to_pipe(struct pipe_inode_info *pipe, pipe->waiting_writers--; } - if (pipe->inode) { + if (pipe->inode) mutex_unlock(&pipe->inode->i_mutex); - if (do_wakeup) { - smp_mb(); - if (waitqueue_active(&pipe->wait)) - wake_up_interruptible(&pipe->wait); - kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); - } + if (do_wakeup) { + smp_mb(); + if (waitqueue_active(&pipe->wait)) + wake_up_interruptible(&pipe->wait); + kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); } - while (page_nr < spd_pages) + while (page_nr < spd->nr_pages) page_cache_release(spd->pages[page_nr++]); return ret; @@ -813,10 +811,7 @@ generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out, ret = __splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); if (ret > 0) { - unsigned long nr_pages; - *ppos += ret; - nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; /* * If file or inode is SYNC and we actually wrote some data, @@ -829,7 +824,7 @@ generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out, if (err) ret = err; } - balance_dirty_pages_ratelimited_nr(mapping, nr_pages); + balance_dirty_pages_ratelimited(mapping); } return ret; @@ -868,10 +863,7 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); if (ret > 0) { - unsigned long nr_pages; - *ppos += ret; - nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; /* * If file or inode is SYNC and we actually wrote some data, @@ -886,7 +878,7 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, if (err) ret = err; } - balance_dirty_pages_ratelimited_nr(mapping, nr_pages); + balance_dirty_pages_ratelimited(mapping); } return ret; diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c index c4342a019972..85a668680f82 100644 --- a/trunk/fs/sysfs/dir.c +++ b/trunk/fs/sysfs/dir.c @@ -13,26 +13,14 @@ #include "sysfs.h" DECLARE_RWSEM(sysfs_rename_sem); -spinlock_t sysfs_lock = SPIN_LOCK_UNLOCKED; static void sysfs_d_iput(struct dentry * dentry, struct inode * inode) { struct sysfs_dirent * sd = dentry->d_fsdata; if (sd) { - /* sd->s_dentry is protected with sysfs_lock. This - * allows sysfs_drop_dentry() to dereference it. - */ - spin_lock(&sysfs_lock); - - /* The dentry might have been deleted or another - * lookup could have happened updating sd->s_dentry to - * point the new dentry. Ignore if it isn't pointing - * to this dentry. - */ - if (sd->s_dentry == dentry) - sd->s_dentry = NULL; - spin_unlock(&sysfs_lock); + BUG_ON(sd->s_dentry != dentry); + sd->s_dentry = NULL; sysfs_put(sd); } iput(inode); @@ -42,14 +30,6 @@ static struct dentry_operations sysfs_dentry_ops = { .d_iput = sysfs_d_iput, }; -static unsigned int sysfs_inode_counter; -ino_t sysfs_get_inum(void) -{ - if (unlikely(sysfs_inode_counter < 3)) - sysfs_inode_counter = 3; - return sysfs_inode_counter++; -} - /* * Allocates a new sysfs_dirent and links it to the parent sysfs_dirent */ @@ -61,7 +41,6 @@ static struct sysfs_dirent * __sysfs_new_dirent(void * element) if (!sd) return NULL; - sd->s_ino = sysfs_get_inum(); atomic_set(&sd->s_count, 1); atomic_set(&sd->s_event, 1); INIT_LIST_HEAD(&sd->s_children); @@ -259,10 +238,7 @@ static int sysfs_attach_attr(struct sysfs_dirent * sd, struct dentry * dentry) } dentry->d_fsdata = sysfs_get(sd); - /* protect sd->s_dentry against sysfs_d_iput */ - spin_lock(&sysfs_lock); sd->s_dentry = dentry; - spin_unlock(&sysfs_lock); error = sysfs_create(dentry, (attr->mode & S_IALLUGO) | S_IFREG, init); if (error) { sysfs_put(sd); @@ -284,10 +260,7 @@ static int sysfs_attach_link(struct sysfs_dirent * sd, struct dentry * dentry) int err = 0; dentry->d_fsdata = sysfs_get(sd); - /* protect sd->s_dentry against sysfs_d_iput */ - spin_lock(&sysfs_lock); sd->s_dentry = dentry; - spin_unlock(&sysfs_lock); err = sysfs_create(dentry, S_IFLNK|S_IRWXUGO, init_symlink); if (!err) { dentry->d_op = &sysfs_dentry_ops; @@ -536,7 +509,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) switch (i) { case 0: - ino = parent_sd->s_ino; + ino = dentry->d_inode->i_ino; if (filldir(dirent, ".", 1, i, ino, DT_DIR) < 0) break; filp->f_pos++; @@ -565,7 +538,10 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) name = sysfs_get_name(next); len = strlen(name); - ino = next->s_ino; + if (next->s_dentry) + ino = next->s_dentry->d_inode->i_ino; + else + ino = iunique(sysfs_sb, 2); if (filldir(dirent, name, len, filp->f_pos, ino, dt_type(next)) < 0) diff --git a/trunk/fs/sysfs/inode.c b/trunk/fs/sysfs/inode.c index 5266eec15f6e..bdd30e74de6b 100644 --- a/trunk/fs/sysfs/inode.c +++ b/trunk/fs/sysfs/inode.c @@ -141,7 +141,6 @@ struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd) inode->i_mapping->a_ops = &sysfs_aops; inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info; inode->i_op = &sysfs_inode_operations; - inode->i_ino = sd->s_ino; lockdep_set_class(&inode->i_mutex, &sysfs_inode_imutex_key); if (sd->s_iattr) { @@ -246,27 +245,13 @@ static inline void orphan_all_buffers(struct inode *node) */ void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent) { - struct dentry *dentry = NULL; + struct dentry * dentry = sd->s_dentry; struct inode *inode; - /* We're not holding a reference to ->s_dentry dentry but the - * field will stay valid as long as sysfs_lock is held. - */ - spin_lock(&sysfs_lock); - spin_lock(&dcache_lock); - - /* dget dentry if it's still alive */ - if (sd->s_dentry && sd->s_dentry->d_inode) - dentry = dget_locked(sd->s_dentry); - - spin_unlock(&dcache_lock); - spin_unlock(&sysfs_lock); - - /* drop dentry */ if (dentry) { spin_lock(&dcache_lock); spin_lock(&dentry->d_lock); - if (!d_unhashed(dentry) && dentry->d_inode) { + if (!(d_unhashed(dentry) && dentry->d_inode)) { inode = dentry->d_inode; spin_lock(&inode->i_lock); __iget(inode); @@ -282,8 +267,6 @@ void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent) spin_unlock(&dentry->d_lock); spin_unlock(&dcache_lock); } - - dput(dentry); } } diff --git a/trunk/fs/sysfs/mount.c b/trunk/fs/sysfs/mount.c index 00ab9125d398..23a48a38e6af 100644 --- a/trunk/fs/sysfs/mount.c +++ b/trunk/fs/sysfs/mount.c @@ -33,7 +33,6 @@ static struct sysfs_dirent sysfs_root = { .s_element = NULL, .s_type = SYSFS_ROOT, .s_iattr = NULL, - .s_ino = 1, }; static void sysfs_clear_inode(struct inode *inode) diff --git a/trunk/fs/sysfs/sysfs.h b/trunk/fs/sysfs/sysfs.h index 502c949c402d..a77c57e5a6d5 100644 --- a/trunk/fs/sysfs/sysfs.h +++ b/trunk/fs/sysfs/sysfs.h @@ -5,7 +5,6 @@ struct sysfs_dirent { void * s_element; int s_type; umode_t s_mode; - ino_t s_ino; struct dentry * s_dentry; struct iattr * s_iattr; atomic_t s_event; @@ -33,7 +32,6 @@ extern const unsigned char * sysfs_get_name(struct sysfs_dirent *sd); extern void sysfs_drop_dentry(struct sysfs_dirent *sd, struct dentry *parent); extern int sysfs_setattr(struct dentry *dentry, struct iattr *iattr); -extern spinlock_t sysfs_lock; extern struct rw_semaphore sysfs_rename_sem; extern struct super_block * sysfs_sb; extern const struct file_operations sysfs_dir_operations; diff --git a/trunk/fs/udf/inode.c b/trunk/fs/udf/inode.c index bf7de0bdbab3..1f0129405cf4 100644 --- a/trunk/fs/udf/inode.c +++ b/trunk/fs/udf/inode.c @@ -100,23 +100,14 @@ void udf_delete_inode(struct inode * inode) clear_inode(inode); } -/* - * If we are going to release inode from memory, we discard preallocation and - * truncate last inode extent to proper length. We could use drop_inode() but - * it's called under inode_lock and thus we cannot mark inode dirty there. We - * use clear_inode() but we have to make sure to write inode as it's not written - * automatically. - */ void udf_clear_inode(struct inode *inode) { if (!(inode->i_sb->s_flags & MS_RDONLY)) { lock_kernel(); - /* Discard preallocation for directories, symlinks, etc. */ udf_discard_prealloc(inode); - udf_truncate_tail_extent(inode); unlock_kernel(); - write_inode_now(inode, 1); } + kfree(UDF_I_DATA(inode)); UDF_I_DATA(inode) = NULL; } diff --git a/trunk/fs/udf/truncate.c b/trunk/fs/udf/truncate.c index 60d277644248..77975ae291a5 100644 --- a/trunk/fs/udf/truncate.c +++ b/trunk/fs/udf/truncate.c @@ -61,11 +61,7 @@ static void extent_trunc(struct inode * inode, struct extent_position *epos, } } -/* - * Truncate the last extent to match i_size. This function assumes - * that preallocation extent is already truncated. - */ -void udf_truncate_tail_extent(struct inode *inode) +void udf_discard_prealloc(struct inode * inode) { struct extent_position epos = { NULL, 0, {0, 0}}; kernel_lb_addr eloc; @@ -75,10 +71,7 @@ void udf_truncate_tail_extent(struct inode *inode) int adsize; if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB || - inode->i_size == UDF_I_LENEXTENTS(inode)) - return; - /* Are we going to delete the file anyway? */ - if (inode->i_nlink == 0) + inode->i_size == UDF_I_LENEXTENTS(inode)) return; if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) @@ -86,76 +79,36 @@ void udf_truncate_tail_extent(struct inode *inode) else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) adsize = sizeof(long_ad); else - BUG(); + adsize = 0; + + epos.block = UDF_I_LOCATION(inode); /* Find the last extent in the file */ while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 1)) != -1) { etype = netype; lbcount += elen; - if (lbcount > inode->i_size) { - if (lbcount - inode->i_size >= inode->i_sb->s_blocksize) - printk(KERN_WARNING - "udf_truncate_tail_extent(): Too long " - "extent after EOF in inode %u: i_size: " - "%Ld lbcount: %Ld extent %u+%u\n", - (unsigned)inode->i_ino, - (long long)inode->i_size, - (long long)lbcount, - (unsigned)eloc.logicalBlockNum, - (unsigned)elen); + if (lbcount > inode->i_size && lbcount - elen < inode->i_size) + { + WARN_ON(lbcount - inode->i_size >= inode->i_sb->s_blocksize); nelen = elen - (lbcount - inode->i_size); epos.offset -= adsize; extent_trunc(inode, &epos, eloc, etype, elen, nelen); epos.offset += adsize; - if (udf_next_aext(inode, &epos, &eloc, &elen, 1) != -1) - printk(KERN_ERR "udf_truncate_tail_extent(): " - "Extent after EOF in inode %u.\n", - (unsigned)inode->i_ino); - break; + lbcount = inode->i_size; } } - /* This inode entry is in-memory only and thus we don't have to mark - * the inode dirty */ - UDF_I_LENEXTENTS(inode) = inode->i_size; - brelse(epos.bh); -} - -void udf_discard_prealloc(struct inode *inode) -{ - struct extent_position epos = { NULL, 0, {0, 0}}; - kernel_lb_addr eloc; - uint32_t elen; - uint64_t lbcount = 0; - int8_t etype = -1, netype; - int adsize; - - if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB || - inode->i_size == UDF_I_LENEXTENTS(inode)) - return; - - if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) - adsize = sizeof(short_ad); - else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) - adsize = sizeof(long_ad); - else - adsize = 0; - - epos.block = UDF_I_LOCATION(inode); - - /* Find the last extent in the file */ - while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 1)) != -1) { - etype = netype; - lbcount += elen; - } if (etype == (EXT_NOT_RECORDED_ALLOCATED >> 30)) { epos.offset -= adsize; lbcount -= elen; extent_trunc(inode, &epos, eloc, etype, elen, 0); - if (!epos.bh) { + if (!epos.bh) + { UDF_I_LENALLOC(inode) = epos.offset - udf_file_entry_alloc_offset(inode); mark_inode_dirty(inode); - } else { + } + else + { struct allocExtDesc *aed = (struct allocExtDesc *)(epos.bh->b_data); aed->lengthAllocDescs = cpu_to_le32(epos.offset - sizeof(struct allocExtDesc)); if (!UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_STRICT) || UDF_SB_UDFREV(inode->i_sb) >= 0x0201) @@ -165,9 +118,9 @@ void udf_discard_prealloc(struct inode *inode) mark_buffer_dirty_inode(epos.bh, inode); } } - /* This inode entry is in-memory only and thus we don't have to mark - * the inode dirty */ UDF_I_LENEXTENTS(inode) = lbcount; + + WARN_ON(lbcount != inode->i_size); brelse(epos.bh); } diff --git a/trunk/fs/udf/udfdecl.h b/trunk/fs/udf/udfdecl.h index f581f2f69c0f..67ded289497c 100644 --- a/trunk/fs/udf/udfdecl.h +++ b/trunk/fs/udf/udfdecl.h @@ -146,7 +146,6 @@ extern void udf_free_inode(struct inode *); extern struct inode * udf_new_inode (struct inode *, int, int *); /* truncate.c */ -extern void udf_truncate_tail_extent(struct inode *); extern void udf_discard_prealloc(struct inode *); extern void udf_truncate_extents(struct inode *); diff --git a/trunk/include/asm-arm/arch-s3c2410/anubis-cpld.h b/trunk/include/asm-arm/arch-s3c2410/anubis-cpld.h index 168b93fee529..dcebf6d61903 100644 --- a/trunk/include/asm-arm/arch-s3c2410/anubis-cpld.h +++ b/trunk/include/asm-arm/arch-s3c2410/anubis-cpld.h @@ -18,8 +18,4 @@ #define ANUBIS_CTRL1_NANDSEL (0x3) -/* IDREG - revision */ - -#define ANUBIS_IDREG_REVMASK (0x7) - #endif /* __ASM_ARCH_ANUBISCPLD_H */ diff --git a/trunk/include/asm-arm/arch-s3c2410/anubis-map.h b/trunk/include/asm-arm/arch-s3c2410/anubis-map.h index 830d114261da..ab076de4a0d0 100644 --- a/trunk/include/asm-arm/arch-s3c2410/anubis-map.h +++ b/trunk/include/asm-arm/arch-s3c2410/anubis-map.h @@ -27,8 +27,14 @@ #define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01800000 */ #define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD) -#define ANUBIS_VA_IDREG ANUBIS_IOADDR(0x00300000) /* 0x01B00000 */ -#define ANUBIS_PA_IDREG (ANUBIS_PA_CPLD + (3<<23)) +#define ANUBIS_VA_CTRL2 ANUBIS_IOADDR(0x00100000) /* 0x01900000 */ +#define ANUBIS_PA_CTRL2 (ANUBIS_PA_CPLD) + +#define ANUBIS_VA_CTRL3 ANUBIS_IOADDR(0x00200000) /* 0x01A00000 */ +#define ANUBIS_PA_CTRL3 (ANUBIS_PA_CPLD) + +#define ANUBIS_VA_CTRL4 ANUBIS_IOADDR(0x00300000) /* 0x01B00000 */ +#define ANUBIS_PA_CTRL4 (ANUBIS_PA_CPLD) #define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000) #define ANUBIS_IDEPRIAUX ANUBIS_IOADDR(0x01100000) diff --git a/trunk/include/asm-arm/arch-s3c2410/osiris-cpld.h b/trunk/include/asm-arm/arch-s3c2410/osiris-cpld.h index 229ab2351db6..3b6498468d62 100644 --- a/trunk/include/asm-arm/arch-s3c2410/osiris-cpld.h +++ b/trunk/include/asm-arm/arch-s3c2410/osiris-cpld.h @@ -1,6 +1,6 @@ /* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h * - * Copyright 2005 Simtec Electronics + * Copyright (c) 2005 Simtec Electronics * http://www.simtec.co.uk/products/ * Ben Dooks * @@ -14,17 +14,12 @@ #ifndef __ASM_ARCH_OSIRISCPLD_H #define __ASM_ARCH_OSIRISCPLD_H -/* CTRL0 - NAND WP control */ +/* CTRL1 - NAND WP control */ -#define OSIRIS_CTRL0_NANDSEL (0x3) -#define OSIRIS_CTRL0_BOOT_INT (1<<3) -#define OSIRIS_CTRL0_PCMCIA (1<<4) -#define OSIRIS_CTRL0_FIX8 (1<<5) -#define OSIRIS_CTRL0_PCMCIA_nWAIT (1<<6) -#define OSIRIS_CTRL0_PCMCIA_nIOIS16 (1<<7) - -#define OSIRIS_CTRL1_FIX8 (1<<0) - -#define OSIRIS_ID_REVMASK (0x7) +#define OSIRIS_CTRL1_NANDSEL (0x3) +#define OSIRIS_CTRL1_BOOT_INT (1<<3) +#define OSIRIS_CTRL1_PCMCIA (1<<4) +#define OSIRIS_CTRL1_PCMCIA_nWAIT (1<<6) +#define OSIRIS_CTRL1_PCMCIA_nIOIS16 (1<<7) #endif /* __ASM_ARCH_OSIRISCPLD_H */ diff --git a/trunk/include/asm-arm/arch-s3c2410/osiris-map.h b/trunk/include/asm-arm/arch-s3c2410/osiris-map.h index b5c74d2b9aaa..a14164dfa525 100644 --- a/trunk/include/asm-arm/arch-s3c2410/osiris-map.h +++ b/trunk/include/asm-arm/arch-s3c2410/osiris-map.h @@ -24,19 +24,16 @@ /* we put the CPLD registers next, to get them out of the way */ -#define OSIRIS_VA_CTRL0 OSIRIS_IOADDR(0x00000000) -#define OSIRIS_PA_CTRL0 (OSIRIS_PA_CPLD) +#define OSIRIS_VA_CTRL1 OSIRIS_IOADDR(0x00000000) +#define OSIRIS_PA_CTRL1 (OSIRIS_PA_CPLD) -#define OSIRIS_VA_CTRL1 OSIRIS_IOADDR(0x00100000) -#define OSIRIS_PA_CTRL1 (OSIRIS_PA_CPLD + (1<<23)) +#define OSIRIS_VA_CTRL2 OSIRIS_IOADDR(0x00100000) +#define OSIRIS_PA_CTRL2 (OSIRIS_PA_CPLD + (1<<23)) -#define OSIRIS_VA_CTRL2 OSIRIS_IOADDR(0x00200000) -#define OSIRIS_PA_CTRL2 (OSIRIS_PA_CPLD + (2<<23)) +#define OSIRIS_VA_CTRL3 OSIRIS_IOADDR(0x00200000) +#define OSIRIS_PA_CTRL3 (OSIRIS_PA_CPLD + (2<<23)) -#define OSIRIS_VA_CTRL3 OSIRIS_IOADDR(0x00300000) -#define OSIRIS_PA_CTRL3 (OSIRIS_PA_CPLD + (2<<23)) - -#define OSIRIS_VA_IDREG OSIRIS_IOADDR(0x00700000) -#define OSIRIS_PA_IDREG (OSIRIS_PA_CPLD + (7<<23)) +#define OSIRIS_VA_CTRL4 OSIRIS_IOADDR(0x00300000) +#define OSIRIS_PA_CTRL4 (OSIRIS_PA_CPLD + (3<<23)) #endif /* __ASM_ARCH_OSIRISMAP_H */ diff --git a/trunk/include/asm-arm/linkage.h b/trunk/include/asm-arm/linkage.h index 5a25632b1bc0..dbe4b4e31a5b 100644 --- a/trunk/include/asm-arm/linkage.h +++ b/trunk/include/asm-arm/linkage.h @@ -4,8 +4,4 @@ #define __ALIGN .align 0 #define __ALIGN_STR ".align 0" -#define ENDPROC(name) \ - .type name, %function; \ - END(name) - #endif diff --git a/trunk/include/asm-avr32/arch-at32ap/gpio.h b/trunk/include/asm-avr32/arch-at32ap/gpio.h index af7f9535bab3..80a21aa9ae77 100644 --- a/trunk/include/asm-avr32/arch-at32ap/gpio.h +++ b/trunk/include/asm-avr32/arch-at32ap/gpio.h @@ -14,8 +14,6 @@ int gpio_direction_output(unsigned int gpio, int value); int gpio_get_value(unsigned int gpio); void gpio_set_value(unsigned int gpio, int value); -#include /* cansleep wrappers */ - static inline int gpio_to_irq(unsigned int gpio) { return gpio + GPIO_IRQ_BASE; diff --git a/trunk/include/asm-avr32/cache.h b/trunk/include/asm-avr32/cache.h index d3cf35ab11ab..dabb955f3c00 100644 --- a/trunk/include/asm-avr32/cache.h +++ b/trunk/include/asm-avr32/cache.h @@ -4,15 +4,6 @@ #define L1_CACHE_SHIFT 5 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) -/* - * Memory returned by kmalloc() may be used for DMA, so we must make - * sure that all such allocations are cache aligned. Otherwise, - * unrelated code may cause parts of the buffer to be read into the - * cache before the transfer is done, causing old data to be seen by - * the CPU. - */ -#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES - #ifndef __ASSEMBLER__ struct cache_info { unsigned int ways; diff --git a/trunk/include/asm-blackfin/blackfin.h b/trunk/include/asm-blackfin/blackfin.h index db3b615ffbab..14e58de73973 100644 --- a/trunk/include/asm-blackfin/blackfin.h +++ b/trunk/include/asm-blackfin/blackfin.h @@ -6,11 +6,7 @@ #ifndef _BLACKFIN_H_ #define _BLACKFIN_H_ -#define LO(con32) ((con32) & 0xFFFF) -#define lo(con32) ((con32) & 0xFFFF) -#define HI(con32) (((con32) >> 16) & 0xFFFF) -#define hi(con32) (((con32) >> 16) & 0xFFFF) - +#include #include #include diff --git a/trunk/include/asm-blackfin/gpio.h b/trunk/include/asm-blackfin/gpio.h index d98d77ad71f7..aa0d5503e232 100644 --- a/trunk/include/asm-blackfin/gpio.h +++ b/trunk/include/asm-blackfin/gpio.h @@ -332,7 +332,6 @@ struct gpio_port_s { unsigned short inen; unsigned short fer; - unsigned short reserved; }; #endif /*CONFIG_PM*/ diff --git a/trunk/include/asm-blackfin/mach-common/def_LPBlackfin.h b/trunk/include/asm-blackfin/mach-common/def_LPBlackfin.h index be1ece8c0c27..76103526aec1 100644 --- a/trunk/include/asm-blackfin/mach-common/def_LPBlackfin.h +++ b/trunk/include/asm-blackfin/mach-common/def_LPBlackfin.h @@ -42,12 +42,6 @@ #if defined(ANOMALY_05000198) -#define bfin_read8(addr) ({ unsigned char __v; \ - __asm__ __volatile__ ("NOP;\n\t" \ - "%0 = b[%1] (z);\n\t" \ - : "=d"(__v) : "a"(addr)); \ - __v; }) - #define bfin_read16(addr) ({ unsigned __v; \ __asm__ __volatile__ ("NOP;\n\t"\ "%0 = w[%1] (z);\n\t"\ @@ -58,11 +52,6 @@ "%0 = [%1];\n\t"\ : "=d"(__v) : "a"(addr)); __v; }) -#define bfin_write8(addr, val) ({ \ - __asm__ __volatile__ ("NOP;\n\t" \ - "b[%0] = %1;\n\t" \ - : : "a"(addr), "d"(val) : "memory");}) - #define bfin_write16(addr,val) ({\ __asm__ __volatile__ ("NOP;\n\t"\ "w[%0] = %1;\n\t"\ @@ -75,12 +64,6 @@ #else -#define bfin_read8(addr) ({ unsigned char __v; \ - __asm__ __volatile__ ( \ - "%0 = b[%1] (z);\n\t" \ - :"=d"(__v) : "a"(addr)); \ - __v; }) - #define bfin_read16(addr) ({ unsigned __v; \ __asm__ __volatile__ (\ "%0 = w[%1] (z);\n\t"\ @@ -91,11 +74,6 @@ "%0 = [%1];\n\t"\ : "=d"(__v) : "a"(addr)); __v; }) -#define bfin_write8(addr, val) ({ \ - __asm__ __volatile__ ( \ - "b[%0] = %1; \n\t" \ - ::"a"(addr), "d"(val) : "memory");}) - #define bfin_write16(addr,val) ({\ __asm__ __volatile__ (\ "w[%0] = %1;\n\t"\ diff --git a/trunk/include/asm-blackfin/macros.h b/trunk/include/asm-blackfin/macros.h index e69de29bb2d1..c0c04a2f2dd5 100644 --- a/trunk/include/asm-blackfin/macros.h +++ b/trunk/include/asm-blackfin/macros.h @@ -0,0 +1,95 @@ +/************************************************************************ + * + * macros.h + * + * (c) Copyright 2001-2003 Analog Devices, Inc. All rights reserved. + * + ************************************************************************/ + +/* Defines various assembly macros. */ + +#ifndef _MACROS_H +#define _MACROS_H + +#define LO(con32) ((con32) & 0xFFFF) +#define lo(con32) ((con32) & 0xFFFF) +#define HI(con32) (((con32) >> 16) & 0xFFFF) +#define hi(con32) (((con32) >> 16) & 0xFFFF) + +/* + * Set the corresponding bits in a System Register (SR); + * All bits set in "mask" will be set in the system register + * specified by "sys_reg" bitset_SR(sys_reg, mask), where + * sys_reg is the system register and mask are the bits to be set. + */ +#define bitset_SR(sys_reg, mask)\ + [--SP] = (R7:6);\ + r7 = sys_reg;\ + r6.l = (mask) & 0xffff;\ + r6.h = (mask) >> 16;\ + r7 = r7 | r6;\ + sys_reg = r7;\ + csync;\ + (R7:6) = [SP++] + +/* + * Clear the corresponding bits in a System Register (SR); + * All bits set in "mask" will be cleared in the SR + * specified by "sys_reg" bitclr_SR(sys_reg, mask), where + * sys_reg is the SR and mask are the bits to be cleared. + */ +#define bitclr_SR(sys_reg, mask)\ + [--SP] = (R7:6);\ + r7 = sys_reg;\ + r7 =~ r7;\ + r6.l = (mask) & 0xffff;\ + r6.h = (mask) >> 16;\ + r7 = r7 | r6;\ + r7 =~ r7;\ + sys_reg = r7;\ + csync;\ + (R7:6) = [SP++] + +/* + * Set the corresponding bits in a Memory Mapped Register (MMR); + * All bits set in "mask" will be set in the MMR specified by "mmr_reg" + * bitset_MMR(mmr_reg, mask), where mmr_reg is the MMR and mask are + * the bits to be set. + */ +#define bitset_MMR(mmr_reg, mask)\ + [--SP] = (R7:6);\ + [--SP] = P5;\ + p5.l = mmr_reg & 0xffff;\ + p5.h = mmr_reg >> 16;\ + r7 = [p5];\ + r6.l = (mask) & 0xffff;\ + r6.h = (mask) >> 16;\ + r7 = r7 | r6;\ + [p5] = r7;\ + csync;\ + p5 = [SP++];\ + (R7:6) = [SP++] + +/* + * Clear the corresponding bits in a Memory Mapped Register (MMR); + * All bits set in "mask" will be cleared in the MMR specified by "mmr_reg" + * bitclr_MMRreg(mmr_reg, mask), where sys_reg is the MMR and mask are + * the bits to be cleared. + */ +#define bitclr_MMR(mmr_reg, mask)\ + [--SP] = (R7:6);\ + [--SP] = P5;\ + p5.l = mmr_reg & 0xffff;\ + p5.h = mmr_reg >> 16;\ + r7 = [p5];\ + r7 =~ r7;\ + r6.l = (mask) & 0xffff;\ + r6.h = (mask) >> 16;\ + r7 = r7 | r6;\ + r7 =~ r7;\ + [p5] = r7;\ + csync;\ + p5 = [SP++];\ + (R7:6) = [SP++] + +#endif /* _MACROS_H */ diff --git a/trunk/include/asm-generic/pgtable.h b/trunk/include/asm-generic/pgtable.h index 7d7bcf990e99..dc8f99ee305f 100644 --- a/trunk/include/asm-generic/pgtable.h +++ b/trunk/include/asm-generic/pgtable.h @@ -27,20 +27,13 @@ do { \ * Largely same as above, but only sets the access flags (dirty, * accessed, and writable). Furthermore, we know it always gets set * to a "more permissive" setting, which allows most architectures - * to optimize this. We return whether the PTE actually changed, which - * in turn instructs the caller to do things like update__mmu_cache. - * This used to be done in the caller, but sparc needs minor faults to - * force that call on sun4c so we changed this macro slightly + * to optimize this. */ #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed) { \ - set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ - flush_tlb_page(__vma, __address); \ - } \ - __changed; \ -}) +do { \ + set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ + flush_tlb_page(__vma, __address); \ +} while (0) #endif #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG diff --git a/trunk/include/asm-i386/pgtable.h b/trunk/include/asm-i386/pgtable.h index 628fa7747d0c..2394589786ba 100644 --- a/trunk/include/asm-i386/pgtable.h +++ b/trunk/include/asm-i386/pgtable.h @@ -285,36 +285,32 @@ static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep) */ #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS #define ptep_set_access_flags(vma, address, ptep, entry, dirty) \ -({ \ - int __changed = !pte_same(*(ptep), entry); \ - if (__changed && dirty) { \ +do { \ + if (dirty) { \ (ptep)->pte_low = (entry).pte_low; \ pte_update_defer((vma)->vm_mm, (address), (ptep)); \ flush_tlb_page(vma, address); \ } \ - __changed; \ -}) +} while (0) #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY #define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \ - int __ret = 0; \ - if (pte_dirty(*(ptep))) \ - __ret = test_and_clear_bit(_PAGE_BIT_DIRTY, \ - &(ptep)->pte_low); \ - if (__ret) \ - pte_update((vma)->vm_mm, addr, ptep); \ - __ret; \ + int ret = 0; \ + if (pte_dirty(*ptep)) \ + ret = test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); \ + if (ret) \ + pte_update_defer(vma->vm_mm, addr, ptep); \ + ret; \ }) #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define ptep_test_and_clear_young(vma, addr, ptep) ({ \ - int __ret = 0; \ - if (pte_young(*(ptep))) \ - __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, \ - &(ptep)->pte_low); \ - if (__ret) \ - pte_update((vma)->vm_mm, addr, ptep); \ - __ret; \ + int ret = 0; \ + if (pte_young(*ptep)) \ + ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); \ + if (ret) \ + pte_update_defer(vma->vm_mm, addr, ptep); \ + ret; \ }) /* diff --git a/trunk/include/asm-ia64/pgtable.h b/trunk/include/asm-ia64/pgtable.h index 6580f31b3135..670b706411b8 100644 --- a/trunk/include/asm-ia64/pgtable.h +++ b/trunk/include/asm-ia64/pgtable.h @@ -533,23 +533,16 @@ extern void lazy_mmu_prot_update (pte_t pte); * daccess_bit in ivt.S). */ #ifdef CONFIG_SMP -# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed && __safely_writable) { \ - set_pte(__ptep, __entry); \ - flush_tlb_page(__vma, __addr); \ - } \ - __changed; \ -}) +# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \ +do { \ + if (__safely_writable) { \ + set_pte(__ptep, __entry); \ + flush_tlb_page(__vma, __addr); \ + } \ +} while (0) #else -# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed) \ - ptep_establish(__vma, __addr, __ptep, __entry); \ - __changed; \ -}) +# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \ + ptep_establish(__vma, __addr, __ptep, __entry) #endif # ifdef CONFIG_VIRTUAL_MEM_MAP diff --git a/trunk/include/asm-mips/mips-boards/generic.h b/trunk/include/asm-mips/mips-boards/generic.h index c8ebcc3e1267..b98f1658cfd0 100644 --- a/trunk/include/asm-mips/mips-boards/generic.h +++ b/trunk/include/asm-mips/mips-boards/generic.h @@ -73,28 +73,12 @@ * CoreEMUL with Bonito System Controller is treated like a Core20K * CoreEMUL with SOC-it 101 System Controller is treated like a CoreMSC */ -#define MIPS_REVISION_CORID_CORE_EMUL_BON -1 -#define MIPS_REVISION_CORID_CORE_EMUL_MSC -2 +#define MIPS_REVISION_CORID_CORE_EMUL_BON 0x63 +#define MIPS_REVISION_CORID_CORE_EMUL_MSC 0x65 #define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f) -extern int mips_revision_corid; - -#define MIPS_REVISION_SCON_OTHER 0 -#define MIPS_REVISION_SCON_SOCITSC 1 -#define MIPS_REVISION_SCON_SOCITSCP 2 - -/* Artificial SCON defines for MIPS_REVISION_SCON_OTHER */ -#define MIPS_REVISION_SCON_UNKNOWN -1 -#define MIPS_REVISION_SCON_GT64120 -2 -#define MIPS_REVISION_SCON_BONITO -3 -#define MIPS_REVISION_SCON_BRTL -4 -#define MIPS_REVISION_SCON_SOCIT -5 -#define MIPS_REVISION_SCON_ROCIT -6 - -#define MIPS_REVISION_SCONID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 24) & 0xff) - -extern int mips_revision_sconid; +extern unsigned int mips_revision_corid; #ifdef CONFIG_PCI extern void mips_pcibios_init(void); diff --git a/trunk/include/asm-mips/mips-boards/msc01_pci.h b/trunk/include/asm-mips/mips-boards/msc01_pci.h index e036b7dd6deb..8eaefb837b9d 100644 --- a/trunk/include/asm-mips/mips-boards/msc01_pci.h +++ b/trunk/include/asm-mips/mips-boards/msc01_pci.h @@ -208,7 +208,6 @@ * latter, they should be moved elsewhere. */ #define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 -#define MIPS_SOCITSC_PCI_REG_BASE 0x1ff10000 extern unsigned long _pcictrl_msc; diff --git a/trunk/include/asm-parisc/hardware.h b/trunk/include/asm-parisc/hardware.h index 4e9626836bab..76d880dc4bae 100644 --- a/trunk/include/asm-parisc/hardware.h +++ b/trunk/include/asm-parisc/hardware.h @@ -31,11 +31,10 @@ enum cpu_type { pcxw = 8, /* pa8500 pa 2.0 */ pcxw_ = 9, /* pa8600 (w+) pa 2.0 */ pcxw2 = 10, /* pa8700 pa 2.0 */ - mako = 11, /* pa8800 pa 2.0 */ - mako2 = 12 /* pa8900 pa 2.0 */ + mako = 11 /* pa8800 pa 2.0 */ }; -extern const char * const cpu_name_version[][2]; /* mapping from enum cpu_type to strings */ +extern char *cpu_name_version[][2]; /* mapping from enum cpu_type to strings */ struct parisc_driver; diff --git a/trunk/include/asm-parisc/linkage.h b/trunk/include/asm-parisc/linkage.h index ad8cd0d069ea..7a09d911b538 100644 --- a/trunk/include/asm-parisc/linkage.h +++ b/trunk/include/asm-parisc/linkage.h @@ -8,10 +8,8 @@ /* * In parisc assembly a semicolon marks a comment while a - * exclamation mark is used to seperate independent lines. + * exclamation mark is used to seperate independend lines. */ -#ifdef __ASSEMBLY__ - #define ENTRY(name) \ .export name !\ ALIGN !\ @@ -26,6 +24,5 @@ END(name) #endif -#endif /* __ASSEMBLY__ */ #endif /* __ASM_PARISC_LINKAGE_H */ diff --git a/trunk/include/asm-parisc/processor.h b/trunk/include/asm-parisc/processor.h index 6b294fb07a23..d2f396721d3e 100644 --- a/trunk/include/asm-parisc/processor.h +++ b/trunk/include/asm-parisc/processor.h @@ -69,8 +69,8 @@ struct system_cpuinfo_parisc { char sys_model_name[81]; /* PDC-ROM returnes this model name */ } pdc; - const char *cpu_name; /* e.g. "PA7300LC (PCX-L2)" */ - const char *family_name; /* e.g. "1.1e" */ + char *cpu_name; /* e.g. "PA7300LC (PCX-L2)" */ + char *family_name; /* e.g. "1.1e" */ }; @@ -334,8 +334,8 @@ extern unsigned long get_wchan(struct task_struct *p); static inline int parisc_requires_coherency(void) { #ifdef CONFIG_PA8X00 - return (boot_cpu_data.cpu_type == mako) || - (boot_cpu_data.cpu_type == mako2); + /* FIXME: also pa8900 - when we see one */ + return boot_cpu_data.cpu_type == mako; #else return 0; #endif diff --git a/trunk/include/asm-parisc/unistd.h b/trunk/include/asm-parisc/unistd.h index f74099bdca3c..2f7c40861c91 100644 --- a/trunk/include/asm-parisc/unistd.h +++ b/trunk/include/asm-parisc/unistd.h @@ -792,19 +792,8 @@ #define __NR_epoll_pwait (__NR_Linux + 297) #define __NR_statfs64 (__NR_Linux + 298) #define __NR_fstatfs64 (__NR_Linux + 299) -#define __NR_kexec_load (__NR_Linux + 300) -#define __NR_utimensat (__NR_Linux + 301) -#define __NR_signalfd (__NR_Linux + 302) -#define __NR_timerfd (__NR_Linux + 303) -#define __NR_eventfd (__NR_Linux + 304) - -#define __NR_Linux_syscalls (__NR_eventfd + 1) - - -#define __IGNORE_select /* newselect */ -#define __IGNORE_fadvise64 /* fadvise64_64 */ -#define __IGNORE_utimes /* utime */ +#define __NR_Linux_syscalls (__NR_fstatfs64 + 1) #define HPUX_GATEWAY_ADDR 0xC0000004 #define LINUX_GATEWAY_ADDR 0x100 diff --git a/trunk/include/asm-powerpc/pgtable-ppc32.h b/trunk/include/asm-powerpc/pgtable-ppc32.h index 7fb730c62f83..c863bdb2889c 100644 --- a/trunk/include/asm-powerpc/pgtable-ppc32.h +++ b/trunk/include/asm-powerpc/pgtable-ppc32.h @@ -673,14 +673,10 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty) } #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed) { \ - __ptep_set_access_flags(__ptep, __entry, __dirty); \ - flush_tlb_page_nohash(__vma, __address); \ - } \ - __changed; \ -}) + do { \ + __ptep_set_access_flags(__ptep, __entry, __dirty); \ + flush_tlb_page_nohash(__vma, __address); \ + } while(0) /* * Macro to mark a page protection value as "uncacheable". diff --git a/trunk/include/asm-powerpc/pgtable-ppc64.h b/trunk/include/asm-powerpc/pgtable-ppc64.h index 3cfd98f44bfe..704c4e669fe0 100644 --- a/trunk/include/asm-powerpc/pgtable-ppc64.h +++ b/trunk/include/asm-powerpc/pgtable-ppc64.h @@ -413,14 +413,10 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty) :"cc"); } #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed) { \ - __ptep_set_access_flags(__ptep, __entry, __dirty); \ - flush_tlb_page_nohash(__vma, __address); \ - } \ - __changed; \ -}) + do { \ + __ptep_set_access_flags(__ptep, __entry, __dirty); \ + flush_tlb_page_nohash(__vma, __address); \ + } while(0) /* * Macro to mark a page protection value as "uncacheable". diff --git a/trunk/include/asm-ppc/pgtable.h b/trunk/include/asm-ppc/pgtable.h index 9d0ce9ff5840..bed452d4a5f0 100644 --- a/trunk/include/asm-ppc/pgtable.h +++ b/trunk/include/asm-ppc/pgtable.h @@ -694,14 +694,10 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty) } #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed) { \ - __ptep_set_access_flags(__ptep, __entry, __dirty); \ - flush_tlb_page_nohash(__vma, __address); \ - } \ - __changed; \ -}) + do { \ + __ptep_set_access_flags(__ptep, __entry, __dirty); \ + flush_tlb_page_nohash(__vma, __address); \ + } while(0) /* * Macro to mark a page protection value as "uncacheable". diff --git a/trunk/include/asm-s390/pgtable.h b/trunk/include/asm-s390/pgtable.h index 0a307bb2f353..8fe8d42e64c3 100644 --- a/trunk/include/asm-s390/pgtable.h +++ b/trunk/include/asm-s390/pgtable.h @@ -744,12 +744,7 @@ ptep_establish(struct vm_area_struct *vma, } #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed) \ - ptep_establish(__vma, __address, __ptep, __entry); \ - __changed; \ -}) + ptep_establish(__vma, __address, __ptep, __entry) /* * Test and clear dirty bit in storage key. diff --git a/trunk/include/asm-sparc/pgtable.h b/trunk/include/asm-sparc/pgtable.h index 59229aeba27b..4f0a5ba0d6a0 100644 --- a/trunk/include/asm-sparc/pgtable.h +++ b/trunk/include/asm-sparc/pgtable.h @@ -446,17 +446,6 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma, #define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) #define GET_PFN(pfn) (pfn & 0x0fffffffUL) -#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS -#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed) { \ - set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ - flush_tlb_page(__vma, __address); \ - } \ - (sparc_cpu_model == sun4c) || __changed; \ -}) - #include #endif /* !(__ASSEMBLY__) */ diff --git a/trunk/include/asm-sparc64/dma-mapping.h b/trunk/include/asm-sparc64/dma-mapping.h index c58ec1661df8..4e21c2f3065c 100644 --- a/trunk/include/asm-sparc64/dma-mapping.h +++ b/trunk/include/asm-sparc64/dma-mapping.h @@ -15,7 +15,8 @@ static inline int dma_supported(struct device *dev, u64 mask) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); return pci_dma_supported(to_pci_dev(dev), mask); } @@ -23,7 +24,8 @@ dma_supported(struct device *dev, u64 mask) static inline int dma_set_mask(struct device *dev, u64 dma_mask) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); return pci_set_dma_mask(to_pci_dev(dev), dma_mask); } @@ -32,7 +34,8 @@ static inline void * dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag); } @@ -41,7 +44,8 @@ static inline void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t dma_handle) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); } @@ -50,7 +54,8 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, size_t size, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); } @@ -59,7 +64,8 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); } @@ -69,7 +75,8 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); } @@ -78,7 +85,8 @@ static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); } @@ -87,7 +95,8 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); } @@ -96,7 +105,8 @@ static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); } @@ -105,7 +115,8 @@ static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle, size, (int)direction); @@ -115,7 +126,8 @@ static inline void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, size, (int)direction); @@ -125,7 +137,8 @@ static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction); } @@ -134,7 +147,8 @@ static inline void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { - BUG_ON(dev->bus != &pci_bus_type); + BUG_ON(dev->bus != &pci_bus_type && + dev->bus != &ebus_bus_type); pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction); } diff --git a/trunk/include/asm-sparc64/hypervisor.h b/trunk/include/asm-sparc64/hypervisor.h index db2130a95d68..5c2f9d4b9f06 100644 --- a/trunk/include/asm-sparc64/hypervisor.h +++ b/trunk/include/asm-sparc64/hypervisor.h @@ -2615,9 +2615,8 @@ struct ldc_mtable_entry { /* ldc_revoke() * TRAP: HV_FAST_TRAP * FUNCTION: HV_FAST_LDC_REVOKE - * ARG0: channel ID - * ARG1: cookie - * ARG2: ldc_mtable_entry cookie + * ARG0: cookie + * ARG1: ldc_mtable_entry cookie * RET0: status */ #define HV_FAST_LDC_REVOKE 0xef @@ -2664,8 +2663,7 @@ extern unsigned long sun4v_ldc_mapin(unsigned long channel, unsigned long *ra, unsigned long *perm); extern unsigned long sun4v_ldc_unmap(unsigned long ra); -extern unsigned long sun4v_ldc_revoke(unsigned long channel, - unsigned long cookie, +extern unsigned long sun4v_ldc_revoke(unsigned long cookie, unsigned long mte_cookie); #endif diff --git a/trunk/include/asm-sparc64/irq.h b/trunk/include/asm-sparc64/irq.h index 90781e34a95c..5d233b42fe13 100644 --- a/trunk/include/asm-sparc64/irq.h +++ b/trunk/include/asm-sparc64/irq.h @@ -46,7 +46,6 @@ extern void irq_install_pre_handler(int virt_irq, #define irq_canonicalize(irq) (irq) extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); -extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino); extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, unsigned int msi_devino_start, unsigned int msi_devino_end); diff --git a/trunk/include/asm-sparc64/parport.h b/trunk/include/asm-sparc64/parport.h index 23cc63f049a8..6340a5253a34 100644 --- a/trunk/include/asm-sparc64/parport.h +++ b/trunk/include/asm-sparc64/parport.h @@ -145,7 +145,7 @@ static int parport_isa_probe(int count) */ if (parport_pc_probe_port(base, base + 0x400, child->irq, PARPORT_DMA_NOFIFO, - &child->bus->self->dev)) + child->bus->self)) count++; } } @@ -199,8 +199,7 @@ static int parport_pc_find_nonpci_ports (int autoirq, int autodma) if (parport_pc_probe_port(base, base + 0x400, edev->irqs[0], - count, - &ebus->self->dev)) + count, ebus->self)) count++; } } diff --git a/trunk/include/asm-um/a.out.h b/trunk/include/asm-um/a.out.h index 7016b893ac9d..50cee7b296f4 100644 --- a/trunk/include/asm-um/a.out.h +++ b/trunk/include/asm-um/a.out.h @@ -5,7 +5,6 @@ #include "choose-mode.h" #undef STACK_TOP -#undef STACK_TOP_MAX extern unsigned long stacksizelim; diff --git a/trunk/include/asm-x86_64/pgtable.h b/trunk/include/asm-x86_64/pgtable.h index 0a71e0b9a619..08b9831f2e14 100644 --- a/trunk/include/asm-x86_64/pgtable.h +++ b/trunk/include/asm-x86_64/pgtable.h @@ -395,14 +395,12 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) * bit at the same time. */ #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed && __dirty) { \ - set_pte(__ptep, __entry); \ - flush_tlb_page(__vma, __address); \ - } \ - __changed; \ -}) + do { \ + if (__dirty) { \ + set_pte(__ptep, __entry); \ + flush_tlb_page(__vma, __address); \ + } \ + } while (0) /* Encode and de-code a swap entry */ #define __swp_type(x) (((x).val >> 1) & 0x3f) diff --git a/trunk/include/linux/futex.h b/trunk/include/linux/futex.h index 99650353adfa..899fc7f20edd 100644 --- a/trunk/include/linux/futex.h +++ b/trunk/include/linux/futex.h @@ -17,6 +17,7 @@ union ktime; #define FUTEX_LOCK_PI 6 #define FUTEX_UNLOCK_PI 7 #define FUTEX_TRYLOCK_PI 8 +#define FUTEX_CMP_REQUEUE_PI 9 #define FUTEX_PRIVATE_FLAG 128 #define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG @@ -96,10 +97,15 @@ struct robust_list_head { */ #define FUTEX_OWNER_DIED 0x40000000 +/* + * Some processes have been requeued on this PI-futex + */ +#define FUTEX_WAITER_REQUEUED 0x20000000 + /* * The rest of the robust-futex field is for the TID: */ -#define FUTEX_TID_MASK 0x3fffffff +#define FUTEX_TID_MASK 0x0fffffff /* * This limit protects against a deliberately circular list. @@ -133,6 +139,7 @@ handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); #define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */ union futex_key { + u32 __user *uaddr; struct { unsigned long pgoff; struct inode *inode; diff --git a/trunk/include/linux/hugetlb.h b/trunk/include/linux/hugetlb.h index 2c13715e9dde..b4570b62ab85 100644 --- a/trunk/include/linux/hugetlb.h +++ b/trunk/include/linux/hugetlb.h @@ -163,7 +163,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) extern const struct file_operations hugetlbfs_file_operations; extern struct vm_operations_struct hugetlb_vm_ops; -struct file *hugetlb_file_setup(const char *name, size_t); +struct file *hugetlb_zero_setup(size_t); int hugetlb_get_quota(struct address_space *mapping); void hugetlb_put_quota(struct address_space *mapping); @@ -185,7 +185,7 @@ static inline void set_file_hugepages(struct file *file) #define is_file_hugepages(file) 0 #define set_file_hugepages(file) BUG() -#define hugetlb_file_setup(name,size) ERR_PTR(-ENOSYS) +#define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) #endif /* !CONFIG_HUGETLBFS */ diff --git a/trunk/include/linux/ktime.h b/trunk/include/linux/ktime.h index 2b139f66027f..c762954bda14 100644 --- a/trunk/include/linux/ktime.h +++ b/trunk/include/linux/ktime.h @@ -261,18 +261,6 @@ static inline s64 ktime_to_ns(const ktime_t kt) #endif -/** - * ktime_equal - Compares two ktime_t variables to see if they are equal - * @cmp1: comparable1 - * @cmp2: comparable2 - * - * Compare two ktime_t variables, returns 1 if equal - */ -static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2) -{ - return cmp1.tv64 == cmp2.tv64; -} - static inline s64 ktime_to_us(const ktime_t kt) { struct timeval tv = ktime_to_timeval(kt); diff --git a/trunk/include/linux/skbuff.h b/trunk/include/linux/skbuff.h index 6f0b2f7d0010..e7367c74e1bb 100644 --- a/trunk/include/linux/skbuff.h +++ b/trunk/include/linux/skbuff.h @@ -1579,10 +1579,6 @@ static inline ktime_t net_timedelta(ktime_t t) return ktime_sub(ktime_get_real(), t); } -static inline ktime_t net_invalid_timestamp(void) -{ - return ktime_set(0, 0); -} extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); extern __sum16 __skb_checksum_complete(struct sk_buff *skb); diff --git a/trunk/include/linux/slub_def.h b/trunk/include/linux/slub_def.h index 6207a3d8da71..a0ad37463d62 100644 --- a/trunk/include/linux/slub_def.h +++ b/trunk/include/linux/slub_def.h @@ -28,7 +28,7 @@ struct kmem_cache { int size; /* The size of an object including meta data */ int objsize; /* The size of an object without meta data */ int offset; /* Free pointer offset. */ - int order; + unsigned int order; /* * Avoid an extra cache line for UP, SMP and for the node local to @@ -56,13 +56,7 @@ struct kmem_cache { /* * Kmalloc subsystem. */ -#if defined(ARCH_KMALLOC_MINALIGN) && ARCH_KMALLOC_MINALIGN > 8 -#define KMALLOC_MIN_SIZE ARCH_KMALLOC_MINALIGN -#else -#define KMALLOC_MIN_SIZE 8 -#endif - -#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) +#define KMALLOC_SHIFT_LOW 3 /* * We keep the general caches in an array of slab caches that are used for @@ -82,9 +76,6 @@ static inline int kmalloc_index(size_t size) if (size > KMALLOC_MAX_SIZE) return -1; - if (size <= KMALLOC_MIN_SIZE) - return KMALLOC_SHIFT_LOW; - if (size > 64 && size <= 96) return 1; if (size > 128 && size <= 192) diff --git a/trunk/include/linux/spi/spi.h b/trunk/include/linux/spi/spi.h index 1be5ea059477..b6bedc3ee95c 100644 --- a/trunk/include/linux/spi/spi.h +++ b/trunk/include/linux/spi/spi.h @@ -341,14 +341,9 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum); * chip transactions together. * * (ii) When the transfer is the last one in the message, the chip may - * stay selected until the next transfer. On multi-device SPI busses - * with nothing blocking messages going to other devices, this is just - * a performance hint; starting a message to another device deselects - * this one. But in other cases, this can be used to ensure correctness. - * Some devices need protocol transactions to be built from a series of - * spi_message submissions, where the content of one message is determined - * by the results of previous messages and where the whole transaction - * ends when the chipselect goes intactive. + * stay selected until the next transfer. This is purely a performance + * hint; the controller driver may need to select a different device + * for the next message. * * The code that submits an spi_message (and its spi_transfers) * to the lower layers is responsible for managing its memory. @@ -485,15 +480,14 @@ static inline void spi_message_free(struct spi_message *m) /** * spi_setup - setup SPI mode and clock rate * @spi: the device whose settings are being modified - * Context: can sleep, and no requests are queued to the device + * Context: can sleep * * SPI protocol drivers may need to update the transfer mode if the - * device doesn't work with its default. They may likewise need + * device doesn't work with the mode 0 default. They may likewise need * to update clock rates or word sizes from initial values. This function * changes those settings, and must be called from a context that can sleep. - * Except for SPI_CS_HIGH, which takes effect immediately, the changes take - * effect the next time the device is selected and data is transferred to - * or from it. When this function returns, the spi device is deselected. + * The changes take effect the next time the device is selected and data + * is transferred to or from it. * * Note that this call will fail if the protocol driver specifies an option * that the underlying controller or its driver does not support. For diff --git a/trunk/include/net/irda/irlap.h b/trunk/include/net/irda/irlap.h index a3d370efb903..f0248fb8e196 100644 --- a/trunk/include/net/irda/irlap.h +++ b/trunk/include/net/irda/irlap.h @@ -289,21 +289,4 @@ static inline void irlap_clear_disconnect(struct irlap_cb *self) self->disconnect_pending = FALSE; } -/* - * Function irlap_next_state (self, state) - * - * Switches state and provides debug information - * - */ -static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state) -{ - /* - if (!self || self->magic != LAP_MAGIC) - return; - - IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]); - */ - self->state = state; -} - #endif diff --git a/trunk/include/net/sctp/sctp.h b/trunk/include/net/sctp/sctp.h index 16baef4dab7e..dda72bf5b9b4 100644 --- a/trunk/include/net/sctp/sctp.h +++ b/trunk/include/net/sctp/sctp.h @@ -503,13 +503,6 @@ static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu) return frag; } -static inline void sctp_assoc_pending_pmtu(struct sctp_association *asoc) -{ - - sctp_assoc_sync_pmtu(asoc); - asoc->pmtu_pending = 0; -} - /* Walk through a list of TLV parameters. Don't trust the * individual parameter lengths and instead depend on * the chunk length to indicate when to stop. Make sure diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h index ee4559b11302..5e81984b8478 100644 --- a/trunk/include/net/sctp/structs.h +++ b/trunk/include/net/sctp/structs.h @@ -912,9 +912,6 @@ struct sctp_transport { */ __u16 pathmaxrxt; - /* is the Path MTU update pending on this tranport */ - __u8 pmtu_pending; - /* PMTU : The current known path MTU. */ __u32 pathmtu; @@ -1009,7 +1006,6 @@ void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32); void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); unsigned long sctp_transport_timeout(struct sctp_transport *); void sctp_transport_reset(struct sctp_transport *); -void sctp_transport_update_pmtu(struct sctp_transport *, u32); /* This is the structure we use to queue packets as they come into @@ -1569,9 +1565,6 @@ struct sctp_association { */ __u16 pathmaxrxt; - /* Flag that path mtu update is pending */ - __u8 pmtu_pending; - /* Association : The smallest PMTU discovered for all of the * PMTU : peer's transport addresses. */ diff --git a/trunk/ipc/shm.c b/trunk/ipc/shm.c index 0852f206d895..4fefbad7096d 100644 --- a/trunk/ipc/shm.c +++ b/trunk/ipc/shm.c @@ -254,10 +254,8 @@ struct mempolicy *shm_get_policy(struct vm_area_struct *vma, unsigned long addr) if (sfd->vm_ops->get_policy) pol = sfd->vm_ops->get_policy(vma, addr); - else if (vma->vm_policy) - pol = vma->vm_policy; else - pol = current->mempolicy; + pol = vma->vm_policy; return pol; } #endif @@ -366,10 +364,9 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) return error; } - sprintf (name, "SYSV%08x", key); if (shmflg & SHM_HUGETLB) { - /* hugetlb_file_setup takes care of mlock user accounting */ - file = hugetlb_file_setup(name, size); + /* hugetlb_zero_setup takes care of mlock user accounting */ + file = hugetlb_zero_setup(size); shp->mlock_user = current->user; } else { int acctflag = VM_ACCOUNT; @@ -380,6 +377,7 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) if ((shmflg & SHM_NORESERVE) && sysctl_overcommit_memory != OVERCOMMIT_NEVER) acctflag = 0; + sprintf (name, "SYSV%08x", key); file = shmem_file_setup(name, size, acctflag); } error = PTR_ERR(file); @@ -399,11 +397,6 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) shp->shm_nattch = 0; shp->id = shm_buildid(ns, id, shp->shm_perm.seq); shp->shm_file = file; - /* - * shmid gets reported as "inode#" in /proc/pid/maps. - * proc-ps tools use this. Changing this will break them. - */ - file->f_dentry->d_inode->i_ino = shp->id; ns->shm_tot += numpages; shm_unlock(shp); diff --git a/trunk/kernel/cpuset.c b/trunk/kernel/cpuset.c index 4c49188cc49b..f57854b08922 100644 --- a/trunk/kernel/cpuset.c +++ b/trunk/kernel/cpuset.c @@ -1682,9 +1682,9 @@ static int pid_array_load(pid_t *pidarray, int npids, struct cpuset *cs) do_each_thread(g, p) { if (p->cpuset == cs) { + pidarray[n++] = p->pid; if (unlikely(n == npids)) goto array_full; - pidarray[n++] = p->pid; } } while_each_thread(g, p); diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c index df248f5e0836..3b7f7713d9a4 100644 --- a/trunk/kernel/futex.c +++ b/trunk/kernel/futex.c @@ -56,6 +56,12 @@ #include "rtmutex_common.h" +#ifdef CONFIG_DEBUG_RT_MUTEXES +# include "rtmutex-debug.h" +#else +# include "rtmutex.h" +#endif + #define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8) /* @@ -105,6 +111,12 @@ struct futex_q { /* Optional priority inheritance state: */ struct futex_pi_state *pi_state; struct task_struct *task; + + /* + * This waiter is used in case of requeue from a + * normal futex to a PI-futex + */ + struct rt_mutex_waiter waiter; }; /* @@ -204,6 +216,9 @@ int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared, if (unlikely((vma->vm_flags & (VM_IO|VM_READ)) != VM_READ)) return (vma->vm_flags & VM_IO) ? -EPERM : -EACCES; + /* Save the user address in the ley */ + key->uaddr = uaddr; + /* * Private mappings are handled in a simple way. * @@ -621,6 +636,8 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) int ret = 0; newval = FUTEX_WAITERS | new_owner->pid; + /* Keep the FUTEX_WAITER_REQUEUED flag if it was set */ + newval |= (uval & FUTEX_WAITER_REQUEUED); pagefault_disable(); curval = futex_atomic_cmpxchg_inatomic(uaddr, uval, newval); @@ -732,6 +749,259 @@ static int futex_wake(u32 __user *uaddr, struct rw_semaphore *fshared, return ret; } +/* + * Called from futex_requeue_pi. + * Set FUTEX_WAITERS and FUTEX_WAITER_REQUEUED flags on the + * PI-futex value; search its associated pi_state if an owner exist + * or create a new one without owner. + */ +static inline int +lookup_pi_state_for_requeue(u32 __user *uaddr, struct futex_hash_bucket *hb, + union futex_key *key, + struct futex_pi_state **pi_state) +{ + u32 curval, uval, newval; + +retry: + /* + * We can't handle a fault cleanly because we can't + * release the locks here. Simply return the fault. + */ + if (get_futex_value_locked(&curval, uaddr)) + return -EFAULT; + + /* set the flags FUTEX_WAITERS and FUTEX_WAITER_REQUEUED */ + if ((curval & (FUTEX_WAITERS | FUTEX_WAITER_REQUEUED)) + != (FUTEX_WAITERS | FUTEX_WAITER_REQUEUED)) { + /* + * No waiters yet, we prepare the futex to have some waiters. + */ + + uval = curval; + newval = uval | FUTEX_WAITERS | FUTEX_WAITER_REQUEUED; + + pagefault_disable(); + curval = futex_atomic_cmpxchg_inatomic(uaddr, uval, newval); + pagefault_enable(); + + if (unlikely(curval == -EFAULT)) + return -EFAULT; + if (unlikely(curval != uval)) + goto retry; + } + + if (!(curval & FUTEX_TID_MASK) + || lookup_pi_state(curval, hb, key, pi_state)) { + /* the futex has no owner (yet) or the lookup failed: + allocate one pi_state without owner */ + + *pi_state = alloc_pi_state(); + + /* Already stores the key: */ + (*pi_state)->key = *key; + + /* init the mutex without owner */ + __rt_mutex_init(&(*pi_state)->pi_mutex, NULL); + } + + return 0; +} + +/* + * Keep the first nr_wake waiter from futex1, wake up one, + * and requeue the next nr_requeue waiters following hashed on + * one physical page to another physical page (PI-futex uaddr2) + */ +static int futex_requeue_pi(u32 __user *uaddr1, + struct rw_semaphore *fshared, + u32 __user *uaddr2, + int nr_wake, int nr_requeue, u32 *cmpval) +{ + union futex_key key1, key2; + struct futex_hash_bucket *hb1, *hb2; + struct plist_head *head1; + struct futex_q *this, *next; + struct futex_pi_state *pi_state2 = NULL; + struct rt_mutex_waiter *waiter, *top_waiter = NULL; + struct rt_mutex *lock2 = NULL; + int ret, drop_count = 0; + + if (refill_pi_state_cache()) + return -ENOMEM; + +retry: + /* + * First take all the futex related locks: + */ + if (fshared) + down_read(fshared); + + ret = get_futex_key(uaddr1, fshared, &key1); + if (unlikely(ret != 0)) + goto out; + ret = get_futex_key(uaddr2, fshared, &key2); + if (unlikely(ret != 0)) + goto out; + + hb1 = hash_futex(&key1); + hb2 = hash_futex(&key2); + + double_lock_hb(hb1, hb2); + + if (likely(cmpval != NULL)) { + u32 curval; + + ret = get_futex_value_locked(&curval, uaddr1); + + if (unlikely(ret)) { + spin_unlock(&hb1->lock); + if (hb1 != hb2) + spin_unlock(&hb2->lock); + + /* + * If we would have faulted, release mmap_sem, fault + * it in and start all over again. + */ + if (fshared) + up_read(fshared); + + ret = get_user(curval, uaddr1); + + if (!ret) + goto retry; + + return ret; + } + if (curval != *cmpval) { + ret = -EAGAIN; + goto out_unlock; + } + } + + head1 = &hb1->chain; + plist_for_each_entry_safe(this, next, head1, list) { + if (!match_futex (&this->key, &key1)) + continue; + if (++ret <= nr_wake) { + wake_futex(this); + } else { + /* + * FIRST: get and set the pi_state + */ + if (!pi_state2) { + int s; + /* do this only the first time we requeue someone */ + s = lookup_pi_state_for_requeue(uaddr2, hb2, + &key2, &pi_state2); + if (s) { + ret = s; + goto out_unlock; + } + + lock2 = &pi_state2->pi_mutex; + spin_lock(&lock2->wait_lock); + + /* Save the top waiter of the wait_list */ + if (rt_mutex_has_waiters(lock2)) + top_waiter = rt_mutex_top_waiter(lock2); + } else + atomic_inc(&pi_state2->refcount); + + + this->pi_state = pi_state2; + + /* + * SECOND: requeue futex_q to the correct hashbucket + */ + + /* + * If key1 and key2 hash to the same bucket, no need to + * requeue. + */ + if (likely(head1 != &hb2->chain)) { + plist_del(&this->list, &hb1->chain); + plist_add(&this->list, &hb2->chain); + this->lock_ptr = &hb2->lock; +#ifdef CONFIG_DEBUG_PI_LIST + this->list.plist.lock = &hb2->lock; +#endif + } + this->key = key2; + get_futex_key_refs(&key2); + drop_count++; + + + /* + * THIRD: queue it to lock2 + */ + spin_lock_irq(&this->task->pi_lock); + waiter = &this->waiter; + waiter->task = this->task; + waiter->lock = lock2; + plist_node_init(&waiter->list_entry, this->task->prio); + plist_node_init(&waiter->pi_list_entry, this->task->prio); + plist_add(&waiter->list_entry, &lock2->wait_list); + this->task->pi_blocked_on = waiter; + spin_unlock_irq(&this->task->pi_lock); + + if (ret - nr_wake >= nr_requeue) + break; + } + } + + /* If we've requeued some tasks and the top_waiter of the rt_mutex + has changed, we must adjust the priority of the owner, if any */ + if (drop_count) { + struct task_struct *owner = rt_mutex_owner(lock2); + if (owner && + (top_waiter != (waiter = rt_mutex_top_waiter(lock2)))) { + int chain_walk = 0; + + spin_lock_irq(&owner->pi_lock); + if (top_waiter) + plist_del(&top_waiter->pi_list_entry, &owner->pi_waiters); + else + /* + * There was no waiters before the requeue, + * the flag must be updated + */ + mark_rt_mutex_waiters(lock2); + + plist_add(&waiter->pi_list_entry, &owner->pi_waiters); + __rt_mutex_adjust_prio(owner); + if (owner->pi_blocked_on) { + chain_walk = 1; + get_task_struct(owner); + } + + spin_unlock_irq(&owner->pi_lock); + spin_unlock(&lock2->wait_lock); + + if (chain_walk) + rt_mutex_adjust_prio_chain(owner, 0, lock2, NULL, + current); + } else { + /* No owner or the top_waiter does not change */ + mark_rt_mutex_waiters(lock2); + spin_unlock(&lock2->wait_lock); + } + } + +out_unlock: + spin_unlock(&hb1->lock); + if (hb1 != hb2) + spin_unlock(&hb2->lock); + + /* drop_futex_key_refs() must be called outside the spinlocks. */ + while (--drop_count >= 0) + drop_futex_key_refs(&key1); + +out: + if (fshared) + up_read(fshared); + return ret; +} + /* * Wake up all waiters hashed on the physical page that is mapped * to this virtual address: @@ -1114,6 +1384,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, while (!ret) { newval = (uval & FUTEX_OWNER_DIED) | newtid; + newval |= (uval & FUTEX_WAITER_REQUEUED); pagefault_disable(); curval = futex_atomic_cmpxchg_inatomic(uaddr, @@ -1145,7 +1416,7 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared, struct futex_q q; u32 uval; int ret; - struct hrtimer_sleeper t; + struct hrtimer_sleeper t, *to = NULL; int rem = 0; q.pi_state = NULL; @@ -1201,6 +1472,14 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared, if (uval != val) goto out_unlock_release_sem; + /* + * This rt_mutex_waiter structure is prepared here and will + * be used only if this task is requeued from a normal futex to + * a PI-futex with futex_requeue_pi. + */ + debug_rt_mutex_init_waiter(&q.waiter); + q.waiter.task = NULL; + /* Only actually queue if *uaddr contained val. */ __queue_me(&q, hb); @@ -1231,6 +1510,7 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared, if (!abs_time) schedule(); else { + to = &t; hrtimer_init(&t.timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); hrtimer_init_sleeper(&t, current); t.timer.expires = *abs_time; @@ -1258,6 +1538,67 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared, * we are the only user of it. */ + if (q.pi_state) { + /* + * We were woken but have been requeued on a PI-futex. + * We have to complete the lock acquisition by taking + * the rtmutex. + */ + + struct rt_mutex *lock = &q.pi_state->pi_mutex; + + spin_lock(&lock->wait_lock); + if (unlikely(q.waiter.task)) { + remove_waiter(lock, &q.waiter); + } + spin_unlock(&lock->wait_lock); + + if (rem) + ret = -ETIMEDOUT; + else + ret = rt_mutex_timed_lock(lock, to, 1); + + if (fshared) + down_read(fshared); + spin_lock(q.lock_ptr); + + /* + * Got the lock. We might not be the anticipated owner if we + * did a lock-steal - fix up the PI-state in that case. + */ + if (!ret && q.pi_state->owner != curr) { + /* + * We MUST play with the futex we were requeued on, + * NOT the current futex. + * We can retrieve it from the key of the pi_state + */ + uaddr = q.pi_state->key.uaddr; + + ret = fixup_pi_state_owner(uaddr, &q, curr); + } else { + /* + * Catch the rare case, where the lock was released + * when we were on the way back before we locked + * the hash bucket. + */ + if (ret && q.pi_state->owner == curr) { + if (rt_mutex_trylock(&q.pi_state->pi_mutex)) + ret = 0; + } + } + + /* Unqueue and drop the lock */ + unqueue_me_pi(&q); + if (fshared) + up_read(fshared); + + debug_rt_mutex_free_waiter(&q.waiter); + + return ret; + } + + debug_rt_mutex_free_waiter(&q.waiter); + /* If we were woken (and unqueued), we succeeded, whatever. */ if (!unqueue_me(&q)) return 0; @@ -1307,6 +1648,51 @@ static long futex_wait_restart(struct restart_block *restart) } +static void set_pi_futex_owner(struct futex_hash_bucket *hb, + union futex_key *key, struct task_struct *p) +{ + struct plist_head *head; + struct futex_q *this, *next; + struct futex_pi_state *pi_state = NULL; + struct rt_mutex *lock; + + /* Search a waiter that should already exists */ + + head = &hb->chain; + + plist_for_each_entry_safe(this, next, head, list) { + if (match_futex (&this->key, key)) { + pi_state = this->pi_state; + break; + } + } + + BUG_ON(!pi_state); + + /* set p as pi_state's owner */ + lock = &pi_state->pi_mutex; + + spin_lock(&lock->wait_lock); + spin_lock_irq(&p->pi_lock); + + list_add(&pi_state->list, &p->pi_state_list); + pi_state->owner = p; + + + /* set p as pi_mutex's owner */ + debug_rt_mutex_proxy_lock(lock, p); + WARN_ON(rt_mutex_owner(lock)); + rt_mutex_set_owner(lock, p, 0); + rt_mutex_deadlock_account_lock(lock, p); + + plist_add(&rt_mutex_top_waiter(lock)->pi_list_entry, + &p->pi_waiters); + __rt_mutex_adjust_prio(p); + + spin_unlock_irq(&p->pi_lock); + spin_unlock(&lock->wait_lock); +} + /* * Userspace tried a 0 -> TID atomic transition of the futex value * and failed. The kernel side here does the whole locking operation: @@ -1367,7 +1753,8 @@ static int futex_lock_pi(u32 __user *uaddr, struct rw_semaphore *fshared, * situation and we return success to user space. */ if (unlikely((curval & FUTEX_TID_MASK) == current->pid)) { - ret = -EDEADLK; + if (!(curval & FUTEX_WAITER_REQUEUED)) + ret = -EDEADLK; goto out_unlock_release_sem; } @@ -1387,14 +1774,14 @@ static int futex_lock_pi(u32 __user *uaddr, struct rw_semaphore *fshared, /* * There are two cases, where a futex might have no owner (the - * owner TID is 0): OWNER_DIED. We take over the futex in this - * case. We also do an unconditional take over, when the owner - * of the futex died. + * owner TID is 0): OWNER_DIED or REQUEUE. We take over the + * futex in this case. We also do an unconditional take over, + * when the owner of the futex died. * * This is safe as we are protected by the hash bucket lock ! */ if (unlikely(ownerdied || !(curval & FUTEX_TID_MASK))) { - /* Keep the OWNER_DIED bit */ + /* Keep the OWNER_DIED and REQUEUE bits */ newval = (curval & ~FUTEX_TID_MASK) | current->pid; ownerdied = 0; lock_taken = 1; @@ -1410,10 +1797,14 @@ static int futex_lock_pi(u32 __user *uaddr, struct rw_semaphore *fshared, goto retry_locked; /* - * We took the lock due to owner died take over. + * We took the lock due to requeue or owner died take over. */ - if (unlikely(lock_taken)) + if (unlikely(lock_taken)) { + /* For requeue we need to fixup the pi_futex */ + if (curval & FUTEX_WAITER_REQUEUED) + set_pi_futex_owner(hb, &q.key, curr); goto out_unlock_release_sem; + } /* * We dont have the lock. Look up the PI state (or create it if @@ -1898,6 +2289,8 @@ int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi) * userspace. */ mval = (uval & FUTEX_WAITERS) | FUTEX_OWNER_DIED; + /* Also keep the FUTEX_WAITER_REQUEUED flag if set */ + mval |= (uval & FUTEX_WAITER_REQUEUED); nval = futex_atomic_cmpxchg_inatomic(uaddr, uval, mval); if (nval == -EFAULT) @@ -2034,6 +2427,9 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, case FUTEX_TRYLOCK_PI: ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1); break; + case FUTEX_CMP_REQUEUE_PI: + ret = futex_requeue_pi(uaddr, fshared, uaddr2, val, val2, &val3); + break; default: ret = -ENOSYS; } @@ -2064,7 +2460,8 @@ asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val, /* * requeue parameter in 'utime' if cmd == FUTEX_REQUEUE. */ - if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE) + if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE + || cmd == FUTEX_CMP_REQUEUE_PI) val2 = (u32) (unsigned long) utime; return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); diff --git a/trunk/kernel/futex_compat.c b/trunk/kernel/futex_compat.c index f7921360efad..27478948b318 100644 --- a/trunk/kernel/futex_compat.c +++ b/trunk/kernel/futex_compat.c @@ -157,7 +157,8 @@ asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, t = ktime_add(ktime_get(), t); tp = &t; } - if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE) + if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE + || cmd == FUTEX_CMP_REQUEUE_PI) val2 = (int) (unsigned long) utime; return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); diff --git a/trunk/kernel/power/user.c b/trunk/kernel/power/user.c index d65305b515b1..24d7d78e6f42 100644 --- a/trunk/kernel/power/user.c +++ b/trunk/kernel/power/user.c @@ -99,8 +99,6 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf, ssize_t res; data = filp->private_data; - if (!data->ready) - return -ENODATA; res = snapshot_read_next(&data->handle, count); if (res > 0) { if (copy_to_user(buf, data_of(data->handle), res)) @@ -247,7 +245,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, break; case SNAPSHOT_UNFREEZE: - if (!data->frozen || data->ready) + if (!data->frozen) break; mutex_lock(&pm_mutex); thaw_processes(); diff --git a/trunk/kernel/rtmutex.c b/trunk/kernel/rtmutex.c index 17d28ce20300..a6fbb4130521 100644 --- a/trunk/kernel/rtmutex.c +++ b/trunk/kernel/rtmutex.c @@ -56,7 +56,7 @@ * state. */ -static void +void rt_mutex_set_owner(struct rt_mutex *lock, struct task_struct *owner, unsigned long mask) { @@ -80,29 +80,6 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) clear_rt_mutex_waiters(lock); } -/* - * We can speed up the acquire/release, if the architecture - * supports cmpxchg and if there's no debugging state to be set up - */ -#if defined(__HAVE_ARCH_CMPXCHG) && !defined(CONFIG_DEBUG_RT_MUTEXES) -# define rt_mutex_cmpxchg(l,c,n) (cmpxchg(&l->owner, c, n) == c) -static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) -{ - unsigned long owner, *p = (unsigned long *) &lock->owner; - - do { - owner = *p; - } while (cmpxchg(p, owner, owner | RT_MUTEX_HAS_WAITERS) != owner); -} -#else -# define rt_mutex_cmpxchg(l,c,n) (0) -static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) -{ - lock->owner = (struct task_struct *) - ((unsigned long)lock->owner | RT_MUTEX_HAS_WAITERS); -} -#endif - /* * Calculate task priority from the waiter list priority * @@ -123,7 +100,7 @@ int rt_mutex_getprio(struct task_struct *task) * * This can be both boosting and unboosting. task->pi_lock must be held. */ -static void __rt_mutex_adjust_prio(struct task_struct *task) +void __rt_mutex_adjust_prio(struct task_struct *task) { int prio = rt_mutex_getprio(task); @@ -159,11 +136,11 @@ int max_lock_depth = 1024; * Decreases task's usage by one - may thus free the task. * Returns 0 or -EDEADLK. */ -static int rt_mutex_adjust_prio_chain(struct task_struct *task, - int deadlock_detect, - struct rt_mutex *orig_lock, - struct rt_mutex_waiter *orig_waiter, - struct task_struct *top_task) +int rt_mutex_adjust_prio_chain(struct task_struct *task, + int deadlock_detect, + struct rt_mutex *orig_lock, + struct rt_mutex_waiter *orig_waiter, + struct task_struct *top_task) { struct rt_mutex *lock; struct rt_mutex_waiter *waiter, *top_waiter = orig_waiter; @@ -537,8 +514,8 @@ static void wakeup_next_waiter(struct rt_mutex *lock) * * Must be called with lock->wait_lock held */ -static void remove_waiter(struct rt_mutex *lock, - struct rt_mutex_waiter *waiter) +void remove_waiter(struct rt_mutex *lock, + struct rt_mutex_waiter *waiter) { int first = (waiter == rt_mutex_top_waiter(lock)); struct task_struct *owner = rt_mutex_owner(lock); diff --git a/trunk/kernel/rtmutex_common.h b/trunk/kernel/rtmutex_common.h index 9c75856e791e..242ec7ee740b 100644 --- a/trunk/kernel/rtmutex_common.h +++ b/trunk/kernel/rtmutex_common.h @@ -112,6 +112,29 @@ static inline unsigned long rt_mutex_owner_pending(struct rt_mutex *lock) return (unsigned long)lock->owner & RT_MUTEX_OWNER_PENDING; } +/* + * We can speed up the acquire/release, if the architecture + * supports cmpxchg and if there's no debugging state to be set up + */ +#if defined(__HAVE_ARCH_CMPXCHG) && !defined(CONFIG_DEBUG_RT_MUTEXES) +# define rt_mutex_cmpxchg(l,c,n) (cmpxchg(&l->owner, c, n) == c) +static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) +{ + unsigned long owner, *p = (unsigned long *) &lock->owner; + + do { + owner = *p; + } while (cmpxchg(p, owner, owner | RT_MUTEX_HAS_WAITERS) != owner); +} +#else +# define rt_mutex_cmpxchg(l,c,n) (0) +static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) +{ + lock->owner = (struct task_struct *) + ((unsigned long)lock->owner | RT_MUTEX_HAS_WAITERS); +} +#endif + /* * PI-futex support (proxy locking functions, etc.): */ @@ -120,4 +143,15 @@ extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner); extern void rt_mutex_proxy_unlock(struct rt_mutex *lock, struct task_struct *proxy_owner); + +extern void rt_mutex_set_owner(struct rt_mutex *lock, struct task_struct *owner, + unsigned long mask); +extern void __rt_mutex_adjust_prio(struct task_struct *task); +extern int rt_mutex_adjust_prio_chain(struct task_struct *task, + int deadlock_detect, + struct rt_mutex *orig_lock, + struct rt_mutex_waiter *orig_waiter, + struct task_struct *top_task); +extern void remove_waiter(struct rt_mutex *lock, + struct rt_mutex_waiter *waiter); #endif diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index a7475913b009..13cdab3b4c48 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -1159,72 +1159,21 @@ void wait_task_inactive(struct task_struct *p) { unsigned long flags; struct rq *rq; - struct prio_array *array; - int running; + int preempted; repeat: - /* - * We do the initial early heuristics without holding - * any task-queue locks at all. We'll only try to get - * the runqueue lock when things look like they will - * work out! - */ - rq = task_rq(p); - - /* - * If the task is actively running on another CPU - * still, just relax and busy-wait without holding - * any locks. - * - * NOTE! Since we don't hold any locks, it's not - * even sure that "rq" stays as the right runqueue! - * But we don't care, since "task_running()" will - * return false if the runqueue has changed and p - * is actually now running somewhere else! - */ - while (task_running(rq, p)) - cpu_relax(); - - /* - * Ok, time to look more closely! We need the rq - * lock now, to be *sure*. If we're wrong, we'll - * just go back and repeat. - */ rq = task_rq_lock(p, &flags); - running = task_running(rq, p); - array = p->array; - task_rq_unlock(rq, &flags); - - /* - * Was it really running after all now that we - * checked with the proper locks actually held? - * - * Oops. Go back and try again.. - */ - if (unlikely(running)) { + /* Must be off runqueue entirely, not preempted. */ + if (unlikely(p->array || task_running(rq, p))) { + /* If it's preempted, we yield. It could be a while. */ + preempted = !task_running(rq, p); + task_rq_unlock(rq, &flags); cpu_relax(); + if (preempted) + yield(); goto repeat; } - - /* - * It's not enough that it's not actively running, - * it must be off the runqueue _entirely_, and not - * preempted! - * - * So if it wa still runnable (but just not actively - * running right now), it's preempted, and we should - * yield - it could be a while. - */ - if (unlikely(array)) { - yield(); - goto repeat; - } - - /* - * Ahh, all good. It wasn't running, and it wasn't - * runnable, which means that it will never become - * running in the future either. We're all done! - */ + task_rq_unlock(rq, &flags); } /*** @@ -7122,13 +7071,12 @@ EXPORT_SYMBOL(__might_sleep); void normalize_rt_tasks(void) { struct prio_array *array; - struct task_struct *g, *p; + struct task_struct *p; unsigned long flags; struct rq *rq; read_lock_irq(&tasklist_lock); - - do_each_thread(g, p) { + for_each_process(p) { if (!rt_task(p)) continue; @@ -7146,8 +7094,7 @@ void normalize_rt_tasks(void) __task_rq_unlock(rq); spin_unlock_irqrestore(&p->pi_lock, flags); - } while_each_thread(g, p); - + } read_unlock_irq(&tasklist_lock); } diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c index f9405609774e..fe590e00db8d 100644 --- a/trunk/kernel/signal.c +++ b/trunk/kernel/signal.c @@ -363,13 +363,7 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, */ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) { - int signr = 0; - - /* We only dequeue private signals from ourselves, we don't let - * signalfd steal them - */ - if (tsk == current) - signr = __dequeue_signal(&tsk->pending, mask, info); + int signr = __dequeue_signal(&tsk->pending, mask, info); if (!signr) { signr = __dequeue_signal(&tsk->signal->shared_pending, mask, info); diff --git a/trunk/mm/hugetlb.c b/trunk/mm/hugetlb.c index a45d1f0691ce..eb7180db3033 100644 --- a/trunk/mm/hugetlb.c +++ b/trunk/mm/hugetlb.c @@ -326,10 +326,9 @@ static void set_huge_ptep_writable(struct vm_area_struct *vma, pte_t entry; entry = pte_mkwrite(pte_mkdirty(*ptep)); - if (ptep_set_access_flags(vma, address, ptep, entry, 1)) { - update_mmu_cache(vma, address, entry); - lazy_mmu_prot_update(entry); - } + ptep_set_access_flags(vma, address, ptep, entry, 1); + update_mmu_cache(vma, address, entry); + lazy_mmu_prot_update(entry); } diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index f64cbf9baa36..cb94488ab96d 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -1691,10 +1691,9 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, flush_cache_page(vma, address, pte_pfn(orig_pte)); entry = pte_mkyoung(orig_pte); entry = maybe_mkwrite(pte_mkdirty(entry), vma); - if (ptep_set_access_flags(vma, address, page_table, entry,1)) { - update_mmu_cache(vma, address, entry); - lazy_mmu_prot_update(entry); - } + ptep_set_access_flags(vma, address, page_table, entry, 1); + update_mmu_cache(vma, address, entry); + lazy_mmu_prot_update(entry); ret |= VM_FAULT_WRITE; goto unlock; } @@ -2526,9 +2525,10 @@ static inline int handle_pte_fault(struct mm_struct *mm, pte_t *pte, pmd_t *pmd, int write_access) { pte_t entry; + pte_t old_entry; spinlock_t *ptl; - entry = *pte; + old_entry = entry = *pte; if (!pte_present(entry)) { if (pte_none(entry)) { if (vma->vm_ops) { @@ -2561,7 +2561,8 @@ static inline int handle_pte_fault(struct mm_struct *mm, entry = pte_mkdirty(entry); } entry = pte_mkyoung(entry); - if (ptep_set_access_flags(vma, address, pte, entry, write_access)) { + if (!pte_same(old_entry, entry)) { + ptep_set_access_flags(vma, address, pte, entry, write_access); update_mmu_cache(vma, address, entry); lazy_mmu_prot_update(entry); } else { diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 05ace44852eb..bd8e33582d25 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -1968,7 +1968,7 @@ void zone_init_free_lists(struct pglist_data *pgdat, struct zone *zone, memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY) #endif -static int __devinit zone_batchsize(struct zone *zone) +static int __cpuinit zone_batchsize(struct zone *zone) { int batch; diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index fa28b1623644..c9ab68881b43 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -2436,7 +2436,6 @@ EXPORT_SYMBOL(krealloc); void __init kmem_cache_init(void) { int i; - int caches = 0; #ifdef CONFIG_NUMA /* @@ -2447,29 +2446,20 @@ void __init kmem_cache_init(void) create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node", sizeof(struct kmem_cache_node), GFP_KERNEL); kmalloc_caches[0].refcount = -1; - caches++; #endif /* Able to allocate the per node structures */ slab_state = PARTIAL; /* Caches that are not of the two-to-the-power-of size */ - if (KMALLOC_MIN_SIZE <= 64) { - create_kmalloc_cache(&kmalloc_caches[1], + create_kmalloc_cache(&kmalloc_caches[1], "kmalloc-96", 96, GFP_KERNEL); - caches++; - } - if (KMALLOC_MIN_SIZE <= 128) { - create_kmalloc_cache(&kmalloc_caches[2], + create_kmalloc_cache(&kmalloc_caches[2], "kmalloc-192", 192, GFP_KERNEL); - caches++; - } - for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) { + for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) create_kmalloc_cache(&kmalloc_caches[i], "kmalloc", 1 << i, GFP_KERNEL); - caches++; - } slab_state = UP; @@ -2486,8 +2476,8 @@ void __init kmem_cache_init(void) nr_cpu_ids * sizeof(struct page *); printk(KERN_INFO "SLUB: Genslabs=%d, HWalign=%d, Order=%d-%d, MinObjects=%d," - " CPUs=%d, Nodes=%d\n", - caches, cache_line_size(), + " Processors=%d, Nodes=%d\n", + KMALLOC_SHIFT_HIGH, cache_line_size(), slub_min_order, slub_max_order, slub_min_objects, nr_cpu_ids, nr_node_ids); } @@ -2877,7 +2867,7 @@ static int alloc_loc_track(struct loc_track *t, unsigned long max) order = get_order(sizeof(struct location) * max); - l = (void *)__get_free_pages(GFP_ATOMIC, order); + l = (void *)__get_free_pages(GFP_KERNEL, order); if (!l) return 0; diff --git a/trunk/net/ipv4/tcp_bic.c b/trunk/net/ipv4/tcp_bic.c index dd9ef65ad3ff..281c9f913257 100644 --- a/trunk/net/ipv4/tcp_bic.c +++ b/trunk/net/ipv4/tcp_bic.c @@ -29,7 +29,7 @@ static int fast_convergence = 1; static int max_increment = 16; static int low_window = 14; static int beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ -static int initial_ssthresh; +static int initial_ssthresh = 100; static int smooth_part = 20; module_param(fast_convergence, int, 0644); diff --git a/trunk/net/ipv4/tcp_cubic.c b/trunk/net/ipv4/tcp_cubic.c index ebfaac2f9f46..14224487b16b 100644 --- a/trunk/net/ipv4/tcp_cubic.c +++ b/trunk/net/ipv4/tcp_cubic.c @@ -29,7 +29,7 @@ static int fast_convergence __read_mostly = 1; static int max_increment __read_mostly = 16; static int beta __read_mostly = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ -static int initial_ssthresh __read_mostly; +static int initial_ssthresh __read_mostly = 100; static int bic_scale __read_mostly = 41; static int tcp_friendliness __read_mostly = 1; diff --git a/trunk/net/ipv4/tcp_illinois.c b/trunk/net/ipv4/tcp_illinois.c index b2b2256d3b84..4adc47c55351 100644 --- a/trunk/net/ipv4/tcp_illinois.c +++ b/trunk/net/ipv4/tcp_illinois.c @@ -90,9 +90,6 @@ static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked, ktime_t last) ca->acked = pkts_acked; - if (ktime_equal(last, net_invalid_timestamp())) - return; - rtt = ktime_to_us(net_timedelta(last)); /* ignore bogus values, this prevents wraparound in alpha math */ diff --git a/trunk/net/ipv4/tcp_input.c b/trunk/net/ipv4/tcp_input.c index 69f9f1ef3ef6..74683d81c3f1 100644 --- a/trunk/net/ipv4/tcp_input.c +++ b/trunk/net/ipv4/tcp_input.c @@ -953,7 +953,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ int prior_fackets; u32 lost_retrans = 0; int flag = 0; - int found_dup_sack = 0; + int dup_sack = 0; int cached_fack_count; int i; int first_sack_index; @@ -964,20 +964,20 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ /* Check for D-SACK. */ if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) { - found_dup_sack = 1; + dup_sack = 1; tp->rx_opt.sack_ok |= 4; NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); } else if (num_sacks > 1 && !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) && !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) { - found_dup_sack = 1; + dup_sack = 1; tp->rx_opt.sack_ok |= 4; NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV); } /* D-SACK for already forgotten data... * Do dumb counting. */ - if (found_dup_sack && + if (dup_sack && !after(ntohl(sp[0].end_seq), prior_snd_una) && after(ntohl(sp[0].end_seq), tp->undo_marker)) tp->undo_retrans--; @@ -1058,7 +1058,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ __u32 start_seq = ntohl(sp->start_seq); __u32 end_seq = ntohl(sp->end_seq); int fack_count; - int dup_sack = (found_dup_sack && (i == first_sack_index)); skb = cached_skb; fack_count = cached_fack_count; @@ -2038,7 +2037,7 @@ static void tcp_try_to_open(struct sock *sk, int flag) { struct tcp_sock *tp = tcp_sk(sk); - tcp_sync_left_out(tp); + tp->left_out = tp->sacked_out; if (tp->retrans_out == 0) tp->retrans_stamp = 0; @@ -2410,7 +2409,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p) int acked = 0; int prior_packets = tp->packets_out; __s32 seq_rtt = -1; - ktime_t last_ackt = net_invalid_timestamp(); + ktime_t last_ackt = ktime_set(0,0); while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) { @@ -2488,10 +2487,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p) tcp_ack_update_rtt(sk, acked, seq_rtt); tcp_ack_packets_out(sk); - /* Is the ACK triggering packet unambiguous? */ - if (acked & FLAG_RETRANS_DATA_ACKED) - last_ackt = net_invalid_timestamp(); - if (ca_ops->pkts_acked) ca_ops->pkts_acked(sk, pkts_acked, last_ackt); } @@ -2937,7 +2932,6 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, opt_rx->sack_ok) { TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th; } - break; #ifdef CONFIG_TCP_MD5SIG case TCPOPT_MD5SIG: /* diff --git a/trunk/net/ipv4/tcp_ipv4.c b/trunk/net/ipv4/tcp_ipv4.c index 354721d67f69..97e294e82679 100644 --- a/trunk/net/ipv4/tcp_ipv4.c +++ b/trunk/net/ipv4/tcp_ipv4.c @@ -878,7 +878,6 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, kfree(newkey); return -ENOMEM; } - sk->sk_route_caps &= ~NETIF_F_GSO_MASK; } if (tcp_alloc_md5sig_pool() == NULL) { kfree(newkey); @@ -1008,7 +1007,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval, return -EINVAL; tp->md5sig_info = p; - sk->sk_route_caps &= ~NETIF_F_GSO_MASK; + } newkey = kmemdup(cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); diff --git a/trunk/net/ipv4/tcp_lp.c b/trunk/net/ipv4/tcp_lp.c index e49836ce012e..43294ad9f63e 100644 --- a/trunk/net/ipv4/tcp_lp.c +++ b/trunk/net/ipv4/tcp_lp.c @@ -266,8 +266,7 @@ static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked, ktime_t last) struct tcp_sock *tp = tcp_sk(sk); struct lp *lp = inet_csk_ca(sk); - if (!ktime_equal(last, net_invalid_timestamp())) - tcp_lp_rtt_sample(sk, ktime_to_us(net_timedelta(last))); + tcp_lp_rtt_sample(sk, ktime_to_us(net_timedelta(last))); /* calc inference */ if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) diff --git a/trunk/net/ipv4/tcp_vegas.c b/trunk/net/ipv4/tcp_vegas.c index e218a51ceced..73e19cf7df21 100644 --- a/trunk/net/ipv4/tcp_vegas.c +++ b/trunk/net/ipv4/tcp_vegas.c @@ -117,9 +117,6 @@ void tcp_vegas_pkts_acked(struct sock *sk, u32 cnt, ktime_t last) struct vegas *vegas = inet_csk_ca(sk); u32 vrtt; - if (ktime_equal(last, net_invalid_timestamp())) - return; - /* Never allow zero rtt or baseRTT */ vrtt = ktime_to_us(net_timedelta(last)) + 1; diff --git a/trunk/net/ipv4/tcp_veno.c b/trunk/net/ipv4/tcp_veno.c index ec854cc5fad5..9edb340f2f95 100644 --- a/trunk/net/ipv4/tcp_veno.c +++ b/trunk/net/ipv4/tcp_veno.c @@ -74,9 +74,6 @@ static void tcp_veno_pkts_acked(struct sock *sk, u32 cnt, ktime_t last) struct veno *veno = inet_csk_ca(sk); u32 vrtt; - if (ktime_equal(last, net_invalid_timestamp())) - return; - /* Never allow zero rtt or baseRTT */ vrtt = ktime_to_us(net_timedelta(last)) + 1; diff --git a/trunk/net/ipv6/addrconf.c b/trunk/net/ipv6/addrconf.c index f96ed76d8fa4..5a5f8bd4597a 100644 --- a/trunk/net/ipv6/addrconf.c +++ b/trunk/net/ipv6/addrconf.c @@ -2154,15 +2154,6 @@ static void addrconf_dev_config(struct net_device *dev) ASSERT_RTNL(); - if ((dev->type != ARPHRD_ETHER) && - (dev->type != ARPHRD_FDDI) && - (dev->type != ARPHRD_IEEE802_TR) && - (dev->type != ARPHRD_ARCNET) && - (dev->type != ARPHRD_INFINIBAND)) { - /* Alas, we support only Ethernet autoconfiguration. */ - return; - } - idev = addrconf_add_dev(dev); if (idev == NULL) return; @@ -2250,16 +2241,36 @@ static void addrconf_ip6_tnl_config(struct net_device *dev) ip6_tnl_add_linklocal(idev); } +static int ipv6_hwtype(struct net_device *dev) +{ + if ((dev->type == ARPHRD_ETHER) || + (dev->type == ARPHRD_LOOPBACK) || + (dev->type == ARPHRD_SIT) || + (dev->type == ARPHRD_TUNNEL6) || + (dev->type == ARPHRD_FDDI) || + (dev->type == ARPHRD_IEEE802_TR) || + (dev->type == ARPHRD_ARCNET) || + (dev->type == ARPHRD_INFINIBAND)) + return 1; + + return 0; +} + static int addrconf_notify(struct notifier_block *this, unsigned long event, void * data) { struct net_device *dev = (struct net_device *) data; - struct inet6_dev *idev = __in6_dev_get(dev); + struct inet6_dev *idev; int run_pending = 0; + if (!ipv6_hwtype(dev)) + return NOTIFY_OK; + + idev = __in6_dev_get(dev); + switch(event) { case NETDEV_REGISTER: - if (!idev && dev->mtu >= IPV6_MIN_MTU) { + if (!idev) { idev = ipv6_add_dev(dev); if (!idev) printk(KERN_WARNING "IPv6: add_dev failed for %s\n", diff --git a/trunk/net/ipv6/tcp_ipv6.c b/trunk/net/ipv6/tcp_ipv6.c index 193d9d60bb7a..4f06a51ad4fd 100644 --- a/trunk/net/ipv6/tcp_ipv6.c +++ b/trunk/net/ipv6/tcp_ipv6.c @@ -590,7 +590,6 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, kfree(newkey); return -ENOMEM; } - sk->sk_route_caps &= ~NETIF_F_GSO_MASK; } tcp_alloc_md5sig_pool(); if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) { @@ -725,7 +724,6 @@ static int tcp_v6_parse_md5_keys (struct sock *sk, char __user *optval, return -ENOMEM; tp->md5sig_info = p; - sk->sk_route_caps &= ~NETIF_F_GSO_MASK; } newkey = kmemdup(cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); diff --git a/trunk/net/irda/irlap_event.c b/trunk/net/irda/irlap_event.c index a8b8873aa263..0b02073ffdf3 100644 --- a/trunk/net/irda/irlap_event.c +++ b/trunk/net/irda/irlap_event.c @@ -316,6 +316,23 @@ void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, } } +/* + * Function irlap_next_state (self, state) + * + * Switches state and provides debug information + * + */ +static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state) +{ + /* + if (!self || self->magic != LAP_MAGIC) + return; + + IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]); + */ + self->state = state; +} + /* * Function irlap_state_ndm (event, skb, frame) * @@ -1069,6 +1086,7 @@ static int irlap_state_xmit_p(struct irlap_cb *self, IRLAP_EVENT event, } else { /* Final packet of window */ irlap_send_data_primary_poll(self, skb); + irlap_next_state(self, LAP_NRM_P); /* * Make sure state machine does not try to send @@ -1418,14 +1436,14 @@ static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event, */ self->remote_busy = FALSE; - /* Stop final timer */ - del_timer(&self->final_timer); - /* * Nr as expected? */ ret = irlap_validate_nr_received(self, info->nr); if (ret == NR_EXPECTED) { + /* Stop final timer */ + del_timer(&self->final_timer); + /* Update Nr received */ irlap_update_nr_received(self, info->nr); @@ -1457,12 +1475,14 @@ static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event, /* Resend rejected frames */ irlap_resend_rejected_frames(self, CMD_FRAME); - irlap_start_final_timer(self, self->final_timeout * 2); + + /* Final timer ??? Jean II */ irlap_next_state(self, LAP_NRM_P); } else if (ret == NR_INVALID) { IRDA_DEBUG(1, "%s(), Received RR with " "invalid nr !\n", __FUNCTION__); + del_timer(&self->final_timer); irlap_next_state(self, LAP_RESET_WAIT); diff --git a/trunk/net/irda/irlap_frame.c b/trunk/net/irda/irlap_frame.c index 3013c49ab975..3c5a68e36414 100644 --- a/trunk/net/irda/irlap_frame.c +++ b/trunk/net/irda/irlap_frame.c @@ -798,19 +798,16 @@ void irlap_send_data_primary_poll(struct irlap_cb *self, struct sk_buff *skb) self->vs = (self->vs + 1) % 8; self->ack_required = FALSE; - irlap_next_state(self, LAP_NRM_P); irlap_send_i_frame(self, tx_skb, CMD_FRAME); } else { IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__); if (self->ack_required) { irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME); - irlap_next_state(self, LAP_NRM_P); irlap_send_rr_frame(self, CMD_FRAME); self->ack_required = FALSE; } else { skb->data[1] |= PF_BIT; - irlap_next_state(self, LAP_NRM_P); irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME); } } diff --git a/trunk/net/mac80211/debugfs.c b/trunk/net/mac80211/debugfs.c index 476c8486f789..bb6c0feb2d48 100644 --- a/trunk/net/mac80211/debugfs.c +++ b/trunk/net/mac80211/debugfs.c @@ -112,7 +112,7 @@ DEBUGFS_READONLY_FILE(wep_iv, 20, "%#06x", local->wep_iv & 0xffffff); DEBUGFS_READONLY_FILE(tx_power_reduction, 20, "%d.%d dBm", local->hw.conf.tx_power_reduction / 10, - local->hw.conf.tx_power_reduction % 10); + local->hw.conf.tx_power_reduction & 10); DEBUGFS_READONLY_FILE(rate_ctrl_alg, 100, "%s", local->rate_ctrl ? local->rate_ctrl->ops->name : ""); diff --git a/trunk/net/mac80211/ieee80211_sta.c b/trunk/net/mac80211/ieee80211_sta.c index 91b545c144c1..9f30ae4c2ab3 100644 --- a/trunk/net/mac80211/ieee80211_sta.c +++ b/trunk/net/mac80211/ieee80211_sta.c @@ -2592,17 +2592,11 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) read_lock(&local->sub_if_lock); list_for_each_entry(sdata, &local->sub_if_list, list) { - - /* No need to wake the master device. */ - if (sdata->dev == local->mdev) - continue; - if (sdata->type == IEEE80211_IF_TYPE_STA) { if (sdata->u.sta.associated) ieee80211_send_nullfunc(local, sdata, 0); ieee80211_sta_timer((unsigned long)sdata); } - netif_wake_queue(sdata->dev); } read_unlock(&local->sub_if_lock); @@ -2744,12 +2738,6 @@ static int ieee80211_sta_start_scan(struct net_device *dev, read_lock(&local->sub_if_lock); list_for_each_entry(sdata, &local->sub_if_list, list) { - - /* Don't stop the master interface, otherwise we can't transmit - * probes! */ - if (sdata->dev == local->mdev) - continue; - netif_stop_queue(sdata->dev); if (sdata->type == IEEE80211_IF_TYPE_STA && sdata->u.sta.associated) diff --git a/trunk/net/rxrpc/ar-connection.c b/trunk/net/rxrpc/ar-connection.c index 482750efc235..43cb3e051ece 100644 --- a/trunk/net/rxrpc/ar-connection.c +++ b/trunk/net/rxrpc/ar-connection.c @@ -211,7 +211,7 @@ static struct rxrpc_connection *rxrpc_alloc_connection(gfp_t gfp) conn->header_size = sizeof(struct rxrpc_header); } - _leave(" = %p{%d}", conn, conn ? conn->debug_id : 0); + _leave(" = %p{%d}", conn, conn->debug_id); return conn; } diff --git a/trunk/net/sctp/associola.c b/trunk/net/sctp/associola.c index 498edb0cd4e5..df94e3cdfba3 100644 --- a/trunk/net/sctp/associola.c +++ b/trunk/net/sctp/associola.c @@ -1231,10 +1231,6 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc) /* Get the lowest pmtu of all the transports. */ list_for_each(pos, &asoc->peer.transport_addr_list) { t = list_entry(pos, struct sctp_transport, transports); - if (t->pmtu_pending && t->dst) { - sctp_transport_update_pmtu(t, dst_mtu(t->dst)); - t->pmtu_pending = 0; - } if (!pmtu || (t->pathmtu < pmtu)) pmtu = t->pathmtu; } diff --git a/trunk/net/sctp/input.c b/trunk/net/sctp/input.c index d57ff7f3c576..885109fb3dda 100644 --- a/trunk/net/sctp/input.c +++ b/trunk/net/sctp/input.c @@ -367,18 +367,24 @@ static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb) void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, struct sctp_transport *t, __u32 pmtu) { - if (!t || (t->pathmtu == pmtu)) + if (sock_owned_by_user(sk) || !t || (t->pathmtu == pmtu)) return; - if (sock_owned_by_user(sk)) { - asoc->pmtu_pending = 1; - t->pmtu_pending = 1; - return; - } - if (t->param_flags & SPP_PMTUD_ENABLE) { - /* Update transports view of the MTU */ - sctp_transport_update_pmtu(t, pmtu); + if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { + printk(KERN_WARNING "%s: Reported pmtu %d too low, " + "using default minimum of %d\n", + __FUNCTION__, pmtu, + SCTP_DEFAULT_MINSEGMENT); + /* Use default minimum segment size and disable + * pmtu discovery on this transport. + */ + t->pathmtu = SCTP_DEFAULT_MINSEGMENT; + t->param_flags = (t->param_flags & ~SPP_PMTUD) | + SPP_PMTUD_DISABLE; + } else { + t->pathmtu = pmtu; + } /* Update association pmtu. */ sctp_assoc_sync_pmtu(asoc); diff --git a/trunk/net/sctp/socket.c b/trunk/net/sctp/socket.c index 6edaaa009d62..4dcdabf56473 100644 --- a/trunk/net/sctp/socket.c +++ b/trunk/net/sctp/socket.c @@ -333,19 +333,12 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len) if (!sp->pf->bind_verify(sp, addr)) return -EADDRNOTAVAIL; - /* We must either be unbound, or bind to the same port. - * It's OK to allow 0 ports if we are already bound. - * We'll just inhert an already bound port in this case - */ - if (bp->port) { - if (!snum) - snum = bp->port; - else if (snum != bp->port) { - SCTP_DEBUG_PRINTK("sctp_do_bind:" + /* We must either be unbound, or bind to the same port. */ + if (bp->port && (snum != bp->port)) { + SCTP_DEBUG_PRINTK("sctp_do_bind:" " New port %d does not match existing port " "%d.\n", snum, bp->port); - return -EINVAL; - } + return -EINVAL; } if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE)) @@ -1662,9 +1655,6 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, goto out_free; } - if (asoc->pmtu_pending) - sctp_assoc_pending_pmtu(asoc); - /* If fragmentation is disabled and the message length exceeds the * association fragmentation point, return EMSGSIZE. The I-D * does not specify what this error is, but this looks like @@ -3560,7 +3550,6 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc, struct sock *sk = asoc->base.sk; struct socket *sock; struct inet_sock *inetsk; - struct sctp_af *af; int err = 0; /* An association cannot be branched off from an already peeled-off @@ -3582,9 +3571,8 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc, /* Make peeled-off sockets more like 1-1 accepted sockets. * Set the daddr and initialize id to something more random */ - af = sctp_get_af_specific(asoc->peer.primary_addr.sa.sa_family); - af->to_sk_daddr(&asoc->peer.primary_addr, sk); inetsk = inet_sk(sock->sk); + inetsk->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr; inetsk->id = asoc->next_tsn ^ jiffies; *sockp = sock; @@ -4355,12 +4343,11 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, err = -EFAULT; goto error; } - if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num)) { - err = -EFAULT; - goto error; - } + if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num)) + return -EFAULT; if (put_user(bytes_copied, optlen)) - err = -EFAULT; + return -EFAULT; + error: kfree(addrs); return err; diff --git a/trunk/net/sctp/transport.c b/trunk/net/sctp/transport.c index 5f467c914f80..961df275d5b9 100644 --- a/trunk/net/sctp/transport.c +++ b/trunk/net/sctp/transport.c @@ -241,45 +241,6 @@ void sctp_transport_pmtu(struct sctp_transport *transport) transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; } -/* this is a complete rip-off from __sk_dst_check - * the cookie is always 0 since this is how it's used in the - * pmtu code - */ -static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) -{ - struct dst_entry *dst = t->dst; - - if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) { - dst_release(t->dst); - t->dst = NULL; - return NULL; - } - - return dst; -} - -void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu) -{ - struct dst_entry *dst; - - if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { - printk(KERN_WARNING "%s: Reported pmtu %d too low, " - "using default minimum of %d\n", - __FUNCTION__, pmtu, - SCTP_DEFAULT_MINSEGMENT); - /* Use default minimum segment size and disable - * pmtu discovery on this transport. - */ - t->pathmtu = SCTP_DEFAULT_MINSEGMENT; - } else { - t->pathmtu = pmtu; - } - - dst = sctp_transport_dst_check(t); - if (dst) - dst->ops->update_pmtu(dst, pmtu); -} - /* Caches the dst entry and source address for a transport's destination * address. */ diff --git a/trunk/net/wireless/sysfs.c b/trunk/net/wireless/sysfs.c index 88aaacd9f822..3ebae1442963 100644 --- a/trunk/net/wireless/sysfs.c +++ b/trunk/net/wireless/sysfs.c @@ -33,7 +33,7 @@ static ssize_t _show_permaddr(struct device *dev, struct device_attribute *attr, char *buf) { - unsigned char *addr = dev_to_rdev(dev)->wiphy.perm_addr; + char *addr = dev_to_rdev(dev)->wiphy.perm_addr; return sprintf(buf, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); diff --git a/trunk/scripts/mod/modpost.c b/trunk/scripts/mod/modpost.c index 3645e980da71..8e5610d428c5 100644 --- a/trunk/scripts/mod/modpost.c +++ b/trunk/scripts/mod/modpost.c @@ -1052,7 +1052,6 @@ static int init_section_ref_ok(const char *name) ".plt", /* seen on ARCH=um build on x86_64. Harmless */ "__ftr_fixup", /* powerpc cpu feature fixup */ "__fw_ftr_fixup", /* powerpc firmware feature fixup */ - ".cranges", /* used by sh64 */ NULL }; /* Start of section names */ @@ -1133,7 +1132,6 @@ static int exit_section_ref_ok(const char *name) ".fixup", ".smp_locks", ".plt", /* seen on ARCH=um build on x86_64. Harmless */ - ".cranges", /* used by sh64 */ NULL }; /* Start of section names */ diff --git a/trunk/sound/ppc/pmac.c b/trunk/sound/ppc/pmac.c index 7a22f0f3784a..5a2bef44a2f5 100644 --- a/trunk/sound/ppc/pmac.c +++ b/trunk/sound/ppc/pmac.c @@ -775,8 +775,7 @@ static int snd_pmac_free(struct snd_pmac *chip) out_le32(&chip->awacs->control, in_le32(&chip->awacs->control) & 0xfff); } - if (chip->node) - snd_pmac_sound_feature(chip, 0); + snd_pmac_sound_feature(chip, 0); /* clean up mixer if any */ if (chip->mixer_free) @@ -926,7 +925,6 @@ static int __init snd_pmac_detect(struct snd_pmac *chip) } if (! sound) { of_node_put(chip->node); - chip->node = NULL; return -ENODEV; } prop = of_get_property(sound, "sub-frame", NULL); @@ -939,9 +937,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip) printk(KERN_INFO "snd-powermac no longer handles any " "machines with a layout-id property " "in the device-tree, use snd-aoa.\n"); - of_node_put(sound); of_node_put(chip->node); - chip->node = NULL; return -ENODEV; } /* This should be verified on older screamers */ @@ -1301,6 +1297,8 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) return 0; __error: + if (chip->pdev) + pci_dev_put(chip->pdev); snd_pmac_free(chip); return err; }