diff --git a/arch/arm/configs/sun8iw7p1smp_defconfig b/arch/arm/configs/sun8iw7p1smp_defconfig index a7fefe88ff3655..7da55329583e66 100755 --- a/arch/arm/configs/sun8iw7p1smp_defconfig +++ b/arch/arm/configs/sun8iw7p1smp_defconfig @@ -108,17 +108,7 @@ CONFIG_NET_NS=y # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="output/rootfs.cpio.gz" -CONFIG_INITRAMFS_ROOT_UID=0 -CONFIG_INITRAMFS_ROOT_GID=0 -CONFIG_RD_GZIP=y -# CONFIG_RD_BZIP2 is not set -# CONFIG_RD_LZMA is not set -# CONFIG_RD_XZ is not set -# CONFIG_RD_LZO is not set -CONFIG_INITRAMFS_COMPRESSION_NONE=y -# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set +# CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y CONFIG_ANON_INODES=y @@ -471,7 +461,7 @@ CONFIG_ZONE_DMA_FLAG=0 CONFIG_BOUNCE=y CONFIG_VIRT_TO_BUS=y # CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 # CONFIG_CLEANCACHE is not set CONFIG_FORCE_MAX_ZONEORDER=11 CONFIG_ALIGNMENT_TRAP=y @@ -487,10 +477,10 @@ CONFIG_ARM_FLUSH_CONSOLE_ON_RESTART=y # CONFIG_USE_OF is not set CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_CMDLINE="earlyprintk=ttyS0,115200 loglevel=8 initcall_debug=0 console=ttyS0,115200 init=/init " +CONFIG_CMDLINE="" # CONFIG_CMDLINE_FROM_BOOTLOADER is not set # CONFIG_CMDLINE_EXTEND is not set -CONFIG_CMDLINE_FORCE=y +# CONFIG_CMDLINE_FORCE is not set # CONFIG_XIP_KERNEL is not set # CONFIG_KEXEC is not set # CONFIG_CRASH_DUMP is not set @@ -658,7 +648,7 @@ CONFIG_IPV6_TUNNEL=y CONFIG_IPV6_MULTIPLE_TABLES=y # CONFIG_IPV6_SUBTREES is not set # CONFIG_IPV6_MROUTE is not set -CONFIG_ANDROID_PARANOID_NETWORK=y +# CONFIG_ANDROID_PARANOID_NETWORK is not set CONFIG_NET_ACTIVITY_STATS=y CONFIG_NETWORK_SECMARK=y # CONFIG_NETWORK_PHY_TIMESTAMPING is not set @@ -1209,6 +1199,7 @@ CONFIG_NET_VENDOR_SUNXI=y CONFIG_SUNXI_GETH=y CONFIG_GETH_SCRIPT_SYS=y CONFIG_GETH_CLK_SYS=y +CONFIG_GMAC_PHY_POWER=y CONFIG_PHYLIB=y # @@ -2062,10 +2053,12 @@ CONFIG_VIDEO_ENCODER_DECODER_SUNXI=y # # Graphics support # -# CONFIG_DRM is not set +CONFIG_DRM=m +CONFIG_DRM_MALI=m CONFIG_ION=y CONFIG_ION_SUNXI=y CONFIG_ION_SUNXI_RESERVE_LIST="160M@0,256M@0,130M@1,200M@1" +CONFIG_MALI=m # CONFIG_VGASTATE is not set # CONFIG_VIDEO_OUTPUT_CONTROL is not set CONFIG_FB=y @@ -2097,7 +2090,7 @@ CONFIG_FB=y # # CONFIG_FB_CONSOLE_SUNXI is not set CONFIG_DISP2_SUNXI=y -CONFIG_HDMI_DISP2_SUNXI=m +CONFIG_HDMI_DISP2_SUNXI=y CONFIG_TV_DISP2_SUNXI=m # CONFIG_DISP2_SUNXI_BOOT_COLORBAR is not set CONFIG_DISP2_SUNXI_DEBUG=y @@ -3102,7 +3095,6 @@ CONFIG_XZ_DEC_ARMTHUMB=y CONFIG_XZ_DEC_SPARC=y CONFIG_XZ_DEC_BCJ=y # CONFIG_XZ_DEC_TEST is not set -CONFIG_DECOMPRESS_GZIP=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_TEXTSEARCH=y CONFIG_TEXTSEARCH_KMP=y diff --git a/arch/arm/mach-sunxi/power/brom/Makefile b/arch/arm/mach-sunxi/power/brom/Makefile index b7b36d81ff0ef8..488cd6b66a5aef 100755 --- a/arch/arm/mach-sunxi/power/brom/Makefile +++ b/arch/arm/mach-sunxi/power/brom/Makefile @@ -22,21 +22,21 @@ resumes-y := resumes.o \ resumes-y := $(addprefix $(obj)/,$(resumes-y)) -$(obj)/resumes.code: $(obj)/resumes.bin - $(Q)$(obj)/gen_check_code $(obj)/resumes.bin $(obj)/resumes.code +$(obj)/resumes.code: $(src)/gen_check_code $(obj)/resumes.bin + $(Q)$< $(obj)/resumes.bin $(obj)/resumes.code $(obj)/resumes.bin: $(obj)/resumes.elf FORCE $(Q)$(CROSS_COMPILE)objcopy -O binary $(obj)/resumes.elf $(obj)/resumes.bin ifneq ($(strip $(CONFIG_ARCH_SUN9I)),) -$(obj)/resumes.elf: $(obj)/sun9i_brom_scatter.scat $(resumes-y) - $(Q)$(CROSS_COMPILE)ld -T $(obj)/sun9i_brom_scatter.scat -EL $(resumes-y) -o $(obj)/resumes.elf -Map $(obj)/resumes.map +$(obj)/resumes.elf: $(src)/sun9i_brom_scatter.scat $(resumes-y) + $(Q)$(CROSS_COMPILE)ld -T $< -EL $(resumes-y) -o $(obj)/resumes.elf -Map $(obj)/resumes.map $(Q)$(CROSS_COMPILE)objdump -D $(obj)/resumes.elf > $(obj)/resumes.lst endif ifneq ($(strip $(CONFIG_ARCH_SUN8I)),) -$(obj)/resumes.elf: $(obj)/sun8i_brom_scatter.scat $(resumes-y) - $(Q)$(CROSS_COMPILE)ld -T $(obj)/sun8i_brom_scatter.scat -EL $(resumes-y) -o $(obj)/resumes.elf -Map $(obj)/resumes.map +$(obj)/resumes.elf: $(src)/sun8i_brom_scatter.scat $(resumes-y) + $(Q)$(CROSS_COMPILE)ld -T $< -EL $(resumes-y) -o $(obj)/resumes.elf -Map $(obj)/resumes.map $(Q)$(CROSS_COMPILE)objdump -D $(obj)/resumes.elf > $(obj)/resumes.lst endif diff --git a/drivers/arisc/binary/Makefile b/drivers/arisc/binary/Makefile index ab3d5d2376fda1..08b81fd5a3a397 100755 --- a/drivers/arisc/binary/Makefile +++ b/drivers/arisc/binary/Makefile @@ -29,8 +29,8 @@ ifdef CONFIG_ARCH_SUN9IW1P1 PLATFORM=arisc_sun9iw1p1 endif -$(obj)/$(PLATFORM).bin : $(obj)/$(PLATFORM).code - cp $(obj)/$(PLATFORM).code $(obj)/$(PLATFORM).tar.bz2; \ +$(obj)/$(PLATFORM).bin : $(src)/$(PLATFORM).code + cp $< $(obj)/$(PLATFORM).tar.bz2; \ tar -xjvf $(obj)/$(PLATFORM).tar.bz2 -C $(obj)/; \ cp $(obj)/arisc_package/$(PLATFORM).bin $(obj)/$(PLATFORM).bin; \ cp $(obj)/arisc_package/$(PLATFORM).tar.bz2.aes $(obj)/arisc; \ diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index e354bc0b052a22..10e1797bf2fd68 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -172,6 +172,13 @@ config DRM_VIA Choose this option if you have a Via unichrome or compatible video chipset. If M is selected the module will be called via. +config DRM_MALI + tristate "Mali DRM supprt" + depends on DRM + help + Choose this option if you have a Mali 200 or Mali 400 gpu + If M is selected the module will be called mali_drm. + config DRM_SAVAGE tristate "Savage video cards" depends on DRM && PCI diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index c20da5bda3551c..e94a1a804bf563 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_DRM_SIS) += sis/ obj-$(CONFIG_DRM_SAVAGE)+= savage/ obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/ obj-$(CONFIG_DRM_VIA) +=via/ +obj-$(CONFIG_DRM_MALI) += mali/ obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/ obj-$(CONFIG_DRM_EXYNOS) +=exynos/ obj-$(CONFIG_DRM_GMA500) += gma500/ diff --git a/drivers/gpu/drm/mali/Makefile b/drivers/gpu/drm/mali/Makefile new file mode 100644 index 00000000000000..c9a9a8305cf2db --- /dev/null +++ b/drivers/gpu/drm/mali/Makefile @@ -0,0 +1,20 @@ +# +# * Copyright (C) 2010 ARM Limited. All rights reserved. +# * +# * This program is free software and is provided to you under the terms of the GNU General Public License version 2 +# * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. +# * +# * A copy of the licence is included with the program, and can also be obtained from Free Software +# * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# Makefile for the Mali drm device driver. This driver provides support for the +# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. + +ccflags-y = -Iinclude/drm -Larch/arm/mach-sun4i/devices.o +mali_drm-y := mali_drv.o + +obj-$(CONFIG_DRM_MALI) += mali_drm.o + + diff --git a/drivers/gpu/drm/mali/mali_drv.c b/drivers/gpu/drm/mali/mali_drv.c new file mode 100644 index 00000000000000..ac0138c1972c4a --- /dev/null +++ b/drivers/gpu/drm/mali/mali_drv.c @@ -0,0 +1,190 @@ +/** + * Copyright (C) 2010 ARM Limited. All rights reserved. + * + * This program is free software and is provided to you under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. + * + * A copy of the licence is included with the program, and can also be obtained from Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * @file mali_drv.c + * Implementation of the Linux device driver entrypoints for Mali DRM + */ + +#include +#include +#include +#include "mali_drv.h" + +static struct platform_device *dev0; +static struct platform_device *dev1; + +void mali_drm_preclose(struct drm_device *dev, struct drm_file *file_priv) +{ +} + +void mali_drm_lastclose(struct drm_device *dev) +{ +} + +static int mali_drm_suspend(struct drm_device *dev, pm_message_t state) +{ + return 0; +} + +static int mali_drm_resume(struct drm_device *dev) +{ + return 0; +} + +static int mali_drm_load(struct drm_device *dev, unsigned long chipset) +{ + return 0; +} + +static int mali_drm_unload(struct drm_device *dev) +{ + return 0; +} + +static struct file_operations mali_fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .unlocked_ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, +}; + +static struct drm_driver driver = +{ + .driver_features = DRIVER_BUS_PLATFORM, + .load = mali_drm_load, + .unload = mali_drm_unload, + .context_dtor = NULL, + .reclaim_buffers = NULL, + .reclaim_buffers_idlelocked = NULL, + .preclose = mali_drm_preclose, + .lastclose = mali_drm_lastclose, + .suspend = mali_drm_suspend, + .resume = mali_drm_resume, + .ioctls = NULL, + .fops = &mali_fops, + .name = DRIVER_NAME, + .desc = DRIVER_DESC, + .date = DRIVER_DATE, + .major = DRIVER_MAJOR, + .minor = DRIVER_MINOR, + .patchlevel = DRIVER_PATCHLEVEL, +}; + +static struct drm_driver driver1 = +{ + .driver_features = DRIVER_BUS_PLATFORM, + .load = mali_drm_load, + .unload = mali_drm_unload, + .context_dtor = NULL, + .reclaim_buffers = NULL, + .reclaim_buffers_idlelocked = NULL, + .preclose = mali_drm_preclose, + .lastclose = mali_drm_lastclose, + .suspend = mali_drm_suspend, + .resume = mali_drm_resume, + .ioctls = NULL, + .fops = &mali_fops, + .name = DRIVER_NAME, + .desc = DRIVER_DESC, + .date = DRIVER_DATE, + .major = DRIVER_MAJOR, + .minor = DRIVER_MINOR, + .patchlevel = DRIVER_PATCHLEVEL, +}; + +int mali_drm_init(struct platform_device *dev) +{ + printk(KERN_INFO "Mali DRM initialize, driver name: %s, version %d.%d\n", DRIVER_NAME, DRIVER_MAJOR, DRIVER_MINOR); + if (dev == dev0) { + driver.num_ioctls = 0; + driver.kdriver.platform_device = dev; + return drm_platform_init(&driver, dev); + } else if (dev == dev1) { + driver1.num_ioctls = 0; + driver1.kdriver.platform_device = dev; + return drm_platform_init(&driver1, dev); + } + return 0; +} + +void mali_drm_exit(struct platform_device *dev) +{ + if (driver.kdriver.platform_device == dev) { + drm_platform_exit(&driver, dev); + } else if (driver1.kdriver.platform_device == dev) { + drm_platform_exit(&driver1, dev); + } +} + +static int __devinit mali_platform_drm_probe(struct platform_device *dev) +{ + return mali_drm_init(dev); +} + +static int mali_platform_drm_remove(struct platform_device *dev) +{ + mali_drm_exit(dev); + + return 0; +} + +static int mali_platform_drm_suspend(struct platform_device *dev, pm_message_t state) +{ + return 0; +} + +static int mali_platform_drm_resume(struct platform_device *dev) +{ + return 0; +} + + +static struct platform_driver platform_drm_driver = { + .probe = mali_platform_drm_probe, + .remove = __devexit_p(mali_platform_drm_remove), + .suspend = mali_platform_drm_suspend, + .resume = mali_platform_drm_resume, + .driver = { + .owner = THIS_MODULE, + .name = DRIVER_NAME, + }, +}; + +static int __init mali_platform_drm_init(void) +{ + dev0 = platform_device_register_simple("mali_drm", 0, NULL, 0); + dev1 = platform_device_register_simple("mali_drm", 1, NULL, 0); + return platform_driver_register( &platform_drm_driver ); +} + +static void __exit mali_platform_drm_exit(void) +{ + platform_driver_unregister( &platform_drm_driver ); + platform_device_unregister(dev0); + platform_device_unregister(dev1); +} + +#ifdef MODULE +module_init(mali_platform_drm_init); +#else +late_initcall(mali_platform_drm_init); +#endif +module_exit(mali_platform_drm_exit); + +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_VERSION(DRIVER_VERSION); +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_LICENSE(DRIVER_LICENSE); +MODULE_ALIAS(DRIVER_ALIAS); +MODULE_INFO(vermagic, VERMAGIC_STRING); diff --git a/drivers/gpu/drm/mali/mali_drv.h b/drivers/gpu/drm/mali/mali_drv.h new file mode 100644 index 00000000000000..188f427ee6d873 --- /dev/null +++ b/drivers/gpu/drm/mali/mali_drv.h @@ -0,0 +1,25 @@ +/** + * Copyright (C) 2010 ARM Limited. All rights reserved. + * + * This program is free software and is provided to you under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. + * + * A copy of the licence is included with the program, and can also be obtained from Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _MALI_DRV_H_ +#define _MALI_DRV_H_ + +#define DRIVER_AUTHOR "ARM Ltd." +#define DRIVER_NAME "mali_drm" +#define DRIVER_DESC "DRM module for Mali-200, Mali-400" +#define DRIVER_LICENSE "GPL v2" +#define DRIVER_ALIAS "platform:mali_drm" +#define DRIVER_DATE "20101111" +#define DRIVER_VERSION "0.2" +#define DRIVER_MAJOR 2 +#define DRIVER_MINOR 1 +#define DRIVER_PATCHLEVEL 1 + +#endif /* _MALI_DRV_H_ */ diff --git a/drivers/net/ethernet/sunxi/eth/Kconfig b/drivers/net/ethernet/sunxi/eth/Kconfig index 13787db7a8db47..af930df0246892 100755 --- a/drivers/net/ethernet/sunxi/eth/Kconfig +++ b/drivers/net/ethernet/sunxi/eth/Kconfig @@ -35,5 +35,13 @@ config GETH_PHY_POWER If external PHY power is exist, and it want to be controled, select it. If not, it mean the power of PHY already on. +config GMAC_PHY_POWER + bool "External PHY power control" + depends on SUNXI_GETH + default y + ---help--- + If external PHY power is exist, and it want to be controled, + select it. If not, it mean the power of PHY already on. + endif diff --git a/drivers/net/ethernet/sunxi/eth/sunxi_geth.c b/drivers/net/ethernet/sunxi/eth/sunxi_geth.c index 7c48f7b0dd56a1..03931f287f9d14 100755 --- a/drivers/net/ethernet/sunxi/eth/sunxi_geth.c +++ b/drivers/net/ethernet/sunxi/eth/sunxi_geth.c @@ -154,6 +154,9 @@ struct geth_priv { spinlock_t lock; spinlock_t tx_lock; +#ifdef CONFIG_GMAC_PHY_POWER + u32 gpio_power_hd; +#endif }; #ifdef CONFIG_GETH_PHY_POWER @@ -195,6 +198,11 @@ static void desc_print(struct dma_desc *desc, int size) static int geth_power_on(struct geth_priv *priv) { int value; + +#ifdef CONFIG_GMAC_PHY_POWER + gpio_set_value(priv->gpio_power_hd, 1); +#endif + #ifdef CONFIG_GETH_PHY_POWER struct regulator **regu; int ret = 0, i = 0; @@ -258,6 +266,11 @@ static int geth_power_on(struct geth_priv *priv) static void geth_power_off(struct geth_priv *priv) { int value; + +#ifdef CONFIG_GMAC_PHY_POWER + gpio_set_value(priv->gpio_power_hd, 0); +#endif + #ifdef CONFIG_GETH_PHY_POWER struct regulator **regu = priv->power; int i = 0; @@ -1608,6 +1621,12 @@ static int geth_sys_request(struct platform_device *pdev) int ret = 0; struct resource *res; +#ifdef CONFIG_GMAC_PHY_POWER + script_item_value_type_e type; + script_item_u item; + int req_status; +#endif + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "geth_extclk"); if (unlikely(!res)){ ret = -ENODEV; @@ -1681,6 +1700,22 @@ static int geth_sys_request(struct platform_device *pdev) } } #endif + +#ifdef CONFIG_GMAC_PHY_POWER && CONFIG_GETH_SCRIPT_SYS + type = script_get_item("gmac_phy_power", "gmac_phy_power_en", &item); + if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) { + pr_err("script_get_item return type err\n"); + return -EFAULT; + } + /*request gpio*/ + req_status = gpio_request(item.gpio.gpio, NULL); + if (0 != req_status) { + pr_err("request gpio failed!\n"); + } + gpio_direction_output(item.gpio.gpio, 1); + priv->gpio_power_hd = item.gpio.gpio; + #endif + return 0; pin_err: diff --git a/drivers/net/wireless/rtl8188eu/include/ieee80211.h b/drivers/net/wireless/rtl8188eu/include/ieee80211.h index fc293c45759882..0898cd47e40c3d 100755 --- a/drivers/net/wireless/rtl8188eu/include/ieee80211.h +++ b/drivers/net/wireless/rtl8188eu/include/ieee80211.h @@ -1314,18 +1314,18 @@ enum ieee80211_state { (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else -extern __inline int is_multicast_mac_addr(const u8 *addr) +static __inline int is_multicast_mac_addr(const u8 *addr) { return ((addr[0] != 0xff) && (0x01 & addr[0])); } -extern __inline int is_broadcast_mac_addr(const u8 *addr) +static __inline int is_broadcast_mac_addr(const u8 *addr) { return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } -extern __inline int is_zero_mac_addr(const u8 *addr) +static __inline int is_zero_mac_addr(const u8 *addr) { return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); diff --git a/drivers/net/wireless/rtl8189es/include/ieee80211.h b/drivers/net/wireless/rtl8189es/include/ieee80211.h index fc293c45759882..0898cd47e40c3d 100755 --- a/drivers/net/wireless/rtl8189es/include/ieee80211.h +++ b/drivers/net/wireless/rtl8189es/include/ieee80211.h @@ -1314,18 +1314,18 @@ enum ieee80211_state { (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else -extern __inline int is_multicast_mac_addr(const u8 *addr) +static __inline int is_multicast_mac_addr(const u8 *addr) { return ((addr[0] != 0xff) && (0x01 & addr[0])); } -extern __inline int is_broadcast_mac_addr(const u8 *addr) +static __inline int is_broadcast_mac_addr(const u8 *addr) { return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } -extern __inline int is_zero_mac_addr(const u8 *addr) +static __inline int is_zero_mac_addr(const u8 *addr) { return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); diff --git a/drivers/net/wireless/rtl8723bs/include/ieee80211.h b/drivers/net/wireless/rtl8723bs/include/ieee80211.h index fc293c45759882..0898cd47e40c3d 100755 --- a/drivers/net/wireless/rtl8723bs/include/ieee80211.h +++ b/drivers/net/wireless/rtl8723bs/include/ieee80211.h @@ -1314,18 +1314,18 @@ enum ieee80211_state { (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else -extern __inline int is_multicast_mac_addr(const u8 *addr) +static __inline int is_multicast_mac_addr(const u8 *addr) { return ((addr[0] != 0xff) && (0x01 & addr[0])); } -extern __inline int is_broadcast_mac_addr(const u8 *addr) +static __inline int is_broadcast_mac_addr(const u8 *addr) { return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } -extern __inline int is_zero_mac_addr(const u8 *addr) +static __inline int is_zero_mac_addr(const u8 *addr) { return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); diff --git a/drivers/staging/rtl8712/ieee80211.h b/drivers/staging/rtl8712/ieee80211.h index 3c0092b7de0941..1e7b55bc956852 100644 --- a/drivers/staging/rtl8712/ieee80211.h +++ b/drivers/staging/rtl8712/ieee80211.h @@ -734,7 +734,7 @@ enum ieee80211_state { #define IEEE_G (1<<2) #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) -extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) +static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) { /* Single white space is for Linksys APs */ if (essid_len == 1 && essid[0] == ' ') @@ -748,7 +748,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) return 1; } -extern inline int ieee80211_get_hdrlen(u16 fc) +static inline int ieee80211_get_hdrlen(u16 fc) { int hdrlen = 24; diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h new file mode 100644 index 00000000000000..cdd1cc202d51ef --- /dev/null +++ b/include/linux/compiler-gcc5.h @@ -0,0 +1,66 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif + +#define __used __attribute__((__used__)) +#define __must_check __attribute__((warn_unused_result)) +#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) + +/* Mark functions as cold. gcc will assume any path leading to a call + to them will be unlikely. This means a lot of manual unlikely()s + are unnecessary now for any paths leading to the usual suspects + like BUG(), printk(), panic() etc. [but let's keep them for now for + older compilers] + + Early snapshots of gcc 4.3 don't support this and we can't detect this + in the preprocessor, but we can live with this because they're unreleased. + Maketime probing would be overkill here. + + gcc also has a __attribute__((__hot__)) to move hot functions into + a special section, but I don't see any sense in this right now in + the kernel context */ +#define __cold __attribute__((__cold__)) + +#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) + +#ifndef __CHECKER__ +# define __compiletime_warning(message) __attribute__((warning(message))) +# define __compiletime_error(message) __attribute__((error(message))) +#endif /* __CHECKER__ */ + +/* + * Mark a position in code as unreachable. This can be used to + * suppress control flow warnings after asm blocks that transfer + * control elsewhere. + * + * Early snapshots of gcc 4.5 don't support this and we can't detect + * this in the preprocessor, but we can live with this because they're + * unreleased. Really, we need to have autoconf for the kernel. + */ +#define unreachable() __builtin_unreachable() + +/* Mark a function definition as prohibited from being cloned. */ +#define __noclone __attribute__((__noclone__)) + +/* + * Tell the optimizer that something else uses this function or variable. + */ +#define __visible __attribute__((externally_visible)) + +/* + * GCC 'asm goto' miscompiles certain code sequences: + * + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 + * + * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. + * Fixed in GCC 4.8.2 and later versions. + * + * (asm goto is automatically volatile - the naming reflects this.) + */ +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) + +#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP +#define __HAVE_BUILTIN_BSWAP32__ +#define __HAVE_BUILTIN_BSWAP64__ +#define __HAVE_BUILTIN_BSWAP16__ +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */