From: Luis R. Rodriguez Date: Fri, 30 Nov 2012 01:27:25 +0000 (-0800) Subject: compat-drivers: move all patch types under patches/ X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bb67ef032a61f5d0fdc6fa32ee28ed94503555e4;p=openwrt%2Fstaging%2Fblogic.git compat-drivers: move all patch types under patches/ The number of patch directories for the different life cycle a patch can be on its way upstream had reached 4: * pending-stable * linux-next-pending * linux-next-cherry-picks * crap Apart from this we also had the backport related patches. In the future I see potential for other directories for different categories of patches. Consider how we are breaking down the backport patches into specific documented collateral evolutions and of those type of collateral evolutions there may be different types of collateral evolutions which we could likely treat / document differently. Another type of patch that I forsee us having to deal with are patches for drivers that are not upstrea -- like crap, but for drivers in a unified driver tree that is *designed* from scratch to be targetting upstream Linux inclusion using the same coccinelle technology I forsee us using for backporting collateral evolutions. Since the number of patch directories can get out of hand at the top level lets just stuff then all under patches/ and deal with patches there. This also places the backport patches into a directory called collateral-evolutions/ to help promote and educate on the nature of the changes that we have to deal with when backporting. Cc: Julia Lawall Cc: Adrian Chadd Signed-off-by: Luis R. Rodriguez --- diff --git a/crap/README b/crap/README deleted file mode 100644 index ff1ae85c2523..000000000000 --- a/crap/README +++ /dev/null @@ -1,17 +0,0 @@ - -compat-drivers crap patches -============================ - -If you are including patches into this directory you -must be fixing some critical bug for a customer which needs -immediate release or immediate testing. - -Alternatively you would use this to apply some sort of -crap code you are maintaining. - -You must have a really good reason to be adding files -in this directory. If possible you should explain your -reasoning of why the patch is getting included here and -not upstream and why it hasn't even yet been posted. - -You should avoid these patches at all costs. diff --git a/linux-next-cherry-picks/README b/linux-next-cherry-picks/README deleted file mode 100644 index 101a51ad1a3a..000000000000 --- a/linux-next-cherry-picks/README +++ /dev/null @@ -1,20 +0,0 @@ -compat-drivers linux-next chery picked patches -============================================== - -We work hard to get patches in time onto the stable -tree but sometimes a few things slip out, and sometimes a -stable fix is simply too big in size to be merged into -stable. In such cases though we do believe some of these -patches are still relatively important to either enable new -hardware which escaped the late rc cycles or to correct some -behaviour which might be too late for stable. We apply -these patches by default as they will be supported on these -releases. - -The larger the number of patches you see in this directory -the more we should be ashamed. We should strive to reduce this -to 0 all the time. - -This directory will always be empty for bleeding edge -releases as bleeding edge releases are always based on -linux-next already. diff --git a/linux-next-cherry-picks/network/.gitignore b/linux-next-cherry-picks/network/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/linux-next-pending/README b/linux-next-pending/README deleted file mode 100644 index 092fc5fe6fa2..000000000000 --- a/linux-next-pending/README +++ /dev/null @@ -1,18 +0,0 @@ - -compat-drivers linux-next-pending patches -========================================== - -You must have a really good reason to be adding files -in this directory. The requirement is your patches must have -been posted to a public mailing list for the subsystem you are -working on. Each patch you add here must have a really good -explanation on the top of the file which clarifies why the -patch has not yet been merged OR specify it on the commit log -when you add it on compat-drivers. - -We try to avoid having patch files because but we understand -if you might because you need to test code posted but not yet -merged into linux-next or a stable kernel release. This can happen -often during the merge window, when the maintainers are unavailable, -on vacation, suck at what they do, or for any other uncontrollable -reasons. diff --git a/linux-next-pending/network/.gitignore b/linux-next-pending/network/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/patches/README b/patches/README deleted file mode 100644 index 3e3b4d8c581d..000000000000 --- a/patches/README +++ /dev/null @@ -1,16 +0,0 @@ - -compat-drivers patches -======================= - -You must have a really good reason to be adding files -in this directory. Your reasoning should either match the -explanation already present on the top of each patch file -or you should add your own. - -We try to avoid having patch files because: - - * Its a pain in the ass to maintain them. - - * Most backport changes can be pulled off through - some macro magic or new files which implement - the new functionality on the old kernels. diff --git a/patches/collateral-evolutions/README b/patches/collateral-evolutions/README new file mode 100644 index 000000000000..4580c0e595bd --- /dev/null +++ b/patches/collateral-evolutions/README @@ -0,0 +1,16 @@ + +compat-drivers collateral evolutions patches +============================================ + +You must have a really good reason to be adding files +in this directory. Your reasoning should either match the +explanation already present on the top of each patch file +or you should add your own. + +We try to avoid having patch files because: + + * Its a pain in the ass to maintain them. + + * Most backport changes can be pulled off through + some macro magic or new files which implement + the new functionality on the old kernels. diff --git a/patches/collateral-evolutions/drm/01-dma_buf_ops-addition.patch b/patches/collateral-evolutions/drm/01-dma_buf_ops-addition.patch new file mode 100644 index 000000000000..3decf0e27eb5 --- /dev/null +++ b/patches/collateral-evolutions/drm/01-dma_buf_ops-addition.patch @@ -0,0 +1,55 @@ +Assign vmap, vunmap and mmap fields in dma_buf_ops structs only +if kernel version >= 3.5.0 as they are added in 3.5. The begin_cpu_access +was added as of the original dma-buf code via 3.4. + +mcgrof@frijol ~/linux-next (git::master)$ git describe --contains fc13020e086bfedf2afb95c91c026d5af1f80107 +v3.4-rc1~57^2~3 + +Note that the dma-buf itself was added with 3.4. It is not available +on kernels < 3.4. + +--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c ++++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c +@@ -215,10 +215,14 @@ static const struct dma_buf_ops i915_dma + .kmap_atomic = i915_gem_dmabuf_kmap_atomic, + .kunmap = i915_gem_dmabuf_kunmap, + .kunmap_atomic = i915_gem_dmabuf_kunmap_atomic, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .mmap = i915_gem_dmabuf_mmap, + .vmap = i915_gem_dmabuf_vmap, + .vunmap = i915_gem_dmabuf_vunmap, ++#endif ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + .begin_cpu_access = i915_gem_begin_cpu_access, ++#endif + }; + + struct dma_buf *i915_gem_prime_export(struct drm_device *dev, +--- a/drivers/gpu/drm/nouveau/nouveau_prime.c ++++ b/drivers/gpu/drm/nouveau/nouveau_prime.c +@@ -132,9 +132,11 @@ static const struct dma_buf_ops nouveau_ + .kmap_atomic = nouveau_gem_kmap_atomic, + .kunmap = nouveau_gem_kunmap, + .kunmap_atomic = nouveau_gem_kunmap_atomic, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .mmap = nouveau_gem_prime_mmap, + .vmap = nouveau_gem_prime_vmap, + .vunmap = nouveau_gem_prime_vunmap, ++#endif + }; + + static int +--- a/drivers/gpu/drm/radeon/radeon_prime.c ++++ b/drivers/gpu/drm/radeon/radeon_prime.c +@@ -133,9 +133,11 @@ const static struct dma_buf_ops radeon_d + .kmap_atomic = radeon_gem_kmap_atomic, + .kunmap = radeon_gem_kunmap, + .kunmap_atomic = radeon_gem_kunmap_atomic, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .mmap = radeon_gem_prime_mmap, + .vmap = radeon_gem_prime_vmap, + .vunmap = radeon_gem_prime_vunmap, ++#endif + }; + + static int radeon_prime_create(struct drm_device *dev, diff --git a/patches/collateral-evolutions/drm/02-revert-vm_mmap.patch b/patches/collateral-evolutions/drm/02-revert-vm_mmap.patch new file mode 100644 index 000000000000..b96562e600f4 --- /dev/null +++ b/patches/collateral-evolutions/drm/02-revert-vm_mmap.patch @@ -0,0 +1,94 @@ +vm_mmap() and vm_munmap() were introduced in kernels >= 3.4.0. Revert +those changes for versions older than that. + +These can't be backported as they rely on non-exported symbols. + +--- a/drivers/gpu/drm/drm_bufs.c ++++ b/drivers/gpu/drm/drm_bufs.c +@@ -1541,6 +1541,20 @@ int drm_mapbufs(struct drm_device *dev, + retcode = -EINVAL; + goto done; + } ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) ++ down_write(¤t->mm->mmap_sem); ++ virtual = do_mmap(file_priv->filp, 0, map->size, ++ PROT_READ | PROT_WRITE, ++ MAP_SHARED, ++ token); ++ up_write(¤t->mm->mmap_sem); ++ } else { ++ down_write(¤t->mm->mmap_sem); ++ virtual = do_mmap(file_priv->filp, 0, dma->byte_count, ++ PROT_READ | PROT_WRITE, ++ MAP_SHARED, 0); ++ up_write(¤t->mm->mmap_sem); ++#else + virtual = vm_mmap(file_priv->filp, 0, map->size, + PROT_READ | PROT_WRITE, + MAP_SHARED, +@@ -1549,6 +1563,7 @@ int drm_mapbufs(struct drm_device *dev, + virtual = vm_mmap(file_priv->filp, 0, dma->byte_count, + PROT_READ | PROT_WRITE, + MAP_SHARED, 0); ++#endif + } + if (virtual > -1024UL) { + /* Real error */ +--- a/drivers/gpu/drm/i810/i810_dma.c ++++ b/drivers/gpu/drm/i810/i810_dma.c +@@ -135,9 +135,17 @@ static int i810_map_buffer(struct drm_bu + old_fops = file_priv->filp->f_op; + file_priv->filp->f_op = &i810_buffer_fops; + dev_priv->mmap_buffer = buf; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) ++ down_write(¤t->mm->mmap_sem); ++ buf_priv->virtual = (void *)do_mmap(file_priv->filp, 0, buf->total, ++ PROT_READ | PROT_WRITE, ++ MAP_SHARED, buf->bus_address); ++ up_write(¤t->mm->mmap_sem); ++#else + buf_priv->virtual = (void *)vm_mmap(file_priv->filp, 0, buf->total, + PROT_READ | PROT_WRITE, + MAP_SHARED, buf->bus_address); ++#endif + dev_priv->mmap_buffer = NULL; + file_priv->filp->f_op = old_fops; + if (IS_ERR(buf_priv->virtual)) { +@@ -158,9 +166,15 @@ static int i810_unmap_buffer(struct drm_ + if (buf_priv->currently_mapped != I810_BUF_MAPPED) + return -EINVAL; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) ++ down_write(¤t->mm->mmap_sem); ++ retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual, ++ (size_t) buf->total); ++ up_write(¤t->mm->mmap_sem); ++#else + retcode = vm_munmap((unsigned long)buf_priv->virtual, + (size_t) buf->total); +- ++#endif + buf_priv->currently_mapped = I810_BUF_UNMAPPED; + buf_priv->virtual = NULL; + +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -1295,10 +1295,17 @@ i915_gem_mmap_ioctl(struct drm_device *d + drm_gem_object_unreference_unlocked(obj); + return -EINVAL; + } +- ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) ++ down_write(¤t->mm->mmap_sem); ++ addr = do_mmap(obj->filp, 0, args->size, ++ PROT_READ | PROT_WRITE, MAP_SHARED, ++ args->offset); ++ up_write(¤t->mm->mmap_sem); ++#else + addr = vm_mmap(obj->filp, 0, args->size, + PROT_READ | PROT_WRITE, MAP_SHARED, + args->offset); ++#endif + drm_gem_object_unreference_unlocked(obj); + if (IS_ERR((void *)addr)) + return addr; diff --git a/patches/collateral-evolutions/drm/03-swiotlb.patch b/patches/collateral-evolutions/drm/03-swiotlb.patch new file mode 100644 index 000000000000..697c0634b751 --- /dev/null +++ b/patches/collateral-evolutions/drm/03-swiotlb.patch @@ -0,0 +1,83 @@ + +swiotlb_nr_tbl() was available since 3.2 but was exported since 3.3. +Since it uses an internal global state variable, it is impossible +to backport it to compat.git. So revert the changes. + +--- a/drivers/gpu/drm/nouveau/nouveau_bo.c ++++ b/drivers/gpu/drm/nouveau/nouveau_bo.c +@@ -1376,11 +1376,13 @@ nouveau_ttm_tt_populate(struct ttm_tt *t + } + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + #ifdef CONFIG_SWIOTLB + if (swiotlb_nr_tbl()) { + return ttm_dma_populate((void *)ttm, dev->dev); + } + #endif ++#endif + + r = ttm_pool_populate(ttm); + if (r) { +@@ -1426,12 +1428,14 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt + } + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + #ifdef CONFIG_SWIOTLB + if (swiotlb_nr_tbl()) { + ttm_dma_unpopulate((void *)ttm, dev->dev); + return; + } + #endif ++#endif + + for (i = 0; i < ttm->num_pages; i++) { + if (ttm_dma->dma_address[i]) { +--- a/drivers/gpu/drm/radeon/radeon_ttm.c ++++ b/drivers/gpu/drm/radeon/radeon_ttm.c +@@ -601,11 +601,13 @@ static int radeon_ttm_tt_populate(struct + } + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + #ifdef CONFIG_SWIOTLB + if (swiotlb_nr_tbl()) { + return ttm_dma_populate(>t->ttm, rdev->dev); + } + #endif ++#endif + + r = ttm_pool_populate(ttm); + if (r) { +@@ -647,12 +649,14 @@ static void radeon_ttm_tt_unpopulate(str + } + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + #ifdef CONFIG_SWIOTLB + if (swiotlb_nr_tbl()) { + ttm_dma_unpopulate(>t->ttm, rdev->dev); + return; + } + #endif ++#endif + + for (i = 0; i < ttm->num_pages; i++) { + if (gtt->ttm.dma_address[i]) { +@@ -875,6 +879,7 @@ static int radeon_ttm_debugfs_init(struc + radeon_mem_types_list[i].show = &ttm_page_alloc_debugfs; + radeon_mem_types_list[i].driver_features = 0; + radeon_mem_types_list[i++].data = NULL; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + #ifdef CONFIG_SWIOTLB + if (swiotlb_nr_tbl()) { + sprintf(radeon_mem_types_names[i], "ttm_dma_page_pool"); +@@ -884,6 +889,7 @@ static int radeon_ttm_debugfs_init(struc + radeon_mem_types_list[i++].data = NULL; + } + #endif ++#endif + return radeon_debugfs_add_files(rdev, radeon_mem_types_list, i); + + #endif diff --git a/patches/collateral-evolutions/drm/04-revert-prime-support.patch b/patches/collateral-evolutions/drm/04-revert-prime-support.patch new file mode 100644 index 000000000000..e12c396d3044 --- /dev/null +++ b/patches/collateral-evolutions/drm/04-revert-prime-support.patch @@ -0,0 +1,351 @@ +Disable PRIME support in core drm, radeon, nouveau and i915 for +kernels < 3.4.0. + +PRIME depends on dma-buf which is added to the kernel with 3.3 but +the one in 3.3 is mostly stub, e.g. it is a skeleton API which +is highly modified in 3.4. So disable PRIME for kernels < 3.4.0, +not < 3.3.0. + +--- a/drivers/gpu/drm/drm_drv.c ++++ b/drivers/gpu/drm/drm_drv.c +@@ -137,8 +137,10 @@ static struct drm_ioctl_desc drm_ioctls[ + + DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETRESOURCES, drm_mode_getresources, DRM_CONTROL_ALLOW|DRM_UNLOCKED), + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + DRM_IOCTL_DEF(DRM_IOCTL_PRIME_HANDLE_TO_FD, drm_prime_handle_to_fd_ioctl, DRM_AUTH|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_PRIME_FD_TO_HANDLE, drm_prime_fd_to_handle_ioctl, DRM_AUTH|DRM_UNLOCKED), ++#endif + + DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPLANERESOURCES, drm_mode_getplane_res, DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCRTC, drm_mode_getcrtc, DRM_CONTROL_ALLOW|DRM_UNLOCKED), +--- a/drivers/gpu/drm/drm_fops.c ++++ b/drivers/gpu/drm/drm_fops.c +@@ -283,8 +283,10 @@ static int drm_open_helper(struct inode + if (dev->driver->driver_features & DRIVER_GEM) + drm_gem_open(dev, priv); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + if (drm_core_check_feature(dev, DRIVER_PRIME)) + drm_prime_init_file_private(&priv->prime); ++#endif + + if (dev->driver->open) { + ret = dev->driver->open(dev, priv); +@@ -537,8 +539,10 @@ int drm_release(struct inode *inode, str + if (dev->driver->postclose) + dev->driver->postclose(dev, file_priv); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + if (drm_core_check_feature(dev, DRIVER_PRIME)) + drm_prime_destroy_file_private(&file_priv->prime); ++#endif + + put_pid(file_priv->pid); + kfree(file_priv); +--- a/drivers/gpu/drm/drm_gem.c ++++ b/drivers/gpu/drm/drm_gem.c +@@ -35,7 +35,9 @@ + #include + #include + #include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + #include ++#endif + #include + + /** @file drm_gem.c +@@ -204,6 +206,7 @@ EXPORT_SYMBOL(drm_gem_object_alloc); + static void + drm_gem_remove_prime_handles(struct drm_gem_object *obj, struct drm_file *filp) + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + if (obj->import_attach) { + drm_prime_remove_imported_buf_handle(&filp->prime, + obj->import_attach->dmabuf); +@@ -212,6 +215,7 @@ drm_gem_remove_prime_handles(struct drm_ + drm_prime_remove_imported_buf_handle(&filp->prime, + obj->export_dma_buf); + } ++#endif + } + + /** +--- a/drivers/gpu/drm/drm_prime.c ++++ b/drivers/gpu/drm/drm_prime.c +@@ -26,6 +26,8 @@ + * + */ + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) ++ + #include + #include + #include +@@ -350,3 +352,4 @@ void drm_prime_remove_imported_buf_handl + mutex_unlock(&prime_fpriv->lock); + } + EXPORT_SYMBOL(drm_prime_remove_imported_buf_handle); ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ +--- a/drivers/gpu/drm/nouveau/nouveau_prime.c ++++ b/drivers/gpu/drm/nouveau/nouveau_prime.c +@@ -24,6 +24,7 @@ + + #include + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + #include + + #include "nouveau_drm.h" +@@ -228,4 +229,4 @@ fail_detach: + dma_buf_detach(dma_buf, attach); + return ERR_PTR(ret); + } +- ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ +--- a/drivers/gpu/drm/radeon/radeon_prime.c ++++ b/drivers/gpu/drm/radeon/radeon_prime.c +@@ -23,6 +23,7 @@ + * + * Authors: Alex Deucher + */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + #include + + #include "radeon.h" +@@ -225,3 +226,4 @@ fail_detach: + dma_buf_detach(dma_buf, attach); + return ERR_PTR(ret); + } ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ +--- a/drivers/gpu/drm/radeon/radeon_drv.c ++++ b/drivers/gpu/drm/radeon/radeon_drv.c +@@ -354,8 +354,10 @@ static const struct file_operations rade + static struct drm_driver kms_driver = { + .driver_features = + DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | +- DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_GEM | +- DRIVER_PRIME, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) ++ DRIVER_PRIME | ++#endif ++ DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_GEM, + .dev_priv_size = 0, + .load = radeon_driver_load_kms, + .firstopen = radeon_driver_firstopen_kms, +@@ -390,10 +392,12 @@ static struct drm_driver kms_driver = { + .dumb_destroy = radeon_mode_dumb_destroy, + .fops = &radeon_driver_kms_fops, + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + .prime_handle_to_fd = drm_gem_prime_handle_to_fd, + .prime_fd_to_handle = drm_gem_prime_fd_to_handle, + .gem_prime_export = radeon_gem_prime_export, + .gem_prime_import = radeon_gem_prime_import, ++#endif + + .name = DRIVER_NAME, + .desc = DRIVER_DESC, +--- a/drivers/gpu/drm/radeon/radeon_gem.c ++++ b/drivers/gpu/drm/radeon/radeon_gem.c +@@ -41,8 +41,10 @@ void radeon_gem_object_free(struct drm_g + struct radeon_bo *robj = gem_to_radeon_bo(gobj); + + if (robj) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + if (robj->gem_base.import_attach) + drm_prime_gem_destroy(&robj->gem_base, robj->tbo.sg); ++#endif + radeon_bo_unref(&robj); + } + } +--- a/drivers/gpu/drm/radeon/radeon_ttm.c ++++ b/drivers/gpu/drm/radeon/radeon_ttm.c +@@ -582,17 +582,21 @@ static int radeon_ttm_tt_populate(struct + struct radeon_ttm_tt *gtt = (void *)ttm; + unsigned i; + int r; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); ++#endif + + if (ttm->state != tt_unpopulated) + return 0; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + if (slave && ttm->sg) { + drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages, + gtt->ttm.dma_address, ttm->num_pages); + ttm->state = tt_unbound; + return 0; + } ++#endif + + rdev = radeon_get_rdev(ttm->bdev); + #if __OS_HAS_AGP +@@ -636,10 +640,12 @@ static void radeon_ttm_tt_unpopulate(str + struct radeon_device *rdev; + struct radeon_ttm_tt *gtt = (void *)ttm; + unsigned i; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); + + if (slave) + return; ++#endif + + rdev = radeon_get_rdev(ttm->bdev); + #if __OS_HAS_AGP +--- a/drivers/gpu/drm/nouveau/nouveau_bo.c ++++ b/drivers/gpu/drm/nouveau/nouveau_bo.c +@@ -1354,11 +1354,14 @@ nouveau_ttm_tt_populate(struct ttm_tt *t + struct drm_device *dev; + unsigned i; + int r; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); ++#endif + + if (ttm->state != tt_unpopulated) + return 0; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + if (slave && ttm->sg) { + /* make userspace faulting work */ + drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages, +@@ -1366,6 +1369,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *t + ttm->state = tt_unbound; + return 0; + } ++#endif + + drm = nouveau_bdev(ttm->bdev); + dev = drm->dev; +@@ -1413,10 +1417,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt + struct nouveau_drm *drm; + struct drm_device *dev; + unsigned i; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); + + if (slave) + return; ++#endif + + drm = nouveau_bdev(ttm->bdev); + dev = drm->dev; +--- a/drivers/gpu/drm/nouveau/nouveau_drm.c ++++ b/drivers/gpu/drm/nouveau/nouveau_drm.c +@@ -591,7 +591,10 @@ driver = { + .driver_features = + DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG | + DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | +- DRIVER_MODESET | DRIVER_PRIME, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) ++ DRIVER_PRIME | ++#endif ++ DRIVER_MODESET, + + .load = nouveau_drm_load, + .unload = nouveau_drm_unload, +@@ -612,10 +615,12 @@ driver = { + .ioctls = nouveau_ioctls, + .fops = &nouveau_driver_fops, + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + .prime_handle_to_fd = drm_gem_prime_handle_to_fd, + .prime_fd_to_handle = drm_gem_prime_fd_to_handle, + .gem_prime_export = nouveau_gem_prime_export, + .gem_prime_import = nouveau_gem_prime_import, ++#endif + + .gem_init_object = nouveau_gem_object_new, + .gem_free_object = nouveau_gem_object_del, +--- a/drivers/gpu/drm/nouveau/nouveau_gem.c ++++ b/drivers/gpu/drm/nouveau/nouveau_gem.c +@@ -24,7 +24,9 @@ + * + */ + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + #include ++#endif + + #include + +@@ -57,8 +59,10 @@ nouveau_gem_object_del(struct drm_gem_ob + nouveau_bo_unpin(nvbo); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + if (gem->import_attach) + drm_prime_gem_destroy(gem, nvbo->bo.sg); ++#endif + + ttm_bo_unref(&bo); + +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -1018,7 +1018,11 @@ static struct drm_driver driver = { + */ + .driver_features = + DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | /* DRIVER_USE_MTRR |*/ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME, ++#else ++ DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM, ++#endif + .load = i915_driver_load, + .unload = i915_driver_unload, + .open = i915_driver_open, +@@ -1041,10 +1045,12 @@ static struct drm_driver driver = { + .gem_free_object = i915_gem_free_object, + .gem_vm_ops = &i915_gem_vm_ops, + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + .prime_handle_to_fd = drm_gem_prime_handle_to_fd, + .prime_fd_to_handle = drm_gem_prime_fd_to_handle, + .gem_prime_export = i915_gem_prime_export, + .gem_prime_import = i915_gem_prime_import, ++#endif + + .dumb_create = i915_gem_dumb_create, + .dumb_map_offset = i915_gem_mmap_gtt, +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -34,7 +34,9 @@ + #include + #include + #include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + #include ++#endif + + static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj); + static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj); +@@ -3778,8 +3780,10 @@ void i915_gem_free_object(struct drm_gem + + BUG_ON(obj->pages); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + if (obj->base.import_attach) + drm_prime_gem_destroy(&obj->base, NULL); ++#endif + + drm_gem_object_release(&obj->base); + i915_gem_info_remove_obj(dev_priv, obj->base.size); +--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c ++++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c +@@ -23,6 +23,7 @@ + * Authors: + * Dave Airlie + */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + #include + #include "i915_drv.h" + #include +@@ -302,3 +303,4 @@ fail_detach: + dma_buf_detach(dma_buf, attach); + return ERR_PTR(ret); + } ++#endif diff --git a/patches/collateral-evolutions/drm/05-i915-define-acpi-video-class.patch b/patches/collateral-evolutions/drm/05-i915-define-acpi-video-class.patch new file mode 100644 index 000000000000..cf7eb389c766 --- /dev/null +++ b/patches/collateral-evolutions/drm/05-i915-define-acpi-video-class.patch @@ -0,0 +1,16 @@ +The definition of ACPI_VIDEO_CLASS was moved from video.c +to video.h in 3.1. Define it here to fix build for kernels older +than 3.1. + +--- a/drivers/gpu/drm/i915/intel_opregion.c ++++ b/drivers/gpu/drm/i915/intel_opregion.c +@@ -307,6 +307,9 @@ static int intel_opregion_video_event(st + struct acpi_bus_event *event = data; + int ret = NOTIFY_OK; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) ++#define ACPI_VIDEO_CLASS "video" ++#endif + if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0) + return NOTIFY_DONE; + diff --git a/patches/collateral-evolutions/drm/06-rename-config-options.patch b/patches/collateral-evolutions/drm/06-rename-config-options.patch new file mode 100644 index 000000000000..9ad2f89b4220 --- /dev/null +++ b/patches/collateral-evolutions/drm/06-rename-config-options.patch @@ -0,0 +1,218 @@ +--- a/drivers/gpu/drm/Makefile ++++ b/drivers/gpu/drm/Makefile +@@ -15,39 +15,39 @@ drm-y := drm_auth.o drm_buffer.o d + drm_trace_points.o drm_global.o drm_prime.o + + drm-$(CONFIG_COMPAT) += drm_ioc32.o +-drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o ++drm-$(CONFIG_COMPAT_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o + drm-$(CONFIG_PCI) += ati_pcigart.o + + drm-usb-y := drm_usb.o + + drm_kms_helper-y := drm_fb_helper.o drm_crtc_helper.o drm_dp_helper.o +-drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o +-drm_kms_helper-$(CONFIG_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o ++drm_kms_helper-$(CONFIG_COMPAT_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o ++drm_kms_helper-$(CONFIG_COMPAT_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o + +-obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o ++obj-$(CONFIG_COMPAT_DRM_KMS_HELPER) += drm_kms_helper.o + + CFLAGS_drm_trace_points.o := -I$(src) + +-obj-$(CONFIG_DRM) += drm.o +-obj-$(CONFIG_DRM_USB) += drm_usb.o +-obj-$(CONFIG_DRM_TTM) += ttm/ +-obj-$(CONFIG_DRM_TDFX) += tdfx/ +-obj-$(CONFIG_DRM_R128) += r128/ +-obj-$(CONFIG_DRM_RADEON)+= radeon/ +-obj-$(CONFIG_DRM_MGA) += mga/ +-obj-$(CONFIG_DRM_I810) += i810/ +-obj-$(CONFIG_DRM_I915) += i915/ +-obj-$(CONFIG_DRM_MGAG200) += mgag200/ +-obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus/ +-obj-$(CONFIG_DRM_SIS) += sis/ +-obj-$(CONFIG_DRM_SAVAGE)+= savage/ +-obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/ +-obj-$(CONFIG_DRM_VIA) +=via/ +-obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/ +-obj-$(CONFIG_DRM_EXYNOS) +=exynos/ +-obj-$(CONFIG_DRM_GMA500) += gma500/ +-obj-$(CONFIG_DRM_UDL) += udl/ +-obj-$(CONFIG_DRM_AST) += ast/ +-obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/ +-obj-$(CONFIG_DRM_TEGRA) += tegra/ ++obj-$(CONFIG_COMPAT_DRM) += drm.o ++obj-$(CONFIG_COMPAT_DRM_USB) += drm_usb.o ++obj-$(CONFIG_COMPAT_DRM_TTM) += ttm/ ++obj-$(CONFIG_COMPAT_DRM_TDFX) += tdfx/ ++obj-$(CONFIG_COMPAT_DRM_R128) += r128/ ++obj-$(CONFIG_COMPAT_DRM_RADEON)+= radeon/ ++obj-$(CONFIG_COMPAT_DRM_MGA) += mga/ ++obj-$(CONFIG_COMPAT_DRM_I810) += i810/ ++obj-$(CONFIG_COMPAT_DRM_I915) += i915/ ++obj-$(CONFIG_COMPAT_DRM_MGAG200) += mgag200/ ++obj-$(CONFIG_COMPAT_DRM_CIRRUS_QEMU) += cirrus/ ++obj-$(CONFIG_COMPAT_DRM_SIS) += sis/ ++obj-$(CONFIG_COMPAT_DRM_SAVAGE)+= savage/ ++obj-$(CONFIG_COMPAT_DRM_VMWGFX)+= vmwgfx/ ++obj-$(CONFIG_COMPAT_DRM_VIA) +=via/ ++obj-$(CONFIG_COMPAT_DRM_NOUVEAU) +=nouveau/ ++obj-$(CONFIG_COMPAT_DRM_EXYNOS) +=exynos/ ++obj-$(CONFIG_COMPAT_DRM_GMA500) += gma500/ ++obj-$(CONFIG_COMPAT_DRM_UDL) += udl/ ++obj-$(CONFIG_COMPAT_DRM_AST) += ast/ ++obj-$(CONFIG_COMPAT_DRM_SHMOBILE) +=shmobile/ ++obj-$(CONFIG_COMPAT_DRM_TEGRA) += tegra/ + obj-y += i2c/ +--- a/drivers/gpu/drm/ast/Makefile ++++ b/drivers/gpu/drm/ast/Makefile +@@ -6,4 +6,4 @@ ccflags-y := -Iinclude/drm + + ast-y := ast_drv.o ast_main.o ast_mode.o ast_fb.o ast_ttm.o ast_post.o + +-obj-$(CONFIG_DRM_AST) := ast.o +\ No newline at end of file ++obj-$(CONFIG_COMPAT_DRM_AST) := ast.o +--- a/drivers/gpu/drm/cirrus/Makefile ++++ b/drivers/gpu/drm/cirrus/Makefile +@@ -2,4 +2,4 @@ ccflags-y := -Iinclude/drm + cirrus-y := cirrus_main.o cirrus_mode.o \ + cirrus_drv.o cirrus_fbdev.o cirrus_ttm.o + +-obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus.o ++obj-$(CONFIG_COMPAT_DRM_CIRRUS_QEMU) += cirrus.o +--- a/drivers/gpu/drm/drm_crtc_helper.c ++++ b/drivers/gpu/drm/drm_crtc_helper.c +@@ -152,7 +152,7 @@ int drm_helper_probe_single_connector_mo + goto prune; + } + +-#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE ++#ifdef CONFIG_COMPAT_DRM_LOAD_EDID_FIRMWARE + count = drm_load_edid_firmware(connector); + if (count == 0) + #endif +--- a/drivers/gpu/drm/gma500/Makefile ++++ b/drivers/gpu/drm/gma500/Makefile +@@ -49,4 +49,4 @@ gma500_gfx-$(CONFIG_DRM_MEDFIELD) += mdf + mdfld_tmd_vid.o \ + tc35876x-dsi-lvds.o + +-obj-$(CONFIG_DRM_GMA500) += gma500_gfx.o ++obj-$(CONFIG_COMPAT_DRM_GMA500) += gma500_gfx.o +--- a/drivers/gpu/drm/i2c/Makefile ++++ b/drivers/gpu/drm/i2c/Makefile +@@ -1,7 +1,7 @@ + ccflags-y := -Iinclude/drm + + ch7006-y := ch7006_drv.o ch7006_mode.o +-obj-$(CONFIG_DRM_I2C_CH7006) += ch7006.o ++obj-$(CONFIG_COMPAT_DRM_I2C_CH7006) += ch7006.o + + sil164-y := sil164_drv.o +-obj-$(CONFIG_DRM_I2C_SIL164) += sil164.o ++obj-$(CONFIG_COMPAT_DRM_I2C_SIL164) += sil164.o +--- a/drivers/gpu/drm/i810/Makefile ++++ b/drivers/gpu/drm/i810/Makefile +@@ -5,4 +5,4 @@ + ccflags-y := -Iinclude/drm + i810-y := i810_drv.o i810_dma.o + +-obj-$(CONFIG_DRM_I810) += i810.o ++obj-$(CONFIG_COMPAT_DRM_I810) += i810.o +--- a/drivers/gpu/drm/i915/Makefile ++++ b/drivers/gpu/drm/i915/Makefile +@@ -47,6 +47,6 @@ i915-$(CONFIG_COMPAT) += i915_ioc32.o + + i915-$(CONFIG_ACPI) += intel_acpi.o + +-obj-$(CONFIG_DRM_I915) += i915.o ++obj-$(CONFIG_COMPAT_DRM_I915) += i915.o + + CFLAGS_i915_trace_points.o := -I$(src) +--- a/drivers/gpu/drm/mgag200/Makefile ++++ b/drivers/gpu/drm/mgag200/Makefile +@@ -2,4 +2,4 @@ ccflags-y := -Iinclude/drm + mgag200-y := mgag200_main.o mgag200_mode.o \ + mgag200_drv.o mgag200_fb.o mgag200_i2c.o mgag200_ttm.o + +-obj-$(CONFIG_DRM_MGAG200) += mgag200.o ++obj-$(CONFIG_COMPAT_DRM_MGAG200) += mgag200.o +--- a/drivers/gpu/drm/nouveau/Makefile ++++ b/drivers/gpu/drm/nouveau/Makefile +@@ -187,6 +187,6 @@ nouveau-y += nouveau_mem.o + # other random bits + nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o + nouveau-$(CONFIG_ACPI) += nouveau_acpi.o +-nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o ++nouveau-$(CONFIG_COMPAT_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o + +-obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o ++obj-$(CONFIG_COMPAT_DRM_NOUVEAU)+= nouveau.o +--- a/drivers/gpu/drm/nouveau/nouveau_display.h ++++ b/drivers/gpu/drm/nouveau/nouveau_display.h +@@ -76,7 +76,7 @@ int nouveau_display_dumb_destroy(struct + + void nouveau_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *); + +-#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT ++#ifdef CONFIG_COMPAT_DRM_NOUVEAU_BACKLIGHT + extern int nouveau_backlight_init(struct drm_device *); + extern void nouveau_backlight_exit(struct drm_device *); + #else +--- a/drivers/gpu/drm/radeon/Makefile ++++ b/drivers/gpu/drm/radeon/Makefile +@@ -78,6 +78,6 @@ radeon-$(CONFIG_COMPAT) += radeon_ioc32. + radeon-$(CONFIG_VGA_SWITCHEROO) += radeon_atpx_handler.o + radeon-$(CONFIG_ACPI) += radeon_acpi.o + +-obj-$(CONFIG_DRM_RADEON)+= radeon.o ++obj-$(CONFIG_COMPAT_DRM_RADEON)+= radeon.o + + CFLAGS_radeon_trace_points.o := -I$(src) +--- a/drivers/gpu/drm/radeon/radeon_drv.c ++++ b/drivers/gpu/drm/radeon/radeon_drv.c +@@ -226,7 +226,7 @@ static struct pci_device_id pciidlist[] + radeon_PCI_IDS + }; + +-#if defined(CONFIG_DRM_RADEON_KMS) ++#if defined(CONFIG_COMPAT_DRM_RADEON_KMS) + MODULE_DEVICE_TABLE(pci, pciidlist); + #endif + +@@ -440,7 +440,7 @@ static int __init radeon_init(void) + #endif + /* if enabled by default */ + if (radeon_modeset == -1) { +-#ifdef CONFIG_DRM_RADEON_KMS ++#ifdef CONFIG_COMPAT_DRM_RADEON_KMS + DRM_INFO("radeon defaulting to kernel modesetting.\n"); + radeon_modeset = 1; + #else +--- a/drivers/gpu/drm/ttm/Makefile ++++ b/drivers/gpu/drm/ttm/Makefile +@@ -11,4 +11,4 @@ ifeq ($(CONFIG_SWIOTLB),y) + ttm-y += ttm_page_alloc_dma.o + endif + +-obj-$(CONFIG_DRM_TTM) += ttm.o ++obj-$(CONFIG_COMPAT_DRM_TTM) += ttm.o +--- a/drivers/gpu/drm/via/Makefile ++++ b/drivers/gpu/drm/via/Makefile +@@ -5,4 +5,4 @@ + ccflags-y := -Iinclude/drm + via-y := via_irq.o via_drv.o via_map.o via_mm.o via_dma.o via_verifier.o via_video.o via_dmablit.o + +-obj-$(CONFIG_DRM_VIA) +=via.o ++obj-$(CONFIG_COMPAT_DRM_VIA) +=via.o +--- a/drivers/gpu/drm/vmwgfx/Makefile ++++ b/drivers/gpu/drm/vmwgfx/Makefile +@@ -8,4 +8,4 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr. + vmwgfx_fence.o vmwgfx_dmabuf.o vmwgfx_scrn.o vmwgfx_context.o \ + vmwgfx_surface.o + +-obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o ++obj-$(CONFIG_COMPAT_DRM_VMWGFX) := vmwgfx.o diff --git a/patches/collateral-evolutions/drm/07-intel-gtt.patch b/patches/collateral-evolutions/drm/07-intel-gtt.patch new file mode 100644 index 000000000000..ec026e04b4dd --- /dev/null +++ b/patches/collateral-evolutions/drm/07-intel-gtt.patch @@ -0,0 +1,42 @@ +Kernels older than 3.6 don't have intel_enable_gtt() exported +and most Linux distributions have CONFIG_AGP_INTEL as built-in +(y) and as such we don't bother to make it available as +modular here. The change to export intel_enable_gtt() was +made through commit 8ecd1a66 but previous to this the driver +never called intel_enable_gtt() so we can safely assume we +can do the same for older kernels. + +There should be a way to export an intel_enable_gtt() for +kernels with CONFIG_AGP_INTEL as built-in but that itself +is a project. + +commit 8ecd1a6615f0d9de6759aafe229bc1cc4ee99c7b +Author: Daniel Vetter +Date: Thu Jun 7 15:56:03 2012 +0200 + + drm/i915: call intel_enable_gtt + + When drm/i915 is in control of the gtt, we need to call + the enable function at all the relevant places ourselves. + + Reviewed-by: Jani Nikula + Signed-off-by: Daniel Vetter + +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -3911,9 +3911,14 @@ i915_gem_init_hw(struct drm_device *dev) + drm_i915_private_t *dev_priv = dev->dev_private; + int ret; + +- if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt()) ++ if (INTEL_INFO(dev)->gen < 6) + return -EIO; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) ++ if (!intel_enable_gtt()) ++ return -EIO; ++#endif ++ + if (IS_HASWELL(dev) && (I915_READ(0x120010) == 1)) + I915_WRITE(0x9008, I915_READ(0x9008) | 0xf0000); + diff --git a/patches/collateral-evolutions/drm/08-shmem_truncate_range.patch b/patches/collateral-evolutions/drm/08-shmem_truncate_range.patch new file mode 100644 index 000000000000..1915593777ed --- /dev/null +++ b/patches/collateral-evolutions/drm/08-shmem_truncate_range.patch @@ -0,0 +1,44 @@ +Backport e2377fe0b -- this could likely be implemented +on compat.git but I'd much prefer a better review of that. +For now this stays as a patch. + +commit e2377fe0b65e3c7577ff6df1701c56ef477d336f +Author: Hugh Dickins +Date: Mon Jun 27 16:18:19 2011 -0700 + + drm/i915: use shmem_truncate_range + + The interface to ->truncate_range is changing very slightly: once "tmpfs: + take control of its truncate_range" has been applied, this can be applied. + For now there is only a slight inefficiency while this remains unapplied, + but it will soon become essential for managing shmem's use of swap. + + Change i915_gem_object_truncate() to use shmem_truncate_range() directly: + which should also spare i915 later change if we switch from + inode_operations->truncate_range to file_operations->fallocate. + + Signed-off-by: Hugh Dickins + Cc: Christoph Hellwig + Cc: Chris Wilson + Cc: Keith Packard + Cc: Dave Airlie + Signed-off-by: Andrew Morton + Signed-off-by: Linus Torvalds + +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -1650,7 +1650,14 @@ i915_gem_object_truncate(struct drm_i915 + * backing pages, *now*. + */ + inode = obj->base.filp->f_path.dentry->d_inode; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) + shmem_truncate_range(inode, 0, (loff_t)-1); ++#else ++ truncate_inode_pages(inode->i_mapping, 0); ++ if (inode->i_op->truncate_range) ++ inode->i_op->truncate_range(inode, 0, (loff_t)-1); ++#endif ++ + + obj->madv = __I915_MADV_PURGED; + } diff --git a/patches/collateral-evolutions/drm/09-nouveau-compatify-kconfig-vars.patch b/patches/collateral-evolutions/drm/09-nouveau-compatify-kconfig-vars.patch new file mode 100644 index 000000000000..ba463657f0fe --- /dev/null +++ b/patches/collateral-evolutions/drm/09-nouveau-compatify-kconfig-vars.patch @@ -0,0 +1,153 @@ +Rename CONFIG_NOUVEAU_DEBUG and CONFIG_NOUVEAU_DEBUG_DEFAULT to +CONFIG_COMPAT_*. + +--- a/drivers/gpu/drm/nouveau/core/core/option.c ++++ b/drivers/gpu/drm/nouveau/core/core/option.c +@@ -86,7 +86,7 @@ nouveau_boolopt(const char *optstr, cons + int + nouveau_dbgopt(const char *optstr, const char *sub) + { +- int mode = 1, level = CONFIG_NOUVEAU_DEBUG_DEFAULT; ++ int mode = 1, level = CONFIG_COMPAT_NOUVEAU_DEBUG_DEFAULT; + + while (optstr) { + int len = strcspn(optstr, ",="); +--- a/drivers/gpu/drm/nouveau/core/include/core/client.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/client.h +@@ -15,7 +15,7 @@ struct nouveau_client { + static inline struct nouveau_client * + nv_client(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!nv_iclass(obj, NV_CLIENT_CLASS))) + nv_assert("BAD CAST -> NvClient, %08x", nv_hclass(obj)); + #endif +--- a/drivers/gpu/drm/nouveau/core/include/core/device.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/device.h +@@ -96,7 +96,7 @@ nv_device(void *obj) + if (device->parent) + device = device->parent; + +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!nv_iclass(device, NV_SUBDEV_CLASS) || + (nv_hclass(device) & 0xff) != NVDEV_SUBDEV_DEVICE)) { + nv_assert("BAD CAST -> NvDevice, 0x%08x 0x%08x", +--- a/drivers/gpu/drm/nouveau/core/include/core/engctx.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/engctx.h +@@ -20,7 +20,7 @@ struct nouveau_engctx { + static inline struct nouveau_engctx * + nv_engctx(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!nv_iclass(obj, NV_ENGCTX_CLASS))) + nv_assert("BAD CAST -> NvEngCtx, %08x", nv_hclass(obj)); + #endif +--- a/drivers/gpu/drm/nouveau/core/include/core/engine.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/engine.h +@@ -22,7 +22,7 @@ struct nouveau_engine { + static inline struct nouveau_engine * + nv_engine(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!nv_iclass(obj, NV_ENGINE_CLASS))) + nv_assert("BAD CAST -> NvEngine, %08x", nv_hclass(obj)); + #endif +--- a/drivers/gpu/drm/nouveau/core/include/core/gpuobj.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/gpuobj.h +@@ -27,7 +27,7 @@ struct nouveau_gpuobj { + static inline struct nouveau_gpuobj * + nv_gpuobj(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!nv_iclass(obj, NV_GPUOBJ_CLASS))) + nv_assert("BAD CAST -> NvGpuObj, %08x", nv_hclass(obj)); + #endif +--- a/drivers/gpu/drm/nouveau/core/include/core/namedb.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/namedb.h +@@ -14,7 +14,7 @@ struct nouveau_namedb { + static inline struct nouveau_namedb * + nv_namedb(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!nv_iclass(obj, NV_NAMEDB_CLASS))) + nv_assert("BAD CAST -> NvNameDB, %08x", nv_hclass(obj)); + #endif +--- a/drivers/gpu/drm/nouveau/core/include/core/object.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/object.h +@@ -20,7 +20,7 @@ struct nouveau_object { + struct nouveau_object *engine; + atomic_t refcount; + atomic_t usecount; +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + #define NOUVEAU_OBJECT_MAGIC 0x75ef0bad + struct list_head list; + u32 _magic; +@@ -30,7 +30,7 @@ struct nouveau_object { + static inline struct nouveau_object * + nv_object(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (likely(obj)) { + struct nouveau_object *object = obj; + if (unlikely(object->_magic != NOUVEAU_OBJECT_MAGIC)) +--- a/drivers/gpu/drm/nouveau/core/include/core/parent.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/parent.h +@@ -29,7 +29,7 @@ struct nouveau_parent { + static inline struct nouveau_parent * + nv_parent(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!(nv_iclass(obj, NV_PARENT_CLASS)))) + nv_assert("BAD CAST -> NvParent, %08x", nv_hclass(obj)); + #endif +--- a/drivers/gpu/drm/nouveau/core/include/core/printk.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/printk.h +@@ -18,7 +18,7 @@ struct nouveau_object; + void nv_printk_(struct nouveau_object *, const char *, int, const char *, ...); + + #define nv_printk(o,l,f,a...) do { \ +- if (NV_DBG_##l <= CONFIG_NOUVEAU_DEBUG) \ ++ if (NV_DBG_##l <= CONFIG_COMPAT_NOUVEAU_DEBUG) \ + nv_printk_(nv_object(o), NV_PRINTK_##l, NV_DBG_##l, f, ##a); \ + } while(0) + +@@ -31,7 +31,7 @@ void nv_printk_(struct nouveau_object *, + #define nv_spam(o,f,a...) nv_printk((o), SPAM, f, ##a) + + #define nv_assert(f,a...) do { \ +- if (NV_DBG_FATAL <= CONFIG_NOUVEAU_DEBUG) \ ++ if (NV_DBG_FATAL <= CONFIG_COMPAT_NOUVEAU_DEBUG) \ + nv_printk_(NULL, NV_PRINTK_FATAL, NV_DBG_FATAL, f "\n", ##a); \ + BUG_ON(1); \ + } while(0) +--- a/drivers/gpu/drm/nouveau/core/include/core/subdev.h ++++ b/drivers/gpu/drm/nouveau/core/include/core/subdev.h +@@ -20,7 +20,7 @@ struct nouveau_subdev { + static inline struct nouveau_subdev * + nv_subdev(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!nv_iclass(obj, NV_SUBDEV_CLASS))) + nv_assert("BAD CAST -> NvSubDev, %08x", nv_hclass(obj)); + #endif +--- a/drivers/gpu/drm/nouveau/core/include/subdev/instmem.h ++++ b/drivers/gpu/drm/nouveau/core/include/subdev/instmem.h +@@ -16,7 +16,7 @@ struct nouveau_instobj { + static inline struct nouveau_instobj * + nv_memobj(void *obj) + { +-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA ++#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA + if (unlikely(!nv_iclass(obj, NV_MEMOBJ_CLASS))) + nv_assert("BAD CAST -> NvMemObj, %08x", nv_hclass(obj)); + #endif diff --git a/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check.patch b/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check.patch new file mode 100644 index 000000000000..8adaeb3598b3 --- /dev/null +++ b/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check.patch @@ -0,0 +1,27 @@ +acpi_get_table_with_size() was exported with kernels >= 3.6. Revert the +size checking for kernels < 3.6. + +--- a/drivers/gpu/drm/radeon/radeon_bios.c ++++ b/drivers/gpu/drm/radeon/radeon_bios.c +@@ -554,12 +554,21 @@ static bool radeon_acpi_vfct_bios(struct + { + bool ret = false; + struct acpi_table_header *hdr; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) + acpi_size tbl_size; ++#else ++ /* acpi_get_table_with_size() not exported on kernels < 3.6 */ ++ acpi_size tbl_size = 0x7fffffff; ++#endif + UEFI_ACPI_VFCT *vfct; + GOP_VBIOS_CONTENT *vbios; + VFCT_IMAGE_HEADER *vhdr; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) + if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size))) ++#else ++ if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr))) ++#endif + return false; + if (tbl_size < sizeof(UEFI_ACPI_VFCT)) { + DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n"); diff --git a/patches/collateral-evolutions/drm/98-pr_fmt.patch b/patches/collateral-evolutions/drm/98-pr_fmt.patch new file mode 100644 index 000000000000..3c9224504f3d --- /dev/null +++ b/patches/collateral-evolutions/drm/98-pr_fmt.patch @@ -0,0 +1,189 @@ + +Undef/define/include printk.h for fixing redefinition warnings +during build. + +Patch adapted from compat-wireless tree. + +--- a/drivers/gpu/drm/drm_fb_helper.c ++++ b/drivers/gpu/drm/drm_fb_helper.c +@@ -27,9 +27,11 @@ + * Dave Airlie + * Jesse Barnes + */ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/drivers/gpu/drm/ttm/ttm_agp_backend.c ++++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c +@@ -29,8 +29,10 @@ + * Keith Packard. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "[TTM] " fmt + ++#include + #include + #include + #include +--- a/drivers/gpu/drm/ttm/ttm_bo.c ++++ b/drivers/gpu/drm/ttm/ttm_bo.c +@@ -28,11 +28,13 @@ + * Authors: Thomas Hellstrom + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "[TTM] " fmt + + #include + #include + #include ++#include + #include + #include + #include +--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c ++++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c +@@ -28,8 +28,10 @@ + * Authors: Thomas Hellstrom + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "[TTM] " fmt + ++#include + #include + #include + #include +--- a/drivers/gpu/drm/ttm/ttm_memory.c ++++ b/drivers/gpu/drm/ttm/ttm_memory.c +@@ -25,11 +25,13 @@ + * + **************************************************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) "[TTM] " fmt + + #include + #include + #include ++#include + #include + #include + #include +--- a/drivers/gpu/drm/ttm/ttm_object.c ++++ b/drivers/gpu/drm/ttm/ttm_object.c +@@ -49,10 +49,12 @@ + * for fast lookup of ref objects given a base object. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "[TTM] " fmt + + #include + #include ++#include + #include + #include + #include +--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c ++++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c +@@ -31,8 +31,10 @@ + * - doesn't track currently in use pages + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "[TTM] " fmt + ++#include + #include + #include + #include +--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c ++++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +@@ -33,8 +33,10 @@ + * when freed). + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "[TTM] " fmt + ++#include + #include + #include + #include /* for seq_printf */ +--- a/drivers/gpu/drm/ttm/ttm_tt.c ++++ b/drivers/gpu/drm/ttm/ttm_tt.c +@@ -28,8 +28,10 @@ + * Authors: Thomas Hellstrom + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "[TTM] " fmt + ++#include + #include + #include + #include +--- a/drivers/gpu/drm/i915/i915_dma.c ++++ b/drivers/gpu/drm/i915/i915_dma.c +@@ -26,6 +26,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +@@ -35,6 +36,7 @@ + #include + #include "i915_drv.h" + #include "i915_trace.h" ++#include + #include + #include + #include +--- a/drivers/gpu/drm/i915/i915_irq.c ++++ b/drivers/gpu/drm/i915/i915_irq.c +@@ -26,8 +26,10 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/gpu/drm/i915/intel_opregion.c ++++ b/drivers/gpu/drm/i915/intel_opregion.c +@@ -25,8 +25,10 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/gpu/drm/i915/intel_panel.c ++++ b/drivers/gpu/drm/i915/intel_panel.c +@@ -28,8 +28,10 @@ + * Chris Wilson + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include "intel_drv.h" + diff --git a/patches/collateral-evolutions/drm/99-change-makefile.patch b/patches/collateral-evolutions/drm/99-change-makefile.patch new file mode 100644 index 000000000000..ae4280e6aff4 --- /dev/null +++ b/patches/collateral-evolutions/drm/99-change-makefile.patch @@ -0,0 +1,28 @@ +Remove drivers that we do not want to build from gpu/drm/Makefile + +--- a/drivers/gpu/drm/Makefile ++++ b/drivers/gpu/drm/Makefile +@@ -31,23 +31,14 @@ CFLAGS_drm_trace_points.o := -I$(src) + obj-$(CONFIG_COMPAT_DRM) += drm.o + obj-$(CONFIG_COMPAT_DRM_USB) += drm_usb.o + obj-$(CONFIG_COMPAT_DRM_TTM) += ttm/ +-obj-$(CONFIG_COMPAT_DRM_TDFX) += tdfx/ +-obj-$(CONFIG_COMPAT_DRM_R128) += r128/ + obj-$(CONFIG_COMPAT_DRM_RADEON)+= radeon/ +-obj-$(CONFIG_COMPAT_DRM_MGA) += mga/ + obj-$(CONFIG_COMPAT_DRM_I810) += i810/ + obj-$(CONFIG_COMPAT_DRM_I915) += i915/ + obj-$(CONFIG_COMPAT_DRM_MGAG200) += mgag200/ + obj-$(CONFIG_COMPAT_DRM_CIRRUS_QEMU) += cirrus/ +-obj-$(CONFIG_COMPAT_DRM_SIS) += sis/ +-obj-$(CONFIG_COMPAT_DRM_SAVAGE)+= savage/ + obj-$(CONFIG_COMPAT_DRM_VMWGFX)+= vmwgfx/ + obj-$(CONFIG_COMPAT_DRM_VIA) +=via/ + obj-$(CONFIG_COMPAT_DRM_NOUVEAU) +=nouveau/ +-obj-$(CONFIG_COMPAT_DRM_EXYNOS) +=exynos/ + obj-$(CONFIG_COMPAT_DRM_GMA500) += gma500/ +-obj-$(CONFIG_COMPAT_DRM_UDL) += udl/ + obj-$(CONFIG_COMPAT_DRM_AST) += ast/ +-obj-$(CONFIG_COMPAT_DRM_SHMOBILE) +=shmobile/ +-obj-$(CONFIG_COMPAT_DRM_TEGRA) += tegra/ + obj-y += i2c/ diff --git a/patches/collateral-evolutions/network/0001-netdev_ops.patch b/patches/collateral-evolutions/network/0001-netdev_ops.patch new file mode 100644 index 000000000000..eb0c5a4a6cdf --- /dev/null +++ b/patches/collateral-evolutions/network/0001-netdev_ops.patch @@ -0,0 +1,279 @@ + +This patch backports the struct net_device_ops changes added on 2.6.29. + +If we add the compat.git netdev_attach_ops() implementation +for newer kernels upstream it means we do not have to use this +patch at all for older kernels. + +mcgrof@tux ~/linux-stable (git::master)$ git describe --contains d314774cf2cd5dfeb39a00d37deee65d4c627927 +v2.6.29-rc1~581^2~677 + +commit d314774cf2cd5dfeb39a00d37deee65d4c627927 +Author: Stephen Hemminger +Date: Wed Nov 19 21:32:24 2008 -0800 + + netdev: network device operations infrastructure + + This patch changes the network device internal API to move adminstrative + operations out of the network device structure and into a separate structure. + + This patch involves some hackery to maintain compatablity between the + new and old model, so all 300+ drivers don't have to be changed at once. + For drivers that aren't converted yet, the netdevice_ops virt function list + still resides in the net_device structure. For old protocols, the new + net_device_ops are copied out to the old net_device pointers. + + After the transistion is completed the nag message can be changed to + an WARN_ON, and the compatiablity code can be made configurable. + + Some function pointers aren't moved: + * destructor can't be in net_device_ops because + it may need to be referenced after the module is unloaded. + * neighbor setup is manipulated in a couple of places that need special + consideration + * hard_start_xmit is in the fast path for transmit. + + Signed-off-by: Stephen Hemminger + Signed-off-by: David S. Miller + +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -358,7 +358,7 @@ generic_rndis_bind(struct usbnet *dev, s + dev->rx_urb_size &= ~(dev->maxpacket - 1); + u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); + +- net->netdev_ops = &rndis_netdev_ops; ++ netdev_attach_ops(net, &rndis_netdev_ops); + + retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); + if (unlikely(retval < 0)) { +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1422,7 +1422,7 @@ usbnet_probe (struct usb_interface *udev + net->features |= NETIF_F_HIGHDMA; + #endif + +- net->netdev_ops = &usbnet_netdev_ops; ++ netdev_attach_ops(net, &usbnet_netdev_ops); + net->watchdog_timeo = TX_TIMEOUT_JIFFIES; + net->ethtool_ops = &usbnet_ethtool_ops; + +--- a/drivers/net/wireless/ath/ath6kl/main.c ++++ b/drivers/net/wireless/ath/ath6kl/main.c +@@ -1322,7 +1322,7 @@ static const struct net_device_ops ath6k + + void init_netdev(struct net_device *dev) + { +- dev->netdev_ops = &ath6kl_netdev_ops; ++ netdev_attach_ops(dev, &ath6kl_netdev_ops); + dev->destructor = free_netdev; + dev->watchdog_timeo = ATH6KL_TX_TIMEOUT; + +--- a/drivers/net/wireless/rndis_wlan.c ++++ b/drivers/net/wireless/rndis_wlan.c +@@ -3442,7 +3442,7 @@ static int rndis_wlan_bind(struct usbnet + * rndis_host wants to avoid all OID as much as possible + * so do promisc/multicast handling in rndis_wlan. + */ +- usbdev->net->netdev_ops = &rndis_wlan_netdev_ops; ++ netdev_attach_ops(usbdev->net, &rndis_wlan_netdev_ops); + + tmp = cpu_to_le32(RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST); + retval = rndis_set_oid(usbdev, +--- a/drivers/net/ethernet/broadcom/b44.c ++++ b/drivers/net/ethernet/broadcom/b44.c +@@ -2175,7 +2175,7 @@ static int __devinit b44_init_one(struct + bp->rx_pending = B44_DEF_RX_RING_PENDING; + bp->tx_pending = B44_DEF_TX_RING_PENDING; + +- dev->netdev_ops = &b44_netdev_ops; ++ netdev_attach_ops(dev, &b44_netdev_ops); + netif_napi_add(dev, &bp->napi, b44_poll, 64); + dev->watchdog_timeo = B44_TX_TIMEOUT; + dev->irq = sdev->irq; +--- a/drivers/net/wireless/ipw2x00/ipw2100.c ++++ b/drivers/net/wireless/ipw2x00/ipw2100.c +@@ -6103,7 +6103,7 @@ static struct net_device *ipw2100_alloc_ + priv->ieee->perfect_rssi = -20; + priv->ieee->worst_rssi = -85; + +- dev->netdev_ops = &ipw2100_netdev_ops; ++ netdev_attach_ops(dev, &ipw2100_netdev_ops); + dev->ethtool_ops = &ipw2100_ethtool_ops; + dev->wireless_handlers = &ipw2100_wx_handler_def; + priv->wireless_data.libipw = priv->ieee; +--- a/drivers/net/wireless/ipw2x00/ipw2200.c ++++ b/drivers/net/wireless/ipw2x00/ipw2200.c +@@ -11690,7 +11690,7 @@ static int ipw_prom_alloc(struct ipw_pri + memcpy(priv->prom_net_dev->dev_addr, priv->mac_addr, ETH_ALEN); + + priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; +- priv->prom_net_dev->netdev_ops = &ipw_prom_netdev_ops; ++ netdev_attach_ops(priv->prom_net_dev, &ipw_prom_netdev_ops); + + priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR; + SET_NETDEV_DEV(priv->prom_net_dev, &priv->pci_dev->dev); +@@ -11828,7 +11828,7 @@ static int __devinit ipw_pci_probe(struc + priv->ieee->perfect_rssi = -20; + priv->ieee->worst_rssi = -85; + +- net_dev->netdev_ops = &ipw_netdev_ops; ++ netdev_attach_ops(net_dev, &ipw_netdev_ops); + priv->wireless_data.spy_data = &priv->ieee->spy_data; + net_dev->wireless_data = &priv->wireless_data; + net_dev->wireless_handlers = &ipw_wx_handler_def; +--- a/drivers/net/wireless/libertas/main.c ++++ b/drivers/net/wireless/libertas/main.c +@@ -993,7 +993,7 @@ struct lbs_private *lbs_add_card(void *c + wdev->netdev = dev; + priv->dev = dev; + +- dev->netdev_ops = &lbs_netdev_ops; ++ netdev_attach_ops(dev, &lbs_netdev_ops); + dev->watchdog_timeo = 5 * HZ; + dev->ethtool_ops = &lbs_ethtool_ops; + dev->flags |= IFF_BROADCAST | IFF_MULTICAST; +--- a/drivers/net/wireless/libertas/mesh.c ++++ b/drivers/net/wireless/libertas/mesh.c +@@ -1015,7 +1015,7 @@ static int lbs_add_mesh(struct lbs_priva + mesh_dev->ieee80211_ptr = mesh_wdev; + priv->mesh_dev = mesh_dev; + +- mesh_dev->netdev_ops = &mesh_netdev_ops; ++ netdev_attach_ops(mesh_dev, &mesh_netdev_ops); + mesh_dev->ethtool_ops = &lbs_ethtool_ops; + memcpy(mesh_dev->dev_addr, priv->dev->dev_addr, ETH_ALEN); + +--- a/drivers/net/wireless/mac80211_hwsim.c ++++ b/drivers/net/wireless/mac80211_hwsim.c +@@ -1601,7 +1601,7 @@ static const struct net_device_ops hwsim + + static void hwsim_mon_setup(struct net_device *dev) + { +- dev->netdev_ops = &hwsim_netdev_ops; ++ netdev_attach_ops(dev, &hwsim_netdev_ops); + dev->destructor = free_netdev; + ether_setup(dev); + dev->tx_queue_len = 0; +--- a/drivers/net/wireless/mwifiex/main.c ++++ b/drivers/net/wireless/mwifiex/main.c +@@ -645,7 +645,7 @@ static const struct net_device_ops mwifi + void mwifiex_init_priv_params(struct mwifiex_private *priv, + struct net_device *dev) + { +- dev->netdev_ops = &mwifiex_netdev_ops; ++ netdev_attach_ops(dev, &mwifiex_netdev_ops); + /* Initialize private structure */ + priv->current_key_index = 0; + priv->media_connected = false; +--- a/net/bluetooth/bnep/netdev.c ++++ b/net/bluetooth/bnep/netdev.c +@@ -223,7 +223,7 @@ void bnep_net_setup(struct net_device *d + + ether_setup(dev); + dev->priv_flags &= ~IFF_TX_SKB_SHARING; +- dev->netdev_ops = &bnep_netdev_ops; ++ netdev_attach_ops(dev, &bnep_netdev_ops); + + dev->watchdog_timeo = HZ * 2; + } +--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c ++++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c +@@ -2211,7 +2211,7 @@ static int atl1e_init_netdev(struct net_ + SET_NETDEV_DEV(netdev, &pdev->dev); + pci_set_drvdata(pdev, netdev); + +- netdev->netdev_ops = &atl1e_netdev_ops; ++ netdev_attach_ops(netdev, &atl1e_netdev_ops); + + netdev->watchdog_timeo = AT_TX_WATCHDOG; + atl1e_set_ethtool_ops(netdev); +--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c ++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +@@ -2416,7 +2416,7 @@ static int atl1c_init_netdev(struct net_ + SET_NETDEV_DEV(netdev, &pdev->dev); + pci_set_drvdata(pdev, netdev); + +- netdev->netdev_ops = &atl1c_netdev_ops; ++ netdev_attach_ops(netdev, &atl1c_netdev_ops); + netdev->watchdog_timeo = AT_TX_WATCHDOG; + atl1c_set_ethtool_ops(netdev); + +--- a/drivers/net/ethernet/atheros/atlx/atl1.c ++++ b/drivers/net/ethernet/atheros/atlx/atl1.c +@@ -3010,7 +3010,7 @@ static int __devinit atl1_probe(struct p + adapter->mii.phy_id_mask = 0x1f; + adapter->mii.reg_num_mask = 0x1f; + +- netdev->netdev_ops = &atl1_netdev_ops; ++ netdev_attach_ops(netdev, &atl1_netdev_ops); + netdev->watchdog_timeo = 5 * HZ; + netif_napi_add(netdev, &adapter->napi, atl1_rings_clean, 64); + +--- a/drivers/net/ethernet/atheros/atlx/atl2.c ++++ b/drivers/net/ethernet/atheros/atlx/atl2.c +@@ -1400,7 +1400,7 @@ static int __devinit atl2_probe(struct p + + atl2_setup_pcicmd(pdev); + +- netdev->netdev_ops = &atl2_netdev_ops; ++ netdev_attach_ops(netdev, &atl2_netdev_ops); + atl2_set_ethtool_ops(netdev); + netdev->watchdog_timeo = 5 * HZ; + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1008,7 +1008,7 @@ static void ieee80211_if_setup(struct ne + { + ether_setup(dev); + dev->priv_flags &= ~IFF_TX_SKB_SHARING; +- dev->netdev_ops = &ieee80211_dataif_ops; ++ netdev_attach_ops(dev, &ieee80211_dataif_ops); + dev->destructor = free_netdev; + } + +@@ -1171,7 +1171,7 @@ static void ieee80211_setup_sdata(struct + + /* only monitor/p2p-device differ */ + if (sdata->dev) { +- sdata->dev->netdev_ops = &ieee80211_dataif_ops; ++ netdev_attach_ops(sdata->dev, &ieee80211_dataif_ops); + sdata->dev->type = ARPHRD_ETHER; + } + +@@ -1206,7 +1206,7 @@ static void ieee80211_setup_sdata(struct + break; + case NL80211_IFTYPE_MONITOR: + sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP; +- sdata->dev->netdev_ops = &ieee80211_monitorif_ops; ++ netdev_attach_ops(sdata->dev, &ieee80211_monitorif_ops); + sdata->u.mntr_flags = MONITOR_FLAG_CONTROL | + MONITOR_FLAG_OTHER_BSS; + break; +--- a/drivers/net/wireless/orinoco/main.c ++++ b/drivers/net/wireless/orinoco/main.c +@@ -2278,9 +2278,9 @@ int orinoco_if_add(struct orinoco_privat + #endif + /* Default to standard ops if not set */ + if (ops) +- dev->netdev_ops = ops; ++ netdev_attach_ops(dev, ops); + else +- dev->netdev_ops = &orinoco_netdev_ops; ++ netdev_attach_ops(dev, &orinoco_netdev_ops); + + /* we use the default eth_mac_addr for setting the MAC addr */ + +--- a/net/wireless/wext-core.c ++++ b/net/wireless/wext-core.c +@@ -925,9 +925,7 @@ static int wireless_process_ioctl(struct + return private(dev, iwr, cmd, info, handler); + } + /* Old driver API : call driver ioctl handler */ +- if (dev->netdev_ops->ndo_do_ioctl) +- return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd); +- return -EOPNOTSUPP; ++ return ndo_do_ioctl(dev, ifr, cmd); + } + + /* If command is `set a parameter', or `get the encoding parameters', diff --git a/patches/collateral-evolutions/network/0002-net-misc.patch b/patches/collateral-evolutions/network/0002-net-misc.patch new file mode 100644 index 000000000000..b103c01f6b65 --- /dev/null +++ b/patches/collateral-evolutions/network/0002-net-misc.patch @@ -0,0 +1,68 @@ +These are things that removed in later kernels but no good explanatin +was provided as to their removal. We should review if this is needed +and if not remove these hunks. + +Pretty sure we can remove the netdev_tx_t hunk change on +net/bluetooth/bnep/netdev.c, removing that hunk just needs to be +compile tested against older kernels. + +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -332,6 +332,11 @@ generic_rndis_bind(struct usbnet *dev, s + u.init->major_version = cpu_to_le32(1); + u.init->minor_version = cpu_to_le32(0); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) ++ /* can't we remove this? */ ++ net->change_mtu = NULL; ++#endif ++ + /* max transfer (in spec) is 0x4000 at full speed, but for + * TX we'll stick to one Ethernet packet plus RNDIS framing. + * For RX we handle drivers that zero-pad to end-of-packet. +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1009,6 +1009,11 @@ static void ieee80211_if_setup(struct ne + ether_setup(dev); + dev->priv_flags &= ~IFF_TX_SKB_SHARING; + netdev_attach_ops(dev, &ieee80211_dataif_ops); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) ++ /* Do we need this ? */ ++ /* we will validate the address ourselves in ->open */ ++ dev->validate_addr = NULL; ++#endif + dev->destructor = free_netdev; + } + +--- a/net/bluetooth/bnep/netdev.c ++++ b/net/bluetooth/bnep/netdev.c +@@ -161,8 +161,12 @@ static int bnep_net_proto_filter(struct + } + #endif + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + static netdev_tx_t bnep_net_xmit(struct sk_buff *skb, + struct net_device *dev) ++#else ++static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev) ++#endif + { + struct bnep_session *s = netdev_priv(dev); + struct sock *sk = s->sock->sk; +--- a/drivers/net/wireless/libertas/defs.h ++++ b/drivers/net/wireless/libertas/defs.h +@@ -16,6 +16,14 @@ + #define DRV_NAME "libertas" + #endif + ++/* ++ * Really nasty hack to avoid stuffing compat.diff with tons of ifdefs, ++ * we could add this to a compat header file but too lazy to check ml_priv ++ * is not used anywhere else ++ */ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) ++#define ml_priv priv ++#endif + + #define LBS_DEB_ENTER 0x00000001 + #define LBS_DEB_LEAVE 0x00000002 diff --git a/patches/collateral-evolutions/network/0003-netdev-needed_headroom_tailroom.patch b/patches/collateral-evolutions/network/0003-netdev-needed_headroom_tailroom.patch new file mode 100644 index 000000000000..be60b198f500 --- /dev/null +++ b/patches/collateral-evolutions/network/0003-netdev-needed_headroom_tailroom.patch @@ -0,0 +1,36 @@ +This is an optimization introduced on newer kernels, just ignore for +older kernels on mac80211. For others the netdev->hard_header_len +could be used. + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1493,6 +1493,7 @@ int ieee80211_if_add(struct ieee80211_lo + return -ENOMEM; + dev_net_set(ndev, wiphy_net(local->hw.wiphy)); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) + ndev->needed_headroom = local->tx_headroom + + 4*6 /* four MAC addresses */ + + 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */ +@@ -1501,6 +1502,7 @@ int ieee80211_if_add(struct ieee80211_lo + - ETH_HLEN /* ethernet hard_header_len */ + + IEEE80211_ENCRYPT_HEADROOM; + ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM; ++#endif + + ret = dev_alloc_name(ndev, ndev->name); + if (ret < 0) { +--- a/drivers/net/wireless/orinoco/main.c ++++ b/drivers/net/wireless/orinoco/main.c +@@ -2285,7 +2285,11 @@ int orinoco_if_add(struct orinoco_privat + /* we use the default eth_mac_addr for setting the MAC addr */ + + /* Reserve space in skb for the SNAP header */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) + dev->needed_headroom = ENCAPS_OVERHEAD; ++#else ++ dev->hard_header_len += ENCAPS_OVERHEAD; ++#endif + + netif_carrier_off(dev); + diff --git a/patches/collateral-evolutions/network/0004-wext-namespace.patch b/patches/collateral-evolutions/network/0004-wext-namespace.patch new file mode 100644 index 000000000000..606001b62110 --- /dev/null +++ b/patches/collateral-evolutions/network/0004-wext-namespace.patch @@ -0,0 +1,58 @@ + +This patch backports the namespace changes added +through net/wireless/wext.c. + +--- a/net/wireless/wext-core.c ++++ b/net/wireless/wext-core.c +@@ -342,6 +342,7 @@ static const int compat_event_type_size[ + + /* IW event code */ + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) + static int __net_init wext_pernet_init(struct net *net) + { + skb_queue_head_init(&net->wext_nlevents); +@@ -384,6 +385,29 @@ static void wireless_nlevent_process(str + + static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process); + ++#else ++/* Older kernels get the old way of doing stuff*/ ++static struct sk_buff_head wireless_nlevent_queue; ++ ++static int __init wireless_nlevent_init(void) ++{ ++ skb_queue_head_init(&wireless_nlevent_queue); ++ return 0; ++} ++ ++subsys_initcall(wireless_nlevent_init); ++ ++static void wireless_nlevent_process(unsigned long data) ++{ ++ struct sk_buff *skb; ++ while ((skb = skb_dequeue(&wireless_nlevent_queue))) ++ rtnl_notify(skb, &init_net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); ++} ++ ++static DECLARE_TASKLET(wireless_nlevent_tasklet, wireless_nlevent_process, 0); ++ ++#endif ++ + static struct nlmsghdr *rtnetlink_ifinfo_prep(struct net_device *dev, + struct sk_buff *skb) + { +@@ -597,8 +621,13 @@ void wireless_send_event(struct net_devi + + skb_shinfo(skb)->frag_list = compskb; + #endif ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) + skb_queue_tail(&dev_net(dev)->wext_nlevents, skb); + schedule_work(&wireless_nlevent_work); ++#else ++ skb_queue_tail(&wireless_nlevent_queue, skb); ++ tasklet_schedule(&wireless_nlevent_tasklet); ++#endif + } + EXPORT_SYMBOL(wireless_send_event); + diff --git a/patches/collateral-evolutions/network/0005-netlink-portid.patch b/patches/collateral-evolutions/network/0005-netlink-portid.patch new file mode 100644 index 000000000000..b7df3f112979 --- /dev/null +++ b/patches/collateral-evolutions/network/0005-netlink-portid.patch @@ -0,0 +1,306 @@ +The patch: + +commit 15e473046cb6e5d18a4d0057e61d76315230382b +Author: Eric W. Biederman +Date: Fri Sep 7 20:12:54 2012 +0000 + + netlink: Rename pid to portid to avoid confusion + + It is a frequent mistake to confuse the netlink port identifier with a + process identifier. Try to reduce this confusion by renaming fields + that hold port identifiers portid instead of pid. + + I have carefully avoided changing the structures exported to + userspace to avoid changing the userspace API. + + I have successfully built an allyesconfig kernel with this change. + + Signed-off-by: "Eric W. Biederman" + Acked-by: Stephen Hemminger + Signed-off-by: David S. Miller + +Changed the struct members: + +struct netlink_notify->pid to +struct netlink_notify->portid + +struct genl_info->snd_pid to +struct genl_info->snd_portid + +To help backport this and not have to #ifdef around it against +kernel versions compat has introduced two helpers for us to +simply do the backport with two macro helpers: + +genl_info_snd_portid() +netlink_notify_portid() + +This takes care of the work for us requiring only one +single line change. If we get another patch thrown into +this file then I suspect we can extract SMPL out of it +and use it to backport further collateral evolutions like +this one should other drivers / subsystem need this change. + +--- a/drivers/net/wireless/mac80211_hwsim.c ++++ b/drivers/net/wireless/mac80211_hwsim.c +@@ -1925,10 +1925,10 @@ static int hwsim_register_received_nl(st + if (info == NULL) + goto out; + +- wmediumd_portid = info->snd_portid; ++ wmediumd_portid = genl_info_snd_portid(info); + + printk(KERN_DEBUG "mac80211_hwsim: received a REGISTER, " +- "switching to wmediumd mode with pid %d\n", info->snd_portid); ++ "switching to wmediumd mode with pid %d\n", genl_info_snd_portid(info)); + + return 0; + out: +@@ -1965,7 +1965,7 @@ static int mac80211_hwsim_netlink_notify + if (state != NETLINK_URELEASE) + return NOTIFY_DONE; + +- if (notify->portid == wmediumd_portid) { ++ if (netlink_notify_portid(notify) == wmediumd_portid) { + printk(KERN_INFO "mac80211_hwsim: wmediumd released netlink" + " socket, switching to perfect channel medium\n"); + wmediumd_portid = 0; +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -1282,7 +1282,7 @@ static int nl80211_dump_wiphy(struct sk_ + continue; + if (++idx <= start) + continue; +- if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).portid, ++ if (nl80211_send_wiphy(skb, NETLINK_CB_PORTID(skb), + cb->nlh->nlmsg_seq, NLM_F_MULTI, + dev) < 0) { + idx--; +@@ -1305,7 +1305,7 @@ static int nl80211_get_wiphy(struct sk_b + if (!msg) + return -ENOMEM; + +- if (nl80211_send_wiphy(msg, info->snd_portid, info->snd_seq, 0, dev) < 0) { ++ if (nl80211_send_wiphy(msg, genl_info_snd_portid(info), info->snd_seq, 0, dev) < 0) { + nlmsg_free(msg); + return -ENOBUFS; + } +@@ -1940,7 +1940,7 @@ static int nl80211_dump_interface(struct + if_idx++; + continue; + } +- if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).portid, ++ if (nl80211_send_iface(skb, NETLINK_CB_PORTID(cb->skb), + cb->nlh->nlmsg_seq, NLM_F_MULTI, + rdev, wdev) < 0) { + mutex_unlock(&rdev->devlist_mtx); +@@ -1971,7 +1971,7 @@ static int nl80211_get_interface(struct + if (!msg) + return -ENOMEM; + +- if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, ++ if (nl80211_send_iface(msg, genl_info_snd_portid(info), info->snd_seq, 0, + dev, wdev) < 0) { + nlmsg_free(msg); + return -ENOBUFS; +@@ -2189,7 +2189,7 @@ static int nl80211_new_interface(struct + break; + } + +- if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, ++ if (nl80211_send_iface(msg, genl_info_snd_portid(info), info->snd_seq, 0, + rdev, wdev) < 0) { + nlmsg_free(msg); + return -ENOBUFS; +@@ -2324,7 +2324,7 @@ static int nl80211_get_key(struct sk_buf + if (!msg) + return -ENOMEM; + +- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, ++ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, + NL80211_CMD_NEW_KEY); + if (IS_ERR(hdr)) + return PTR_ERR(hdr); +@@ -3100,7 +3100,7 @@ static int nl80211_dump_station(struct s + goto out_err; + + if (nl80211_send_station(skb, +- NETLINK_CB(cb->skb).portid, ++ NETLINK_CB_PORTID(cb->skb), + cb->nlh->nlmsg_seq, NLM_F_MULTI, + dev, netdev, mac_addr, + &sinfo) < 0) +@@ -3146,7 +3146,7 @@ static int nl80211_get_station(struct sk + if (!msg) + return -ENOMEM; + +- if (nl80211_send_station(msg, info->snd_portid, info->snd_seq, 0, ++ if (nl80211_send_station(msg, genl_info_snd_portid(info), info->snd_seq, 0, + rdev, dev, mac_addr, &sinfo) < 0) { + nlmsg_free(msg); + return -ENOBUFS; +@@ -3562,7 +3562,7 @@ static int nl80211_dump_mpath(struct sk_ + if (err) + goto out_err; + +- if (nl80211_send_mpath(skb, NETLINK_CB(cb->skb).portid, ++ if (nl80211_send_mpath(skb, NETLINK_CB_PORTID(cb->skb), + cb->nlh->nlmsg_seq, NLM_F_MULTI, + netdev, dst, next_hop, + &pinfo) < 0) +@@ -3611,7 +3611,7 @@ static int nl80211_get_mpath(struct sk_b + if (!msg) + return -ENOMEM; + +- if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0, ++ if (nl80211_send_mpath(msg, genl_info_snd_portid(info), info->snd_seq, 0, + dev, dst, next_hop, &pinfo) < 0) { + nlmsg_free(msg); + return -ENOBUFS; +@@ -3851,7 +3851,7 @@ static int nl80211_get_mesh_config(struc + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); + if (!msg) + return -ENOMEM; +- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, ++ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, + NL80211_CMD_GET_MESH_CONFIG); + if (!hdr) + goto out; +@@ -4169,7 +4169,7 @@ static int nl80211_get_reg(struct sk_buf + goto out; + } + +- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, ++ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, + NL80211_CMD_GET_REG); + if (!hdr) + goto put_failure; +@@ -4813,7 +4813,7 @@ static int nl80211_send_bss(struct sk_bu + + ASSERT_WDEV_LOCK(wdev); + +- hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).portid, seq, flags, ++ hdr = nl80211hdr_put(msg, NETLINK_CB_PORTID(cb->skb), seq, flags, + NL80211_CMD_NEW_SCAN_RESULTS); + if (!hdr) + return -1; +@@ -5032,7 +5032,7 @@ static int nl80211_dump_survey(struct sk + } + + if (nl80211_send_survey(skb, +- NETLINK_CB(cb->skb).portid, ++ NETLINK_CB_PORTID(cb->skb), + cb->nlh->nlmsg_seq, NLM_F_MULTI, + netdev, + &survey) < 0) +@@ -5677,7 +5677,7 @@ static int nl80211_testmode_dump(struct + } + + while (1) { +- void *hdr = nl80211hdr_put(skb, NETLINK_CB(cb->skb).portid, ++ void *hdr = nl80211hdr_put(skb, NETLINK_CB_PORTID(cb->skb), + cb->nlh->nlmsg_seq, NLM_F_MULTI, + NL80211_CMD_TESTMODE); + struct nlattr *tmdata; +@@ -5756,7 +5756,7 @@ struct sk_buff *cfg80211_testmode_alloc_ + return NULL; + + return __cfg80211_testmode_alloc_skb(rdev, approxlen, +- rdev->testmode_info->snd_portid, ++ genl_info_snd_portid(rdev->testmode_info), + rdev->testmode_info->snd_seq, + GFP_KERNEL); + } +@@ -6089,7 +6089,7 @@ static int nl80211_remain_on_channel(str + if (!msg) + return -ENOMEM; + +- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, ++ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, + NL80211_CMD_REMAIN_ON_CHANNEL); + + if (IS_ERR(hdr)) { +@@ -6308,7 +6308,7 @@ static int nl80211_register_mgmt(struct + if (!rdev->ops->mgmt_tx) + return -EOPNOTSUPP; + +- return cfg80211_mlme_register_mgmt(wdev, info->snd_portid, frame_type, ++ return cfg80211_mlme_register_mgmt(wdev, genl_info_snd_portid(info), frame_type, + nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]), + nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH])); + } +@@ -6378,7 +6378,7 @@ static int nl80211_tx_mgmt(struct sk_buf + if (!msg) + return -ENOMEM; + +- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, ++ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, + NL80211_CMD_FRAME); + + if (IS_ERR(hdr)) { +@@ -6493,7 +6493,7 @@ static int nl80211_get_power_save(struct + if (!msg) + return -ENOMEM; + +- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, ++ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, + NL80211_CMD_GET_POWER_SAVE); + if (!hdr) { + err = -ENOBUFS; +@@ -6684,7 +6684,7 @@ static int nl80211_get_wowlan(struct sk_ + if (!msg) + return -ENOMEM; + +- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, ++ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, + NL80211_CMD_GET_WOWLAN); + if (!hdr) + goto nla_put_failure; +@@ -6961,7 +6961,7 @@ static int nl80211_register_unexpected_f + if (wdev->ap_unexpected_nlportid) + return -EBUSY; + +- wdev->ap_unexpected_nlportid = info->snd_portid; ++ wdev->ap_unexpected_nlportid = genl_info_snd_portid(info); + return 0; + } + +@@ -6991,7 +6991,7 @@ static int nl80211_probe_client(struct s + if (!msg) + return -ENOMEM; + +- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, ++ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, + NL80211_CMD_PROBE_CLIENT); + + if (IS_ERR(hdr)) { +@@ -7035,13 +7035,13 @@ static int nl80211_register_beacons(stru + /* First, check if already registered. */ + spin_lock_bh(&rdev->beacon_registrations_lock); + list_for_each_entry(reg, &rdev->beacon_registrations, list) { +- if (reg->nlportid == info->snd_portid) { ++ if (reg->nlportid == genl_info_snd_portid(info)) { + rv = -EALREADY; + goto out_err; + } + } + /* Add it to the list */ +- nreg->nlportid = info->snd_portid; ++ nreg->nlportid = genl_info_snd_portid(info); + list_add(&nreg->list, &rdev->beacon_registrations); + + spin_unlock_bh(&rdev->beacon_registrations_lock); +@@ -9169,12 +9169,12 @@ static int nl80211_netlink_notify(struct + + list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) { + list_for_each_entry_rcu(wdev, &rdev->wdev_list, list) +- cfg80211_mlme_unregister_socket(wdev, notify->portid); ++ cfg80211_mlme_unregister_socket(wdev, netlink_notify_portid(notify)); + + spin_lock_bh(&rdev->beacon_registrations_lock); + list_for_each_entry_safe(reg, tmp, &rdev->beacon_registrations, + list) { +- if (reg->nlportid == notify->portid) { ++ if (reg->nlportid == netlink_notify_portid(notify)) { + list_del(®->list); + kfree(reg); + break; diff --git a/patches/collateral-evolutions/network/02-ksize.patch b/patches/collateral-evolutions/network/02-ksize.patch new file mode 100644 index 000000000000..b54cb234ac4f --- /dev/null +++ b/patches/collateral-evolutions/network/02-ksize.patch @@ -0,0 +1,69 @@ +ksize() was added as of 2.6.29, it gives you the actual +size of the allocated data. Since we have no support for +this we simply do not optimize for it and deal with +large alloocations for the IEs. + +We technically could backport this as + +define ksize(bleh) SOME_LARGE_NUMBER + +but doing it this way emphasis careful review +of the situation. + +--- a/drivers/net/wireless/orinoco/wext.c ++++ b/drivers/net/wireless/orinoco/wext.c +@@ -31,8 +31,22 @@ static int orinoco_set_key(struct orinoc + enum orinoco_alg alg, const u8 *key, int key_len, + const u8 *seq, int seq_len) + { ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) ++ int len; ++ if (!unlikely(ZERO_OR_NULL_PTR(priv->keys[index].key))) { ++ len = priv->keys[index].key_len; ++ memset(priv->keys[index].key, 0, len); ++ kfree(priv->keys[index].key); ++ } ++ if (!unlikely(ZERO_OR_NULL_PTR(priv->keys[index].seq))) { ++ len = priv->keys[index].seq_len; ++ memset(priv->keys[index].seq, 0, len); ++ kfree(priv->keys[index].seq); ++ } ++#else + kzfree(priv->keys[index].key); + kzfree(priv->keys[index].seq); ++#endif + + if (key_len) { + priv->keys[index].key = kzalloc(key_len, GFP_ATOMIC); +--- a/net/wireless/scan.c ++++ b/net/wireless/scan.c +@@ -673,9 +673,14 @@ cfg80211_bss_update(struct cfg80211_regi + size_t used = dev->wiphy.bss_priv_size + sizeof(*res); + size_t ielen = res->pub.len_proberesp_ies; + ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) ++ if (0) { ++ used = 0; /* just to shut up the compiler */ ++#else + if (found->pub.proberesp_ies && + !found->proberesp_ies_allocated && + ksize(found) >= used + ielen) { ++#endif + memcpy(found->pub.proberesp_ies, + res->pub.proberesp_ies, ielen); + found->pub.len_proberesp_ies = ielen; +@@ -709,9 +714,14 @@ cfg80211_bss_update(struct cfg80211_regi + (found->pub.information_elements == + found->pub.beacon_ies); + ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) ++ if (0) { ++ used = 0; /* just to shut up the compiler */ ++#else + if (found->pub.beacon_ies && + !found->beacon_ies_allocated && + ksize(found) >= used + ielen) { ++#endif + memcpy(found->pub.beacon_ies, + res->pub.beacon_ies, ielen); + found->pub.len_beacon_ies = ielen; diff --git a/patches/collateral-evolutions/network/03-rfkill.patch b/patches/collateral-evolutions/network/03-rfkill.patch new file mode 100644 index 000000000000..c19b42e70d47 --- /dev/null +++ b/patches/collateral-evolutions/network/03-rfkill.patch @@ -0,0 +1,66 @@ +rfkill was re-implemented on 2.6.31. We port it to +older kernels with a simple hack, just rename the +module as a new one rfkill_backport, and every +exported symbol gets redefined with a _backport +postfix through compat-2.6.31.h. The changes below +are the ones we could not do through compat-2.6.31.h + +Do older kernels have /dev/rfkill ? I not then we can +just keep /dev/rfkill and not /dev/rfkill_backport. + +Note that 2.6.31 added netdevice notifier upon interface +dev_open() which on cfg80211 will check if checks to see +if rfkill is enabled (or if the mode of operation is not +supported) on the cfg80211_netdev_notifier_call() and if +so deny bringing the interface up. This was added via +commit: + +3b8bcfd5d31ea0fec58681d035544ace707d2536 + +Since older kernels will not have the notifier call +on dev_open() if we *really want* to port this we could have +mac80211's subif_open() call : + + ret = call_netdevice_notifiers(NETDEV_PRE_UP, dev); + ret = notifier_to_errno(ret); + if (ret) + return ret; + +This would do the policing from within mac80211. + +--- a/net/rfkill/Makefile ++++ b/net/rfkill/Makefile +@@ -2,8 +2,8 @@ + # Makefile for the RF switch subsystem. + # + +-rfkill-y += core.o +-rfkill-$(CONFIG_RFKILL_INPUT) += input.o +-obj-$(CONFIG_RFKILL) += rfkill.o ++rfkill_backport-y += core.o ++rfkill_backport-$(CONFIG_RFKILL_BACKPORT_INPUT) += input.o ++obj-$(CONFIG_RFKILL_BACKPORT) += rfkill_backport.o + obj-$(CONFIG_RFKILL_REGULATOR) += rfkill-regulator.o + obj-$(CONFIG_RFKILL_GPIO) += rfkill-gpio.o +--- a/net/rfkill/input.c ++++ b/net/rfkill/input.c +@@ -232,7 +232,7 @@ static int rfkill_connect(struct input_h + + handle->dev = dev; + handle->handler = handler; +- handle->name = "rfkill"; ++ handle->name = "rfkill_backport"; + + /* causes rfkill_start() to be called */ + error = input_register_handle(handle); +--- a/net/rfkill/core.c ++++ b/net/rfkill/core.c +@@ -826,7 +826,7 @@ static int rfkill_resume(struct device * + } + + static struct class rfkill_class = { +- .name = "rfkill", ++ .name = "rfkill_backport", + .dev_release = rfkill_release, + .dev_attrs = rfkill_dev_attrs, + .dev_uevent = rfkill_dev_uevent, diff --git a/patches/collateral-evolutions/network/04-netns.patch b/patches/collateral-evolutions/network/04-netns.patch new file mode 100644 index 000000000000..1365b45f90cb --- /dev/null +++ b/patches/collateral-evolutions/network/04-netns.patch @@ -0,0 +1,149 @@ +The only other namespace change. Note that pach 01-netdev.patch +also has some other namespace changes there, look at that file +for the other changes. It'd be nice to figure out a way to +bring thise here cleanly and seprately but they touch the same +files... + +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -5940,7 +5940,9 @@ static int nl80211_wiphy_netns(struct sk + if (!net_eq(wiphy_net(&rdev->wiphy), net)) + err = cfg80211_switch_netns(rdev, net); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + put_net(net); ++#endif + return err; + } + +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -168,6 +168,7 @@ int cfg80211_dev_rename(struct cfg80211_ + return 0; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + int cfg80211_switch_netns(struct cfg80211_registered_device *rdev, + struct net *net) + { +@@ -212,6 +213,7 @@ int cfg80211_switch_netns(struct cfg8021 + + return 0; + } ++#endif + + static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) + { +@@ -344,7 +346,9 @@ struct wiphy *wiphy_new(const struct cfg + rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + wiphy_net_set(&rdev->wiphy, &init_net); ++#endif + + rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block; + rdev->rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev), +@@ -843,8 +847,10 @@ static int cfg80211_netdev_notifier_call + wdev->identifier = ++rdev->wdev_id; + list_add_rcu(&wdev->list, &rdev->wdev_list); + rdev->devlist_generation++; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + /* can only change netns with wiphy */ + dev->features |= NETIF_F_NETNS_LOCAL; ++#endif + + if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, + "phy80211")) { +@@ -1035,6 +1041,7 @@ static struct notifier_block cfg80211_ne + .notifier_call = cfg80211_netdev_notifier_call, + }; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + static void __net_exit cfg80211_pernet_exit(struct net *net) + { + struct cfg80211_registered_device *rdev; +@@ -1052,14 +1059,17 @@ static void __net_exit cfg80211_pernet_e + static struct pernet_operations cfg80211_pernet_ops = { + .exit = cfg80211_pernet_exit, + }; ++#endif + + static int __init cfg80211_init(void) + { + int err; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + err = register_pernet_device(&cfg80211_pernet_ops); + if (err) + goto out_fail_pernet; ++#endif + + err = wiphy_sysfs_init(); + if (err) +@@ -1094,8 +1104,10 @@ out_fail_nl80211: + out_fail_notifier: + wiphy_sysfs_exit(); + out_fail_sysfs: ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + unregister_pernet_device(&cfg80211_pernet_ops); + out_fail_pernet: ++#endif + return err; + } + subsys_initcall(cfg80211_init); +@@ -1107,7 +1119,9 @@ static void __exit cfg80211_exit(void) + unregister_netdevice_notifier(&cfg80211_netdev_notifier); + wiphy_sysfs_exit(); + regulatory_exit(); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + unregister_pernet_device(&cfg80211_pernet_ops); ++#endif + destroy_workqueue(cfg80211_wq); + } + module_exit(cfg80211_exit); +--- a/net/wireless/wext-core.c ++++ b/net/wireless/wext-core.c +@@ -367,6 +367,7 @@ static int __init wireless_nlevent_init( + subsys_initcall(wireless_nlevent_init); + + /* Process events generated by the wireless layer or the driver. */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + static void wireless_nlevent_process(struct work_struct *work) + { + struct sk_buff *skb; +@@ -382,6 +383,20 @@ static void wireless_nlevent_process(str + + rtnl_unlock(); + } ++#else ++static void wireless_nlevent_process(struct work_struct *work) ++{ ++ struct sk_buff *skb; ++ struct net *net; ++ ++ rtnl_lock(); ++ ++ while ((skb = skb_dequeue(&net->wext_nlevents))) ++ rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); ++ ++ rtnl_unlock(); ++} ++#endif + + static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process); + +--- a/net/wireless/wext-proc.c ++++ b/net/wireless/wext-proc.c +@@ -98,7 +98,11 @@ static void *wireless_dev_seq_start(stru + return SEQ_START_TOKEN; + + off = 1; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + for_each_netdev(net, dev) ++#else ++ for_each_netdev(net) ++#endif + if (off++ == *pos) + return dev; + return NULL; diff --git a/patches/collateral-evolutions/network/05-usb.patch b/patches/collateral-evolutions/network/05-usb.patch new file mode 100644 index 000000000000..57471cadecb6 --- /dev/null +++ b/patches/collateral-evolutions/network/05-usb.patch @@ -0,0 +1,26 @@ +USB opt soft_unbid was added as of 2.6.27. + +--- a/drivers/net/wireless/p54/p54usb.c ++++ b/drivers/net/wireless/p54/p54usb.c +@@ -1139,7 +1139,9 @@ static struct usb_driver p54u_driver = { + .resume = p54u_resume, + .reset_resume = p54u_resume, + #endif /* CONFIG_PM */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + .soft_unbind = 1, ++#endif + .disable_hub_initiated_lpm = 1, + }; + +--- a/drivers/net/wireless/ath/ath9k/hif_usb.c ++++ b/drivers/net/wireless/ath/ath9k/hif_usb.c +@@ -1370,7 +1370,9 @@ static struct usb_driver ath9k_hif_usb_d + .reset_resume = ath9k_hif_usb_resume, + #endif + .id_table = ath9k_hif_usb_ids, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + .soft_unbind = 1, ++#endif + .disable_hub_initiated_lpm = 1, + }; + diff --git a/patches/collateral-evolutions/network/06-header-changes.patch b/patches/collateral-evolutions/network/06-header-changes.patch new file mode 100644 index 000000000000..5da05c0da4d6 --- /dev/null +++ b/patches/collateral-evolutions/network/06-header-changes.patch @@ -0,0 +1,137 @@ + +Every kernel release there are a few changes to headers +made. Some code gets shifted around between headers or +new headers are defined. This patch deals with such +cases. + +--- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c ++++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c +@@ -18,6 +18,10 @@ + #include "debug.h" + #include "hif-ops.h" + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) ++#include ++#endif ++ + #define HTC_PACKET_CONTAINER_ALLOCATION 32 + #define HTC_CONTROL_BUFFER_SIZE (HTC_MAX_CTRL_MSG_LEN + HTC_HDR_LENGTH) + +--- a/drivers/net/wireless/b43/phy_common.h ++++ b/drivers/net/wireless/b43/phy_common.h +@@ -3,6 +3,9 @@ + + #include + #include ++#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,28)) ++#include ++#endif + + struct b43_wldev; + +--- a/drivers/net/wireless/rtlwifi/base.c ++++ b/drivers/net/wireless/rtlwifi/base.c +@@ -36,6 +36,7 @@ + #include "regd.h" + + #include ++#include + #include + + /* +--- a/drivers/net/wireless/ti/wl1251/main.c ++++ b/drivers/net/wireless/ti/wl1251/main.c +@@ -24,6 +24,9 @@ + #include + #include + #include ++#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,28)) ++#include ++#endif + #include + #include + #include +--- a/drivers/net/wireless/ti/wl1251/spi.c ++++ b/drivers/net/wireless/ti/wl1251/spi.c +@@ -24,6 +24,9 @@ + #include + #include + #include ++#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,28)) ++#include ++#endif + #include + #include + +--- a/net/mac80211/key.c ++++ b/net/mac80211/key.c +@@ -24,6 +24,9 @@ + #include "aes_ccm.h" + #include "aes_cmac.h" + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) ++#include ++#endif + + /** + * DOC: Key handling basics +--- a/net/bluetooth/bnep/sock.c ++++ b/net/bluetooth/bnep/sock.c +@@ -26,6 +26,7 @@ + + #include + #include ++#include + + #include "bnep.h" + +--- a/net/bluetooth/hci_sock.c ++++ b/net/bluetooth/hci_sock.c +@@ -25,6 +25,7 @@ + /* Bluetooth HCI sockets. */ + + #include ++#include + #include + + #include +--- a/net/bluetooth/hidp/sock.c ++++ b/net/bluetooth/hidp/sock.c +@@ -22,6 +22,7 @@ + + #include + #include ++#include + + #include "hidp.h" + +--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c ++++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + #include "core.h" + #include "cfg80211.h" +--- a/drivers/net/wireless/mwifiex/usb.c ++++ b/drivers/net/wireless/mwifiex/usb.c +@@ -19,6 +19,7 @@ + + #include "main.h" + #include "usb.h" ++#include + + #define USB_VERSION "1.0" + +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include "core.h" + #include "rdev-ops.h" + diff --git a/patches/collateral-evolutions/network/07-change-default-rate-alg.patch b/patches/collateral-evolutions/network/07-change-default-rate-alg.patch new file mode 100644 index 000000000000..0584f9d8df72 --- /dev/null +++ b/patches/collateral-evolutions/network/07-change-default-rate-alg.patch @@ -0,0 +1,34 @@ + +Your current kernels configuration (.config and linux/autoconf.h) +are always respected when compiling external modules. Because +of this if you are using an old kernel which preferred the +PID rate control algorithm we cannot force it to use minstrel +instead. Minstrel is now the default rate control algorithm +and we want you to use it. To let you use it we redefine here +the CONFIG_MAC80211_RC_DEFAULT to CONFIG_COMPAT_MAC80211_RC_DEFAULT +and define CONFIG_COMPAT_MAC80211_RC_DEFAULT on config.mk. +Through the compat autoconf we then get it also defined there +at compilation time. + +--- a/net/mac80211/rate.c ++++ b/net/mac80211/rate.c +@@ -24,7 +24,7 @@ struct rate_control_alg { + static LIST_HEAD(rate_ctrl_algs); + static DEFINE_MUTEX(rate_ctrl_mutex); + +-static char *ieee80211_default_rc_algo = CONFIG_MAC80211_RC_DEFAULT; ++static char *ieee80211_default_rc_algo = CONFIG_COMPAT_MAC80211_RC_DEFAULT; + module_param(ieee80211_default_rc_algo, charp, 0644); + MODULE_PARM_DESC(ieee80211_default_rc_algo, + "Default rate control algorithm for mac80211 to use"); +@@ -120,8 +120,8 @@ ieee80211_rate_control_ops_get(const cha + ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo); + + /* try built-in one if specific alg requested but not found */ +- if (!ops && strlen(CONFIG_MAC80211_RC_DEFAULT)) +- ops = ieee80211_try_rate_control_ops_get(CONFIG_MAC80211_RC_DEFAULT); ++ if (!ops && strlen(CONFIG_COMPAT_MAC80211_RC_DEFAULT)) ++ ops = ieee80211_try_rate_control_ops_get(CONFIG_COMPAT_MAC80211_RC_DEFAULT); + kparam_unblock_sysfs_write(ieee80211_default_rc_algo); + + return ops; diff --git a/patches/collateral-evolutions/network/08-rename-config-options.patch b/patches/collateral-evolutions/network/08-rename-config-options.patch new file mode 100644 index 000000000000..518d2338e8b8 --- /dev/null +++ b/patches/collateral-evolutions/network/08-rename-config-options.patch @@ -0,0 +1,187 @@ +This file renames CONFIG_ options that may be defined in older +kernels but that we know we can *safely* rename to other config +option names to ensure we disable building these options at +through this framework. An example here is ath9k's rate control +aglorithm is always selected by default via CONFIG_ATH9K_RATE_CONTROL. +By renaming this to CONFIG_COMPAT_ATH9K_RATE_CONTROL we have +the flexibility to disable it for a replacement driver. + +In kernel 2.6.26 and older CONFIG_IWL4965 was build as an extra +module, but now it is directly included in the iwlagn. + +CONFIG_IWL4965 has to be set to y, to build correctly. + +zd1211rw does not build with kernel < 2.6.28, but it is often activated +in the kernel config of older kernels. We rename the option to +deactivate it on older kernels. +CONFIG_BT_L2CAP and CONFIG_BT_SCO are boolean now, but often set to m +in the kernel config. + +CONFIG_BT_HIDP does not build with older kernel versions. + +--- a/drivers/net/wireless/Makefile ++++ b/drivers/net/wireless/Makefile +@@ -21,7 +21,7 @@ obj-$(CONFIG_PRISM54) += prism54/ + obj-$(CONFIG_HOSTAP) += hostap/ + obj-$(CONFIG_B43) += b43/ + obj-$(CONFIG_B43LEGACY) += b43legacy/ +-obj-$(CONFIG_ZD1211RW) += zd1211rw/ ++obj-$(CONFIG_COMPAT_ZD1211RW) += zd1211rw/ + obj-$(CONFIG_RTL8180) += rtl818x/ + obj-$(CONFIG_RTL8187) += rtl818x/ + obj-$(CONFIG_RTLWIFI) += rtlwifi/ +@@ -53,7 +53,7 @@ obj-$(CONFIG_MAC80211_HWSIM) += mac80211 + + obj-$(CONFIG_WL_TI) += ti/ + +-obj-$(CONFIG_MWIFIEX) += mwifiex/ ++obj-$(CONFIG_COMPAT_MWIFIEX) += mwifiex/ + + obj-$(CONFIG_BRCMFMAC) += brcm80211/ + obj-$(CONFIG_BRCMSMAC) += brcm80211/ +--- a/drivers/net/wireless/iwlegacy/Makefile ++++ b/drivers/net/wireless/iwlegacy/Makefile +@@ -5,7 +5,7 @@ iwlegacy-$(CONFIG_IWLEGACY_DEBUGFS) += d + iwlegacy-objs += $(iwlegacy-m) + + # 4965 +-obj-$(CONFIG_IWL4965) += iwl4965.o ++obj-$(CONFIG_COMPAT_IWL4965) += iwl4965.o + iwl4965-objs := 4965.o 4965-mac.o 4965-rs.o 4965-calib.o + iwl4965-$(CONFIG_IWLEGACY_DEBUGFS) += 4965-debug.o + +--- a/drivers/net/wireless/iwlegacy/common.h ++++ b/drivers/net/wireless/iwlegacy/common.h +@@ -1352,7 +1352,7 @@ struct il_priv { + + } _3945; + #endif +-#if defined(CONFIG_IWL4965) || defined(CONFIG_IWL4965_MODULE) ++#if defined(CONFIG_COMPAT_IWL4965) || defined(CONFIG_COMPAT_IWL4965_MODULE) + struct { + struct il_rx_phy_res last_phy_res; + bool last_phy_res_valid; +--- a/drivers/net/wireless/libertas/Makefile ++++ b/drivers/net/wireless/libertas/Makefile +@@ -17,5 +17,5 @@ libertas_spi-objs += if_spi.o + obj-$(CONFIG_LIBERTAS) += libertas.o + obj-$(CONFIG_LIBERTAS_USB) += usb8xxx.o + obj-$(CONFIG_LIBERTAS_CS) += libertas_cs.o +-obj-$(CONFIG_LIBERTAS_SDIO) += libertas_sdio.o ++obj-$(CONFIG_COMPAT_LIBERTAS_SDIO) += libertas_sdio.o + obj-$(CONFIG_LIBERTAS_SPI) += libertas_spi.o +--- a/drivers/net/wireless/zd1211rw/Makefile ++++ b/drivers/net/wireless/zd1211rw/Makefile +@@ -1,4 +1,4 @@ +-obj-$(CONFIG_ZD1211RW) += zd1211rw.o ++obj-$(CONFIG_COMPAT_ZD1211RW) += zd1211rw.o + + zd1211rw-objs := zd_chip.o zd_mac.o \ + zd_rf_al2230.o zd_rf_rf2959.o \ +--- a/net/bluetooth/Makefile ++++ b/net/bluetooth/Makefile +@@ -6,7 +6,7 @@ obj-$(CONFIG_BT) += bluetooth.o + obj-$(CONFIG_BT_RFCOMM) += rfcomm/ + obj-$(CONFIG_BT_BNEP) += bnep/ + obj-$(CONFIG_BT_CMTP) += cmtp/ +-obj-$(CONFIG_BT_HIDP) += hidp/ ++obj-$(CONFIG_COMPAT_BT_HIDP) += hidp/ + + bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ + hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ +--- a/net/bluetooth/hidp/Makefile ++++ b/net/bluetooth/hidp/Makefile +@@ -2,6 +2,6 @@ + # Makefile for the Linux Bluetooth HIDP layer + # + +-obj-$(CONFIG_BT_HIDP) += hidp.o ++obj-$(CONFIG_COMPAT_BT_HIDP) += hidp.o + + hidp-objs := core.o sock.o +--- a/drivers/net/wireless/ti/wl1251/Makefile ++++ b/drivers/net/wireless/ti/wl1251/Makefile +@@ -4,7 +4,7 @@ wl1251_spi-objs += spi.o + wl1251_sdio-objs += sdio.o + + obj-$(CONFIG_WL1251) += wl1251.o +-obj-$(CONFIG_WL1251_SPI) += wl1251_spi.o +-obj-$(CONFIG_WL1251_SDIO) += wl1251_sdio.o ++obj-$(CONFIG_COMPAT_WL1251_SPI)+= wl1251_spi.o ++obj-$(CONFIG_COMPAT_WL1251_SDIO)+= wl1251_sdio.o + + ccflags-y += -D__CHECK_ENDIAN__ +--- a/drivers/net/wireless/ath/ath9k/Makefile ++++ b/drivers/net/wireless/ath/ath9k/Makefile +@@ -8,7 +8,7 @@ ath9k-y += beacon.o \ + antenna.o + + ath9k-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += mci.o +-ath9k-$(CONFIG_ATH9K_RATE_CONTROL) += rc.o ++ath9k-$(CONFIG_COMPAT_ATH9K_RATE_CONTROL) += rc.o + ath9k-$(CONFIG_ATH9K_PCI) += pci.o + ath9k-$(CONFIG_ATH9K_AHB) += ahb.o + ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -760,7 +760,7 @@ void ath9k_set_hw_capab(struct ath_softc + sc->ant_rx = hw->wiphy->available_antennas_rx; + sc->ant_tx = hw->wiphy->available_antennas_tx; + +-#ifdef CONFIG_ATH9K_RATE_CONTROL ++#ifdef CONFIG_COMPAT_ATH9K_RATE_CONTROL + hw->rate_control_algorithm = "ath9k_rate_control"; + #endif + +--- a/drivers/net/wireless/ath/ath9k/rc.h ++++ b/drivers/net/wireless/ath/ath9k/rc.h +@@ -231,7 +231,7 @@ static inline void ath_debug_stat_retrie + } + #endif + +-#ifdef CONFIG_ATH9K_RATE_CONTROL ++#ifdef CONFIG_COMPAT_ATH9K_RATE_CONTROL + int ath_rate_control_register(void); + void ath_rate_control_unregister(void); + #else +--- a/net/bluetooth/rfcomm/Makefile ++++ b/net/bluetooth/rfcomm/Makefile +@@ -5,4 +5,4 @@ + obj-$(CONFIG_BT_RFCOMM) += rfcomm.o + + rfcomm-y := core.o sock.o +-rfcomm-$(CONFIG_BT_RFCOMM_TTY) += tty.o ++rfcomm-$(CONFIG_COMPAT_BT_RFCOMM_TTY) += tty.o +--- a/include/net/bluetooth/rfcomm.h ++++ b/include/net/bluetooth/rfcomm.h +@@ -357,7 +357,7 @@ struct rfcomm_dev_list_req { + + int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); + +-#ifdef CONFIG_BT_RFCOMM_TTY ++#ifdef CONFIG_COMPAT_BT_RFCOMM_TTY + int rfcomm_init_ttys(void); + void rfcomm_cleanup_ttys(void); + #else +--- a/net/bluetooth/rfcomm/sock.c ++++ b/net/bluetooth/rfcomm/sock.c +@@ -862,7 +862,7 @@ static int rfcomm_sock_ioctl(struct sock + err = bt_sock_ioctl(sock, cmd, arg); + + if (err == -ENOIOCTLCMD) { +-#ifdef CONFIG_BT_RFCOMM_TTY ++#ifdef CONFIG_COMPAT_BT_RFCOMM_TTY + lock_sock(sk); + err = rfcomm_dev_ioctl(sk, cmd, (void __user *) arg); + release_sock(sk); +--- a/drivers/net/wireless/mwifiex/Makefile ++++ b/drivers/net/wireless/mwifiex/Makefile +@@ -39,7 +39,7 @@ mwifiex-y += sta_rx.o + mwifiex-y += uap_txrx.o + mwifiex-y += cfg80211.o + mwifiex-$(CONFIG_DEBUG_FS) += debugfs.o +-obj-$(CONFIG_MWIFIEX) += mwifiex.o ++obj-$(CONFIG_COMPAT_MWIFIEX) += mwifiex.o + + mwifiex_sdio-y += sdio.o + obj-$(CONFIG_MWIFIEX_SDIO) += mwifiex_sdio.o diff --git a/patches/collateral-evolutions/network/09-cfg80211-wext-padding.patch b/patches/collateral-evolutions/network/09-cfg80211-wext-padding.patch new file mode 100644 index 000000000000..5942caed53b2 --- /dev/null +++ b/patches/collateral-evolutions/network/09-cfg80211-wext-padding.patch @@ -0,0 +1,62 @@ +This is a tricky one. + +Consider a kernel that has this code in net/wireless/wext-core.c: + +#ifdef CONFIG_CFG80211_WEXT + if (dev->ieee80211_ptr && dev->ieee80211_ptr->wiphy) + handlers = dev->ieee80211_ptr->wiphy->wext; +#endif +#ifdef CONFIG_WIRELESS_EXT + if (dev->wireless_handlers) + handlers = dev->wireless_handlers; +#endif + +If a kernel is compiled without CONFIG_WIRELESS_EXT then +compat-drivers can't do wireless extensions against it. +However, if the kernel is compiled with CONFIG_CFG80211_WEXT +then it will try to get the wext handlers from struct wiphy. + +Now, struct wiphy in the base kernel and struct wiphy in +compat-drivers don't match, so the kernel crashes!! + +To fix this, add lots of padding to compat-drivers's +struct wiphy so that the "wext" pointer is guaranteed +to be NULL. + +Make sure the padding is larger than the struct so we +don't ever run into this again because the wext pointer +moved due to struct enlargements. + + +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -2259,6 +2259,9 @@ struct wiphy_wowlan_support { + struct wiphy { + /* assign these fields before you register the wiphy */ + ++#define WIPHY_COMPAT_PAD_SIZE 2048 ++ u8 padding[WIPHY_COMPAT_PAD_SIZE]; ++ + /* permanent MAC address(es) */ + u8 perm_addr[ETH_ALEN]; + u8 addr_mask[ETH_ALEN]; +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -290,6 +290,17 @@ struct wiphy *wiphy_new(const struct cfg + struct cfg80211_registered_device *rdev; + int alloc_size; + ++ /* ++ * Make sure the padding is >= the rest of the struct so that we ++ * always keep it large enough to pad out the entire original ++ * kernel's struct. We really only need to make sure it's larger ++ * than the kernel compat is compiled against, but since it'll ++ * only increase in size make sure it's larger than the current ++ * version of it. Subtract since it's included. ++ */ ++ BUILD_BUG_ON(WIPHY_COMPAT_PAD_SIZE < ++ sizeof(struct wiphy) - WIPHY_COMPAT_PAD_SIZE); ++ + WARN_ON(ops->add_key && (!ops->del_key || !ops->set_default_key)); + WARN_ON(ops->auth && (!ops->assoc || !ops->deauth || !ops->disassoc)); + WARN_ON(ops->connect && !ops->disconnect); diff --git a/patches/collateral-evolutions/network/09-threaded-irq.patch b/patches/collateral-evolutions/network/09-threaded-irq.patch new file mode 100644 index 000000000000..a7d2fe616a6b --- /dev/null +++ b/patches/collateral-evolutions/network/09-threaded-irq.patch @@ -0,0 +1,129 @@ +The 2.6.31 kernel has threaded IRQ support and b43 is the first +wireless driver that makes use of it. To support threaded IRSs +on older kernels we built our own struct compat_threaded_irq +to queue_work() onto it as the kernel thread be running the +thread in process context as well. + +--- a/drivers/net/wireless/b43/main.c ++++ b/drivers/net/wireless/b43/main.c +@@ -4212,8 +4212,13 @@ redo: + if (b43_bus_host_is_sdio(dev->dev)) { + b43_sdio_free_irq(dev); + } else { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++ compat_synchronize_threaded_irq(&dev->irq_compat); ++ compat_free_threaded_irq(&dev->irq_compat); ++#else + synchronize_irq(dev->dev->irq); + free_irq(dev->dev->irq, dev); ++#endif + } + mutex_lock(&wl->mutex); + dev = wl->current_dev; +@@ -4255,9 +4260,17 @@ static int b43_wireless_core_start(struc + goto out; + } + } else { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++ err = compat_request_threaded_irq(&dev->irq_compat, ++ dev->dev->irq, ++ b43_interrupt_handler, ++ b43_interrupt_thread_handler, ++ IRQF_SHARED, KBUILD_MODNAME, dev); ++#else + err = request_threaded_irq(dev->dev->irq, b43_interrupt_handler, + b43_interrupt_thread_handler, + IRQF_SHARED, KBUILD_MODNAME, dev); ++#endif + if (err) { + b43err(dev->wl, "Cannot request IRQ-%d\n", + dev->dev->irq); +@@ -5080,6 +5093,10 @@ static int b43_setup_bands(struct b43_wl + + static void b43_wireless_core_detach(struct b43_wldev *dev) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++ if (dev->dev->sdev->bus->bustype != SSB_BUSTYPE_SDIO) ++ compat_destroy_threaded_irq(&dev->irq_compat); ++#endif + /* We release firmware that late to not be required to re-request + * is all the time when we reinit the core. */ + b43_release_firmware(dev); +--- a/drivers/net/wireless/b43/b43.h ++++ b/drivers/net/wireless/b43/b43.h +@@ -859,6 +859,9 @@ struct b43_wldev { + unsigned int tx_count; + unsigned int rx_count; + #endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++ struct compat_threaded_irq irq_compat; ++#endif + }; + + /* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */ +--- a/drivers/net/wireless/ti/wlcore/main.c ++++ b/drivers/net/wireless/ti/wlcore/main.c +@@ -5568,14 +5568,25 @@ static void wlcore_nvs_cb(const struct f + wl->set_power = pdata->set_power; + wl->if_ops = pdata->ops; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) ++ irqflags = IRQF_TRIGGER_RISING; ++#else + if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) + irqflags = IRQF_TRIGGER_RISING; + else + irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT; ++#endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++ ret = compat_request_threaded_irq(&wl->irq_compat, wl->irq, ++ wl12xx_hardirq, wlcore_irq, ++ irqflags, ++ pdev->name, wl); ++#else + ret = request_threaded_irq(wl->irq, wl12xx_hardirq, wlcore_irq, + irqflags, + pdev->name, wl); ++#endif + if (ret < 0) { + wl1271_error("request_irq() failed: %d", ret); + goto out_free_nvs; +@@ -5650,7 +5661,11 @@ out_unreg: + wl1271_unregister_hw(wl); + + out_irq: ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++ compat_free_threaded_irq(&wl->irq_compat); ++#else + free_irq(wl->irq, wl); ++#endif + + out_free_nvs: + kfree(wl->nvs); +@@ -5696,7 +5711,12 @@ int __devexit wlcore_remove(struct platf + disable_irq_wake(wl->irq); + } + wl1271_unregister_hw(wl); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++ compat_free_threaded_irq(&wl->irq_compat); ++ compat_destroy_threaded_irq(&wl->irq_compat); ++#else + free_irq(wl->irq, wl); ++#endif + wlcore_free_hw(wl); + + return 0; +--- a/drivers/net/wireless/ti/wlcore/wlcore.h ++++ b/drivers/net/wireless/ti/wlcore/wlcore.h +@@ -149,7 +149,9 @@ struct wl1271 { + bool initialized; + struct ieee80211_hw *hw; + bool mac80211_registered; +- ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++ struct compat_threaded_irq irq_compat; ++#endif + struct device *dev; + struct platform_device *pdev; + diff --git a/patches/collateral-evolutions/network/10-add-wext-handlers-to-netdev.patch b/patches/collateral-evolutions/network/10-add-wext-handlers-to-netdev.patch new file mode 100644 index 000000000000..d9977d7e1251 --- /dev/null +++ b/patches/collateral-evolutions/network/10-add-wext-handlers-to-netdev.patch @@ -0,0 +1,47 @@ +The patch "wext: refactor" by Johannes Berg refactored +wext code so that new kernels no longer get the wext +handlers through struct netdevice, instead they get +it through the struct wiphy which is cfg80211 specific. + +For old kernels this means you get not wext handlers +anymore when backporting code, this adds the wext handler +back to the netdevice wireless_handlers to let compat +users use wext again. + +We do this for every kernel version because the struct wiphy +is changing from kernel version to version. At least the +struct from kernel 2.6.33 and 2.6.34 are incompatible and +the kernel would dereference some wrong type in the struct +and oops. The old interface is not affected by this. This +will cause that CONFIG_CFG80211_WEXT still depends on +CONFIG_WIRELESS_EXT in compat-drivers. + +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -345,10 +345,6 @@ struct wiphy *wiphy_new(const struct cfg + INIT_LIST_HEAD(&rdev->bss_list); + INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); + INIT_WORK(&rdev->sched_scan_results_wk, __cfg80211_sched_scan_results); +-#ifdef CONFIG_CFG80211_WEXT +- rdev->wiphy.wext = &cfg80211_wext_handler; +-#endif +- + device_initialize(&rdev->wiphy.dev); + rdev->wiphy.dev.class = &ieee80211_class; + rdev->wiphy.dev.platform_data = rdev; +@@ -871,6 +867,15 @@ static int cfg80211_netdev_notifier_call + wdev->sme_state = CFG80211_SME_IDLE; + mutex_unlock(&rdev->devlist_mtx); + #ifdef CONFIG_CFG80211_WEXT ++#ifdef CONFIG_WIRELESS_EXT ++ if (!dev->wireless_handlers) ++ dev->wireless_handlers = &cfg80211_wext_handler; ++#else ++ printk_once(KERN_WARNING "cfg80211: wext will not work because " ++ "kernel was compiled with CONFIG_WIRELESS_EXT=n. " ++ "Tools using wext interface, like iwconfig will " ++ "not work.\n"); ++#endif + wdev->wext.default_key = -1; + wdev->wext.default_mgmt_key = -1; + wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; diff --git a/patches/collateral-evolutions/network/11-dev-pm-ops.patch b/patches/collateral-evolutions/network/11-dev-pm-ops.patch new file mode 100644 index 000000000000..9001b52bfe24 --- /dev/null +++ b/patches/collateral-evolutions/network/11-dev-pm-ops.patch @@ -0,0 +1,429 @@ +The 2.6.29 kernel has new struct dev_pm_ops [1] which are used +on the pci device to distinguish power management hooks for suspend +to RAM and hibernation. Older kernels don't have these so we need +to resort back to the good ol' suspend/resume. Fortunately the calls +are not so different so it should be possible to resuse the same +calls on compat code with only slight modifications. + +[1] http://lxr.linux.no/#linux+v2.6.29/include/linux/pm.h#L170 + +--- a/drivers/bcma/host_pci.c ++++ b/drivers/bcma/host_pci.c +@@ -257,6 +257,9 @@ static int bcma_host_pci_resume(struct d + return bcma_bus_resume(bus); + } + ++compat_pci_suspend(bcma_host_pci_suspend) ++compat_pci_resume(bcma_host_pci_resume) ++ + static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend, + bcma_host_pci_resume); + #define BCMA_PM_OPS (&bcma_pm_ops) +@@ -285,7 +288,12 @@ static struct pci_driver bcma_pci_bridge + .id_table = bcma_pci_bridge_tbl, + .probe = bcma_host_pci_probe, + .remove = __devexit_p(bcma_host_pci_remove), ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = BCMA_PM_OPS, ++#elif defined(CONFIG_PM) ++ .suspend = bcma_host_pci_suspend_compat, ++ .resume = bcma_host_pci_resume_compat, ++#endif + }; + + int __init bcma_host_pci_init(void) +--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c ++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +@@ -2691,6 +2691,9 @@ static const struct pci_error_handlers a + .resume = atl1c_io_resume, + }; + ++compat_pci_suspend(atl1c_suspend) ++compat_pci_resume(atl1c_resume) ++ + static SIMPLE_DEV_PM_OPS(atl1c_pm_ops, atl1c_suspend, atl1c_resume); + + static struct pci_driver atl1c_driver = { +@@ -2700,7 +2703,12 @@ static struct pci_driver atl1c_driver = + .remove = __devexit_p(atl1c_remove), + .shutdown = atl1c_shutdown, + .err_handler = &atl1c_err_handler, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = &atl1c_pm_ops, ++#elif defined(CONFIG_PM_SLEEP) ++ .suspend = atl1c_suspend_compat, ++ .resume = atl1c_resume_compat, ++#endif + }; + + /** +--- a/drivers/net/ethernet/atheros/atlx/atl1.c ++++ b/drivers/net/ethernet/atheros/atlx/atl1.c +@@ -2877,6 +2877,9 @@ static int atl1_resume(struct device *de + return 0; + } + ++compat_pci_suspend(atl1_suspend) ++compat_pci_resume(atl1_resume) ++ + static SIMPLE_DEV_PM_OPS(atl1_pm_ops, atl1_suspend, atl1_resume); + #define ATL1_PM_OPS (&atl1_pm_ops) + +@@ -3148,7 +3151,12 @@ static struct pci_driver atl1_driver = { + .probe = atl1_probe, + .remove = __devexit_p(atl1_remove), + .shutdown = atl1_shutdown, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = ATL1_PM_OPS, ++#elif defined(CONFIG_PM_SLEEP) ++ .suspend = atl1_suspend_compat, ++ .resume = atl1_resume_compat, ++#endif + }; + + /** +--- a/drivers/net/wireless/ath/ath5k/pci.c ++++ b/drivers/net/wireless/ath/ath5k/pci.c +@@ -326,6 +326,9 @@ static int ath5k_pci_resume(struct devic + return 0; + } + ++compat_pci_suspend(ath5k_pci_suspend) ++compat_pci_resume(ath5k_pci_resume) ++ + static SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume); + #define ATH5K_PM_OPS (&ath5k_pm_ops) + #else +@@ -337,7 +340,12 @@ static struct pci_driver ath5k_pci_drive + .id_table = ath5k_pci_id_table, + .probe = ath5k_pci_probe, + .remove = __devexit_p(ath5k_pci_remove), ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = ATH5K_PM_OPS, ++#elif defined(CONFIG_PM_SLEEP) ++ .suspend = ath5k_pci_suspend_compat, ++ .resume = ath5k_pci_resume_compat, ++#endif + }; + + module_pci_driver(ath5k_pci_driver); +--- a/drivers/net/wireless/ath/ath9k/pci.c ++++ b/drivers/net/wireless/ath/ath9k/pci.c +@@ -333,14 +333,10 @@ static int ath_pci_resume(struct device + return 0; + } + +-static const struct dev_pm_ops ath9k_pm_ops = { +- .suspend = ath_pci_suspend, +- .resume = ath_pci_resume, +- .freeze = ath_pci_suspend, +- .thaw = ath_pci_resume, +- .poweroff = ath_pci_suspend, +- .restore = ath_pci_resume, +-}; ++compat_pci_suspend(ath_pci_suspend) ++compat_pci_resume(ath_pci_resume) ++ ++static SIMPLE_DEV_PM_OPS(ath9k_pm_ops, ath_pci_suspend, ath_pci_resume); + + #define ATH9K_PM_OPS (&ath9k_pm_ops) + +@@ -358,7 +354,12 @@ static struct pci_driver ath_pci_driver + .id_table = ath_pci_id_table, + .probe = ath_pci_probe, + .remove = ath_pci_remove, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = ATH9K_PM_OPS, ++#elif defined(CONFIG_PM) ++ .suspend = ath_pci_suspend_compat, ++ .resume = ath_pci_resume_compat, ++#endif + }; + + int ath_pci_init(void) +--- a/drivers/net/wireless/iwlegacy/3945-mac.c ++++ b/drivers/net/wireless/iwlegacy/3945-mac.c +@@ -3885,7 +3885,12 @@ static struct pci_driver il3945_driver = + .id_table = il3945_hw_card_ids, + .probe = il3945_pci_probe, + .remove = __devexit_p(il3945_pci_remove), ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = IL_LEGACY_PM_OPS, ++#elif defined(CONFIG_PM) ++ .suspend = il_pci_suspend_compat, ++ .resume = il_pci_resume_compat, ++#endif + }; + + static int __init +--- a/drivers/net/wireless/iwlegacy/4965-mac.c ++++ b/drivers/net/wireless/iwlegacy/4965-mac.c +@@ -6773,7 +6773,12 @@ static struct pci_driver il4965_driver = + .id_table = il4965_hw_card_ids, + .probe = il4965_pci_probe, + .remove = __devexit_p(il4965_pci_remove), ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = IL_LEGACY_PM_OPS, ++#elif defined(CONFIG_PM) ++ .suspend = il_pci_suspend_compat, ++ .resume = il_pci_resume_compat, ++#endif + }; + + static int __init +--- a/drivers/net/wireless/iwlegacy/common.c ++++ b/drivers/net/wireless/iwlegacy/common.c +@@ -4906,8 +4906,17 @@ il_pci_resume(struct device *device) + return 0; + } + ++compat_pci_suspend(il_pci_suspend) ++compat_pci_resume(il_pci_resume) ++ + SIMPLE_DEV_PM_OPS(il_pm_ops, il_pci_suspend, il_pci_resume); ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + EXPORT_SYMBOL(il_pm_ops); ++#else ++EXPORT_SYMBOL(il_pci_suspend_compat); ++EXPORT_SYMBOL(il_pci_resume_compat); ++#endif + + #endif /* CONFIG_PM */ + +--- a/drivers/net/wireless/iwlegacy/common.h ++++ b/drivers/net/wireless/iwlegacy/common.h +@@ -1843,7 +1843,14 @@ __le32 il_add_beacon_time(struct il_priv + u32 beacon_interval); + + #ifdef CONFIG_PM ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) ++int il_pci_suspend_compat(struct pci_dev *pdev, pm_message_t state); ++int il_pci_resume_compat(struct pci_dev *pdev); ++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) ++extern struct dev_pm_ops il_pm_ops; ++#else + extern const struct dev_pm_ops il_pm_ops; ++#endif + + #define IL_LEGACY_PM_OPS (&il_pm_ops) + +--- a/drivers/net/wireless/iwlwifi/pcie/drv.c ++++ b/drivers/net/wireless/iwlwifi/pcie/drv.c +@@ -338,6 +338,9 @@ static int iwl_pci_resume(struct device + return iwl_trans_resume(iwl_trans); + } + ++compat_pci_suspend(iwl_pci_suspend) ++compat_pci_resume(iwl_pci_resume) ++ + static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume); + + #define IWL_PM_OPS (&iwl_dev_pm_ops) +@@ -353,7 +356,12 @@ static struct pci_driver iwl_pci_driver + .id_table = iwl_hw_card_ids, + .probe = iwl_pci_probe, + .remove = __devexit_p(iwl_pci_remove), ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = IWL_PM_OPS, ++#elif defined(CONFIG_PM) ++ .suspend = iwl_pci_suspend_compat, ++ .resume = iwl_pci_resume_compat, ++#endif + }; + + int __must_check iwl_pci_register_driver(void) +--- a/drivers/net/wireless/libertas/if_spi.c ++++ b/drivers/net/wireless/libertas/if_spi.c +@@ -1249,6 +1249,7 @@ static int __devexit libertas_spi_remove + return 0; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + static int if_spi_suspend(struct device *dev) + { + struct spi_device *spi = to_spi_device(dev); +@@ -1282,6 +1283,7 @@ static const struct dev_pm_ops if_spi_pm + .suspend = if_spi_suspend, + .resume = if_spi_resume, + }; ++#endif + + static struct spi_driver libertas_spi_driver = { + .probe = if_spi_probe, +@@ -1289,7 +1291,9 @@ static struct spi_driver libertas_spi_dr + .driver = { + .name = "libertas_spi", + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .pm = &if_spi_pm_ops, ++#endif + }, + }; + +--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c ++++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +@@ -372,21 +372,22 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use + MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); + MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); + +-static const struct dev_pm_ops rtlwifi_pm_ops = { +- .suspend = rtl_pci_suspend, +- .resume = rtl_pci_resume, +- .freeze = rtl_pci_suspend, +- .thaw = rtl_pci_resume, +- .poweroff = rtl_pci_suspend, +- .restore = rtl_pci_resume, +-}; ++compat_pci_suspend(rtl_pci_suspend) ++compat_pci_resume(rtl_pci_resume) ++ ++static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); + + static struct pci_driver rtl92ce_driver = { + .name = KBUILD_MODNAME, + .id_table = rtl92ce_pci_ids, + .probe = rtl_pci_probe, + .remove = rtl_pci_disconnect, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = &rtlwifi_pm_ops, ++#elif defined(CONFIG_PM) ++ .suspend = rtl_pci_suspend_compat, ++ .resume = rtl_pci_resume_compat, ++#endif + }; + + module_pci_driver(rtl92ce_driver); +--- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c ++++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c +@@ -378,21 +378,22 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use + MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); + MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); + +-static const struct dev_pm_ops rtlwifi_pm_ops = { +- .suspend = rtl_pci_suspend, +- .resume = rtl_pci_resume, +- .freeze = rtl_pci_suspend, +- .thaw = rtl_pci_resume, +- .poweroff = rtl_pci_suspend, +- .restore = rtl_pci_resume, +-}; ++compat_pci_suspend(rtl_pci_suspend) ++compat_pci_resume(rtl_pci_resume) ++ ++static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); + + static struct pci_driver rtl92de_driver = { + .name = KBUILD_MODNAME, + .id_table = rtl92de_pci_ids, + .probe = rtl_pci_probe, + .remove = rtl_pci_disconnect, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = &rtlwifi_pm_ops, ++#elif defined(CONFIG_PM) ++ .suspend = rtl_pci_suspend_compat, ++ .resume = rtl_pci_resume_compat, ++#endif + }; + + /* add global spin lock to solve the problem that +--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c ++++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c +@@ -432,21 +432,22 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use + MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); + MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); + +-static const struct dev_pm_ops rtlwifi_pm_ops = { +- .suspend = rtl_pci_suspend, +- .resume = rtl_pci_resume, +- .freeze = rtl_pci_suspend, +- .thaw = rtl_pci_resume, +- .poweroff = rtl_pci_suspend, +- .restore = rtl_pci_resume, +-}; ++compat_pci_suspend(rtl_pci_suspend) ++compat_pci_resume(rtl_pci_resume) ++ ++static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); + + static struct pci_driver rtl92se_driver = { + .name = KBUILD_MODNAME, + .id_table = rtl92se_pci_ids, + .probe = rtl_pci_probe, + .remove = rtl_pci_disconnect, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = &rtlwifi_pm_ops, ++#elif defined(CONFIG_PM) ++ .suspend = rtl_pci_suspend_compat, ++ .resume = rtl_pci_resume_compat, ++#endif + }; + + module_pci_driver(rtl92se_driver); +--- a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c ++++ b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c +@@ -367,21 +367,22 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use + MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); + MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); + +-static const struct dev_pm_ops rtlwifi_pm_ops = { +- .suspend = rtl_pci_suspend, +- .resume = rtl_pci_resume, +- .freeze = rtl_pci_suspend, +- .thaw = rtl_pci_resume, +- .poweroff = rtl_pci_suspend, +- .restore = rtl_pci_resume, +-}; ++compat_pci_suspend(rtl_pci_suspend) ++compat_pci_resume(rtl_pci_resume) ++ ++static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); + + static struct pci_driver rtl8723ae_driver = { + .name = KBUILD_MODNAME, + .id_table = rtl8723ae_pci_ids, + .probe = rtl_pci_probe, + .remove = rtl_pci_disconnect, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = &rtlwifi_pm_ops, ++#elif defined(CONFIG_PM) ++ .suspend = rtl_pci_suspend_compat, ++ .resume = rtl_pci_resume_compat, ++#endif + }; + + module_pci_driver(rtl8723ae_driver); +--- a/drivers/net/wireless/p54/p54pci.c ++++ b/drivers/net/wireless/p54/p54pci.c +@@ -681,14 +681,10 @@ static int p54p_resume(struct device *de + return pci_set_power_state(pdev, PCI_D0); + } + +-static const struct dev_pm_ops p54pci_pm_ops = { +- .suspend = p54p_suspend, +- .resume = p54p_resume, +- .freeze = p54p_suspend, +- .thaw = p54p_resume, +- .poweroff = p54p_suspend, +- .restore = p54p_resume, +-}; ++compat_pci_suspend(p54p_suspend) ++compat_pci_resume(p54p_resume) ++ ++static SIMPLE_DEV_PM_OPS(p54pci_pm_ops, p54p_suspend, p54p_resume); + + #define P54P_PM_OPS (&p54pci_pm_ops) + #else +@@ -700,7 +696,12 @@ static struct pci_driver p54p_driver = { + .id_table = p54p_table, + .probe = p54p_probe, + .remove = __devexit_p(p54p_remove), ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + .driver.pm = P54P_PM_OPS, ++#elif defined(CONFIG_PM) ++ .suspend = p54p_suspend_compat, ++ .resume = p54p_resume_compat, ++#endif + }; + + module_pci_driver(p54p_driver); diff --git a/patches/collateral-evolutions/network/12-iw_handler-changes.patch b/patches/collateral-evolutions/network/12-iw_handler-changes.patch new file mode 100644 index 000000000000..5b22ef80d662 --- /dev/null +++ b/patches/collateral-evolutions/network/12-iw_handler-changes.patch @@ -0,0 +1,14 @@ +--- a/drivers/net/wireless/ipw2x00/ipw2100.c ++++ b/drivers/net/wireless/ipw2x00/ipw2100.c +@@ -6106,7 +6106,11 @@ static struct net_device *ipw2100_alloc_ + netdev_attach_ops(dev, &ipw2100_netdev_ops); + dev->ethtool_ops = &ipw2100_ethtool_ops; + dev->wireless_handlers = &ipw2100_wx_handler_def; ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + priv->wireless_data.libipw = priv->ieee; ++#else ++ priv->wireless_data.ieee80211 = (struct ieee80211_device *) priv->ieee; ++#endif + dev->wireless_data = &priv->wireless_data; + dev->watchdog_timeo = 3 * HZ; + dev->irq = 0; diff --git a/patches/collateral-evolutions/network/12-mac80211-disable-tx-status.patch b/patches/collateral-evolutions/network/12-mac80211-disable-tx-status.patch new file mode 100644 index 000000000000..de530519d8d8 --- /dev/null +++ b/patches/collateral-evolutions/network/12-mac80211-disable-tx-status.patch @@ -0,0 +1,24 @@ +We can't possibly backport the wifi TX status since +skb_shinfo()->tx_flags used to be a union and there +is no way to make the & work properly in that case. +So we need to just ifdef this part out. + + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -1989,6 +1989,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s + goto fail_rcu; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + if (unlikely(!multicast && skb->sk && + skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) { + struct sk_buff *orig_skb = skb; +@@ -2027,6 +2028,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s + skb = orig_skb; + } + } ++#endif + + /* + * If the skb is shared we need to obtain our own copy. diff --git a/patches/collateral-evolutions/network/14-device-type.patch b/patches/collateral-evolutions/network/14-device-type.patch new file mode 100644 index 000000000000..765a783cb227 --- /dev/null +++ b/patches/collateral-evolutions/network/14-device-type.patch @@ -0,0 +1,56 @@ +Kernels >= 2.6.32 can identify the type of device netdevice +so that sysfs can be used to get this. We never really had a +systematic way of doing this -- now we do through the +SET_NETDEV_DEVTYPE() macro. For older kernels we make the +SET_NETDEV_DEVTYPE() be a no-op this means the wireless type +we define is unused so we ucomment it simply to avoid a +compile warning. + +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -803,9 +803,11 @@ void cfg80211_unregister_wdev(struct wir + } + EXPORT_SYMBOL(cfg80211_unregister_wdev); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) + static struct device_type wiphy_type = { + .name = "wlan", + }; ++#endif + + void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, + enum nl80211_iftype iftype, int num) +--- a/net/bluetooth/bnep/core.c ++++ b/net/bluetooth/bnep/core.c +@@ -527,9 +527,11 @@ static struct device *bnep_get_device(st + return conn ? &conn->dev : NULL; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) + static struct device_type bnep_type = { + .name = "bluetooth", + }; ++#endif + + int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) + { +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1339,13 +1339,17 @@ static const struct net_device_ops usbne + + // precondition: never called in_interrupt + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) + static struct device_type wlan_type = { + .name = "wlan", + }; ++#endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) + static struct device_type wwan_type = { + .name = "wwan", + }; ++#endif + + int + usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) diff --git a/patches/collateral-evolutions/network/15-symbol-export-conflicts.patch b/patches/collateral-evolutions/network/15-symbol-export-conflicts.patch new file mode 100644 index 000000000000..a836b9457125 --- /dev/null +++ b/patches/collateral-evolutions/network/15-symbol-export-conflicts.patch @@ -0,0 +1,18 @@ +In kernel < 2.6.32 libipw also exports ieee80211_rx. +To avoid conflicts with the other export we rename our. + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -3203,7 +3203,12 @@ void ieee80211_rx(struct ieee80211_hw *h + drop: + kfree_skb(skb); + } ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) + EXPORT_SYMBOL(ieee80211_rx); ++#else ++EXPORT_SYMBOL(mac80211_ieee80211_rx); ++#endif ++ + + /* This is a version of the rx handler that can be called from hard irq + * context. Post the skb on the queue and schedule the tasklet */ diff --git a/patches/collateral-evolutions/network/16-bluetooth.patch b/patches/collateral-evolutions/network/16-bluetooth.patch new file mode 100644 index 000000000000..8c690ae76a71 --- /dev/null +++ b/patches/collateral-evolutions/network/16-bluetooth.patch @@ -0,0 +1,575 @@ +These changes are required to backport blueooth. A lot can be optimized +here still, but for now we keep this here. + +--- a/drivers/bluetooth/hci_ldisc.c ++++ b/drivers/bluetooth/hci_ldisc.c +@@ -297,8 +297,13 @@ static int hci_uart_tty_open(struct tty_ + /* FIXME: why is this needed. Note don't use ldisc_ref here as the + open path is before the ldisc is referencable */ + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) + if (tty->ldisc->ops->flush_buffer) + tty->ldisc->ops->flush_buffer(tty); ++#else ++ if (tty->ldisc.ops->flush_buffer) ++ tty->ldisc.ops->flush_buffer(tty); ++#endif + tty_driver_flush_buffer(tty); + + return 0; +@@ -524,7 +529,11 @@ static int hci_uart_tty_ioctl(struct tty + return hu->hdev_flags; + + default: ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) + err = n_tty_ioctl_helper(tty, file, cmd, arg); ++#else ++ err = n_tty_ioctl(tty, file, cmd, arg); ++#endif + break; + } + +--- a/net/bluetooth/af_bluetooth.c ++++ b/net/bluetooth/af_bluetooth.c +@@ -112,8 +112,12 @@ int bt_sock_unregister(int proto) + } + EXPORT_SYMBOL(bt_sock_unregister); + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int bt_sock_create(struct net *net, struct socket *sock, int proto, + int kern) ++#else ++static int bt_sock_create(struct net *net, struct socket *sock, int proto) ++#endif + { + int err; + +@@ -131,7 +135,11 @@ static int bt_sock_create(struct net *ne + read_lock(&bt_proto_lock); + + if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + err = bt_proto[proto]->create(net, sock, proto, kern); ++#else ++ err = bt_proto[proto]->create(net, sock, proto); ++#endif + if (!err) + bt_sock_reclassify_lock(sock->sk, proto); + module_put(bt_proto[proto]->owner); +@@ -464,7 +472,11 @@ int bt_sock_ioctl(struct socket *sock, u + if (sk->sk_state == BT_LISTEN) + return -EINVAL; + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); ++#else ++ amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); ++#endif + if (amount < 0) + amount = 0; + err = put_user(amount, (int __user *) arg); +--- a/net/bluetooth/cmtp/capi.c ++++ b/net/bluetooth/cmtp/capi.c +@@ -384,7 +384,11 @@ static void cmtp_reset_ctr(struct capi_c + + BT_DBG("ctrl %p", ctrl); + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) + capi_ctr_down(ctrl); ++#else ++ capi_ctr_reseted(ctrl); ++#endif + + atomic_inc(&session->terminate); + wake_up_process(session->task); +--- a/net/bluetooth/hci_sock.c ++++ b/net/bluetooth/hci_sock.c +@@ -884,8 +884,13 @@ drop: + goto done; + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + static int hci_sock_setsockopt(struct socket *sock, int level, int optname, + char __user *optval, unsigned int len) ++#else ++static int hci_sock_setsockopt(struct socket *sock, int level, int optname, ++ char __user *optval, int len) ++#endif + { + struct hci_ufilter uf = { .opcode = 0 }; + struct sock *sk = sock->sk; +@@ -1059,8 +1064,12 @@ static struct proto hci_sk_proto = { + .obj_size = sizeof(struct hci_pinfo) + }; + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int hci_sock_create(struct net *net, struct socket *sock, int protocol, + int kern) ++#else ++static int hci_sock_create(struct net *net, struct socket *sock, int protocol) ++#endif + { + struct sock *sk; + +--- a/net/bluetooth/hci_sysfs.c ++++ b/net/bluetooth/hci_sysfs.c +@@ -71,7 +71,11 @@ static struct attribute_group bt_link_gr + .attrs = bt_link_attrs, + }; + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + static const struct attribute_group *bt_link_groups[] = { ++#else ++static struct attribute_group *bt_link_groups[] = { ++#endif + &bt_link_group, + NULL + }; +@@ -140,7 +144,11 @@ void hci_conn_del_sysfs(struct hci_conn + dev = device_find_child(&conn->dev, NULL, __match_tty); + if (!dev) + break; ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) + device_move(dev, NULL, DPM_ORDER_DEV_LAST); ++#else ++ device_move(dev, NULL); ++#endif + put_device(dev); + } + +@@ -378,7 +386,11 @@ static struct attribute_group bt_host_gr + .attrs = bt_host_attrs, + }; + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + static const struct attribute_group *bt_host_groups[] = { ++#else ++static struct attribute_group *bt_host_groups[] = { ++#endif + &bt_host_group, + NULL + }; +--- a/net/bluetooth/hidp/core.c ++++ b/net/bluetooth/hidp/core.c +@@ -380,6 +380,7 @@ err: + return ret; + } + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count, + unsigned char report_type) + { +@@ -438,6 +439,16 @@ err: + mutex_unlock(&session->report_mutex); + return ret; + } ++#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) ++static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count) ++{ ++ if (hidp_send_ctrl_message(hid->driver_data, ++ HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE, ++ data, count)) ++ return -ENOMEM; ++ return count; ++} ++#endif + + static void hidp_idle_timeout(unsigned long arg) + { +@@ -739,8 +750,14 @@ static int hidp_session(void *arg) + } + + if (session->hid) { ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) + hid_destroy_device(session->hid); + session->hid = NULL; ++#else ++ if (session->hid->claimed & HID_CLAIMED_INPUT) ++ hidinput_disconnect(session->hid); ++ hid_free_device(session->hid); ++#endif + } + + /* Wakeup user-space polling for socket errors */ +@@ -851,6 +868,70 @@ static void hidp_close(struct hid_device + { + } + ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)) ++static const struct { ++ __u16 idVendor; ++ __u16 idProduct; ++ unsigned quirks; ++} hidp_blacklist[] = { ++ /* Apple wireless Mighty Mouse */ ++ { 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, ++ ++ { } /* Terminating entry */ ++}; ++static void hidp_setup_quirks(struct hid_device *hid) ++{ ++ unsigned int n; ++ ++ for (n = 0; hidp_blacklist[n].idVendor; n++) ++ if (hidp_blacklist[n].idVendor == le16_to_cpu(hid->vendor) && ++ hidp_blacklist[n].idProduct == le16_to_cpu(hid->product)) ++ hid->quirks = hidp_blacklist[n].quirks; ++} ++ ++static void hidp_setup_hid(struct hidp_session *session, ++ struct hidp_connadd_req *req) ++{ ++ struct hid_device *hid = session->hid; ++ struct hid_report *report; ++ bdaddr_t src, dst; ++ ++ session->hid = hid; ++ ++ hid->driver_data = session; ++ ++ baswap(&src, &bt_sk(session->ctrl_sock->sk)->src); ++ baswap(&dst, &bt_sk(session->ctrl_sock->sk)->dst); ++ ++ hid->bus = BUS_BLUETOOTH; ++ hid->vendor = req->vendor; ++ hid->product = req->product; ++ hid->version = req->version; ++ hid->country = req->country; ++ ++ strncpy(hid->name, req->name, 128); ++ strncpy(hid->phys, batostr(&src), 64); ++ strncpy(hid->uniq, batostr(&dst), 64); ++ ++ hid->dev = hidp_get_device(session); ++ hid->hid_open = hidp_open; ++ hid->hid_close = hidp_close; ++ ++ hid->hidinput_input_event = hidp_hidinput_event; ++ ++ hidp_setup_quirks(hid); ++ ++ list_for_each_entry(report, &hid->report_enum[HID_INPUT_REPORT].report_list, list) ++ hidp_send_report(session, report); ++ ++ list_for_each_entry(report, &hid->report_enum[HID_FEATURE_REPORT].report_list, list) ++ hidp_send_report(session, report); ++ ++ if (hidinput_connect(hid) == 0) ++ hid->claimed |= HID_CLAIMED_INPUT; ++} ++#else ++ + static int hidp_parse(struct hid_device *hid) + { + struct hidp_session *session = hid->driver_data; +@@ -942,7 +1023,9 @@ static int hidp_setup_hid(struct hidp_se + hid->dev.parent = &session->conn->dev; + hid->ll_driver = &hidp_hid_driver; + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) + hid->hid_get_raw_report = hidp_get_raw_report; ++#endif + hid->hid_output_raw_report = hidp_output_raw_report; + + return 0; +@@ -953,6 +1036,7 @@ fault: + + return err; + } ++#endif + + int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock) + { +@@ -968,6 +1052,39 @@ int hidp_add_connection(struct hidp_conn + + BT_DBG("rd_data %p rd_size %d", req->rd_data, req->rd_size); + ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)) ++ if (req->rd_size > 0) { ++ unsigned char *buf = kmalloc(req->rd_size, GFP_KERNEL); ++ ++ if (!buf) { ++ kfree(session); ++ return -ENOMEM; ++ } ++ ++ if (copy_from_user(buf, req->rd_data, req->rd_size)) { ++ kfree(buf); ++ kfree(session); ++ return -EFAULT; ++ } ++ ++ session->hid = hid_parse_report(buf, req->rd_size); ++ ++ kfree(buf); ++ ++ if (!session->hid) { ++ kfree(session); ++ return -EINVAL; ++ } ++ } ++ ++ if (!session->hid) { ++ session->input = input_allocate_device(); ++ if (!session->input) { ++ kfree(session); ++ return -ENOMEM; ++ } ++ } ++#endif + down_write(&hidp_session_sem); + + s = __hidp_get_session(&bt_sk(ctrl_sock->sk)->dst); +@@ -1015,6 +1132,7 @@ int hidp_add_connection(struct hidp_conn + + __hidp_link_session(session); + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) + if (req->rd_size > 0) { + err = hidp_setup_hid(session, req); + if (err) +@@ -1026,6 +1144,16 @@ int hidp_add_connection(struct hidp_conn + if (err < 0) + goto purge; + } ++#else ++ if (session->input) { ++ err = hidp_setup_input(session, req); ++ if (err < 0) ++ goto failed; ++ } ++ ++ if (session->hid) ++ hidp_setup_hid(session, req); ++#endif + + hidp_set_timer(session); + +@@ -1084,6 +1212,7 @@ unlink: + session->input = NULL; + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) + if (session->hid) { + hid_destroy_device(session->hid); + session->hid = NULL; +@@ -1097,10 +1226,15 @@ purge: + + skb_queue_purge(&session->ctrl_transmit); + skb_queue_purge(&session->intr_transmit); ++#endif + + failed: + up_write(&hidp_session_sem); + ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)) ++ if (session->hid) ++ hid_free_device(session->hid); ++#endif + kfree(session); + return err; + } +--- a/net/bluetooth/rfcomm/sock.c ++++ b/net/bluetooth/rfcomm/sock.c +@@ -306,8 +306,13 @@ static struct sock *rfcomm_sock_alloc(st + return sk; + } + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int rfcomm_sock_create(struct net *net, struct socket *sock, + int protocol, int kern) ++#else ++static int rfcomm_sock_create(struct net *net, struct socket *sock, ++ int protocol) ++#endif + { + struct sock *sk; + +@@ -662,7 +667,11 @@ static int rfcomm_sock_setsockopt_old(st + return err; + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) ++#else ++static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) ++#endif + { + struct sock *sk = sock->sk; + struct bt_security sec; +--- a/net/bluetooth/rfcomm/tty.c ++++ b/net/bluetooth/rfcomm/tty.c +@@ -713,8 +713,12 @@ static int rfcomm_tty_open(struct tty_st + remove_wait_queue(&dev->wait, &wait); + + if (err == 0) ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) + device_move(dev->tty_dev, rfcomm_get_device(dev), + DPM_ORDER_DEV_AFTER_PARENT); ++#else ++ device_move(dev->tty_dev, rfcomm_get_device(dev)); ++#endif + + rfcomm_tty_copy_pending(dev); + +@@ -738,7 +742,11 @@ static void rfcomm_tty_close(struct tty_ + if (!--dev->port.count) { + spin_unlock_irqrestore(&dev->port.lock, flags); + if (dev->tty_dev->parent) ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) + device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST); ++#else ++ device_move(dev->tty_dev, NULL); ++#endif + + /* Close DLC and dettach TTY */ + rfcomm_dlc_close(dev->dlc, 0); +@@ -814,7 +822,11 @@ static int rfcomm_tty_write_room(struct + return room; + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) + static int rfcomm_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) ++#else ++static int rfcomm_tty_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, unsigned long arg) ++#endif + { + BT_DBG("tty %p cmd 0x%02x", tty, cmd); + +@@ -1073,7 +1085,11 @@ static void rfcomm_tty_hangup(struct tty + } + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) + static int rfcomm_tty_tiocmget(struct tty_struct *tty) ++#else ++static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp) ++#endif + { + struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; + +@@ -1082,7 +1098,11 @@ static int rfcomm_tty_tiocmget(struct tt + return dev->modem_status; + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) + static int rfcomm_tty_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) ++#else ++static int rfcomm_tty_tiocmset(struct tty_struct *tty, struct file *filp, unsigned int set, unsigned int clear) ++#endif + { + struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; + struct rfcomm_dlc *dlc = dev->dlc; +--- a/net/bluetooth/sco.c ++++ b/net/bluetooth/sco.c +@@ -433,8 +433,12 @@ static struct sock *sco_sock_alloc(struc + return sk; + } + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int sco_sock_create(struct net *net, struct socket *sock, int protocol, + int kern) ++#else ++static int sco_sock_create(struct net *net, struct socket *sock, int protocol) ++#endif + { + struct sock *sk; + +@@ -685,7 +689,11 @@ static int sco_sock_recvmsg(struct kiocb + return bt_sock_recvmsg(iocb, sock, msg, len, flags); + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) ++#else ++static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) ++#endif + { + struct sock *sk = sock->sk; + int err = 0; +--- a/net/bluetooth/bnep/sock.c ++++ b/net/bluetooth/bnep/sock.c +@@ -186,8 +186,12 @@ static struct proto bnep_proto = { + .obj_size = sizeof(struct bt_sock) + }; + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int bnep_sock_create(struct net *net, struct socket *sock, int protocol, + int kern) ++#else ++static int bnep_sock_create(struct net *net, struct socket *sock, int protocol) ++#endif + { + struct sock *sk; + +--- a/net/bluetooth/cmtp/sock.c ++++ b/net/bluetooth/cmtp/sock.c +@@ -195,8 +195,12 @@ static struct proto cmtp_proto = { + .obj_size = sizeof(struct bt_sock) + }; + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol, + int kern) ++#else ++static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol) ++#endif + { + struct sock *sk; + +--- a/net/bluetooth/hidp/sock.c ++++ b/net/bluetooth/hidp/sock.c +@@ -235,8 +235,12 @@ static struct proto hidp_proto = { + .obj_size = sizeof(struct bt_sock) + }; + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int hidp_sock_create(struct net *net, struct socket *sock, int protocol, + int kern) ++#else ++static int hidp_sock_create(struct net *net, struct socket *sock, int protocol) ++#endif + { + struct sock *sk; + +--- a/net/bluetooth/l2cap_sock.c ++++ b/net/bluetooth/l2cap_sock.c +@@ -573,8 +573,13 @@ static int l2cap_sock_setsockopt_old(str + return err; + } + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) + static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, + char __user *optval, unsigned int optlen) ++#else ++static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ++ char __user *optval, int optlen) ++#endif + { + struct sock *sk = sock->sk; + struct l2cap_chan *chan = l2cap_pi(sk)->chan; +@@ -1225,8 +1230,12 @@ static struct sock *l2cap_sock_alloc(str + return sk; + } + ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) + static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol, + int kern) ++#else ++static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol) ++#endif + { + struct sock *sk; + +@@ -1238,7 +1247,11 @@ static int l2cap_sock_create(struct net + sock->type != SOCK_DGRAM && sock->type != SOCK_RAW) + return -ESOCKTNOSUPPORT; + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) + if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW)) ++#else ++ if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW)) ++#endif + return -EPERM; + + sock->ops = &l2cap_sock_ops; diff --git a/patches/collateral-evolutions/network/17-netdev-queue.patch b/patches/collateral-evolutions/network/17-netdev-queue.patch new file mode 100644 index 000000000000..af10e5a739bd --- /dev/null +++ b/patches/collateral-evolutions/network/17-netdev-queue.patch @@ -0,0 +1,47 @@ +This patch addresses changes made by usage of new symbols +like unregister_netdevice_queue() which are not possible to backport +due to their reliance on internal symbols on net/core/dev.c + +The patch that introduced this on mac80211 was: + + mac80211: Speedup ieee80211_remove_interfaces() + + Speedup ieee80211_remove_interfaces() by factorizing synchronize_rcu() calls + + Signed-off-by: Eric Dumazet + Reviewed-by: Johannes Berg + Signed-off-by: John W. Linville + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1613,6 +1613,7 @@ void ieee80211_sdata_stop(struct ieee802 + * Remove all interfaces, may only be called at hardware unregistration + * time because it doesn't do RCU-safe list removals. + */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) + void ieee80211_remove_interfaces(struct ieee80211_local *local) + { + struct ieee80211_sub_if_data *sdata, *tmp; +@@ -1640,6 +1641,22 @@ void ieee80211_remove_interfaces(struct + kfree(sdata); + } + } ++#else ++void ieee80211_remove_interfaces(struct ieee80211_local *local) ++{ ++ struct ieee80211_sub_if_data *sdata, *tmp; ++ ++ ASSERT_RTNL(); ++ ++ list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { ++ mutex_lock(&local->iflist_mtx); ++ list_del(&sdata->list); ++ mutex_unlock(&local->iflist_mtx); ++ ++ unregister_netdevice(sdata->dev); ++ } ++} ++#endif + + static int netdev_notify(struct notifier_block *nb, + unsigned long state, diff --git a/patches/collateral-evolutions/network/18-rename-usb-net-symbols.patch b/patches/collateral-evolutions/network/18-rename-usb-net-symbols.patch new file mode 100644 index 000000000000..ada786f0b23f --- /dev/null +++ b/patches/collateral-evolutions/network/18-rename-usb-net-symbols.patch @@ -0,0 +1,53 @@ +Rename config names for usbnet to deactivate them also if activated in +the main kernel configuration. This is needed because +usb_autopm_put_interface_async and usb_autopm_get_interface_async are +not backported to kernel 2.6.28 and earlier. +Remove this patch if these symbols are backported. + +--- a/drivers/net/usb/Makefile ++++ b/drivers/net/usb/Makefile +@@ -9,7 +9,7 @@ obj-$(CONFIG_USB_RTL8150) += rtl8150.o + obj-$(CONFIG_USB_HSO) += hso.o + obj-$(CONFIG_USB_NET_AX8817X) += asix.o + asix-y := asix_devices.o asix_common.o ax88172a.o +-obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o ++obj-$(CONFIG_USB_NET_COMPAT_CDCETHER) += cdc_ether.o + obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o + obj-$(CONFIG_USB_NET_DM9601) += dm9601.o + obj-$(CONFIG_USB_NET_SMSC75XX) += smsc75xx.o +@@ -17,11 +17,11 @@ obj-$(CONFIG_USB_NET_SMSC95XX) += smsc95 + obj-$(CONFIG_USB_NET_GL620A) += gl620a.o + obj-$(CONFIG_USB_NET_NET1080) += net1080.o + obj-$(CONFIG_USB_NET_PLUSB) += plusb.o +-obj-$(CONFIG_USB_NET_RNDIS_HOST) += rndis_host.o ++obj-$(CONFIG_USB_NET_COMPAT_RNDIS_HOST) += rndis_host.o + obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o + obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o + obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o +-obj-$(CONFIG_USB_USBNET) += usbnet.o ++obj-$(CONFIG_USB_COMPAT_USBNET) += usbnet.o + obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o + obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o + obj-$(CONFIG_USB_NET_KALMIA) += kalmia.o +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -33,7 +33,7 @@ + #include + + +-#if defined(CONFIG_USB_NET_RNDIS_HOST) || defined(CONFIG_USB_NET_RNDIS_HOST_MODULE) ++#if defined(CONFIG_USB_NET_COMPAT_RNDIS_HOST) || defined(CONFIG_USB_NET_COMPAT_RNDIS_HOST_MODULE) + + static int is_rndis(struct usb_interface_descriptor *desc) + { +--- a/drivers/net/wireless/Makefile ++++ b/drivers/net/wireless/Makefile +@@ -30,7 +30,7 @@ obj-$(CONFIG_RTLWIFI) += rtlwifi/ + obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o + obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o + +-obj-$(CONFIG_USB_NET_RNDIS_WLAN) += rndis_wlan.o ++obj-$(CONFIG_USB_NET_COMPAT_RNDIS_WLAN) += rndis_wlan.o + + obj-$(CONFIG_USB_ZD1201) += zd1201.o + obj-$(CONFIG_LIBERTAS) += libertas/ diff --git a/patches/collateral-evolutions/network/21-capi-proc_fops.patch b/patches/collateral-evolutions/network/21-capi-proc_fops.patch new file mode 100644 index 000000000000..7dc92f401c98 --- /dev/null +++ b/patches/collateral-evolutions/network/21-capi-proc_fops.patch @@ -0,0 +1,73 @@ +Backport kernel patch 9a58a80a701bdb2d220cdab4914218df5b48d781 +proc_fops: convert drivers/isdn/ to seq_file + +--- a/net/bluetooth/cmtp/capi.c ++++ b/net/bluetooth/cmtp/capi.c +@@ -21,8 +21,10 @@ + */ + + #include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + #include + #include ++#endif + #include + #include + #include +@@ -522,6 +524,7 @@ static char *cmtp_procinfo(struct capi_c + return "CAPI Message Transport Protocol"; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + static int cmtp_proc_show(struct seq_file *m, void *v) + { + struct capi_ctr *ctrl = m->private; +@@ -554,6 +557,36 @@ static const struct file_operations cmtp + .release = single_release, + }; + ++#else ++ ++static int cmtp_ctr_read_proc(char *page, char **start, off_t off, int count, int *eof, struct capi_ctr *ctrl) ++{ ++ struct cmtp_session *session = ctrl->driverdata; ++ struct cmtp_application *app; ++ struct list_head *p, *n; ++ int len = 0; ++ ++ len += sprintf(page + len, "%s\n\n", cmtp_procinfo(ctrl)); ++ len += sprintf(page + len, "addr %s\n", session->name); ++ len += sprintf(page + len, "ctrl %d\n", session->num); ++ ++ list_for_each_safe(p, n, &session->applications) { ++ app = list_entry(p, struct cmtp_application, list); ++ len += sprintf(page + len, "appl %d -> %d\n", app->appl, app->mapping); ++ } ++ ++ if (off + count >= len) ++ *eof = 1; ++ ++ if (len < off) ++ return 0; ++ ++ *start = page + off; ++ ++ return ((count < len - off) ? count : len - off); ++} ++#endif ++ + int cmtp_attach_device(struct cmtp_session *session) + { + unsigned char buf[4]; +@@ -592,7 +625,11 @@ int cmtp_attach_device(struct cmtp_sessi + session->ctrl.send_message = cmtp_send_message; + + session->ctrl.procinfo = cmtp_procinfo; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + session->ctrl.proc_fops = &cmtp_proc_fops; ++#else ++ session->ctrl.ctr_read_proc = cmtp_ctr_read_proc; ++#endif + + if (attach_capi_ctr(&session->ctrl) < 0) { + BT_ERR("Can't attach new controller"); diff --git a/patches/collateral-evolutions/network/22-multiqueue.patch b/patches/collateral-evolutions/network/22-multiqueue.patch new file mode 100644 index 000000000000..34c297815ffd --- /dev/null +++ b/patches/collateral-evolutions/network/22-multiqueue.patch @@ -0,0 +1,43 @@ +Backport multiqueue support for kernels 2.6.23-27 + +The 2.6.23 kernel added some initial multiqueue support. +That release relied on the on the notion of struct +net_device_subqueue attached to the netdevice struct +as an array. The 2.6.27 renamed these to struct netdev_queue, +and enhanced MQ support by providing locks separately onto +each queue. MQ support on 2.6.27 also extended each netdev +to be able to assign a select_queue callback to be used by +core networking for prior to pushing the skb out to the device +driver so that queue selection can be dealt with and +customized internally on the driver. + +For kernels 2.6.23..2.6.26 then we backport MQ support by +using the equivalent calls on the struct netdev_queue to +the struct net_device_subqueue. The performance penalty +here is just that all these queues share a common lock +so stateful operations on one queue would imply a delay +on other queues. + +The select_queue callback was only added as of 2.6.27 via +commit eae792b7 so for kernels 2.6.23 up to 2.6.27 we must +ensure we do the selection of the queue once the core +networking calls mac80211's dev_hard_start_xmit() +(ndo_start_xmit() callback on newer kernels). + +This patch thus only addresses the lack of select_queue on +kernels older than 2.6.27, naming differences are handled +in compat. + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -1480,6 +1480,10 @@ void ieee80211_xmit(struct ieee80211_sub + return; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) ++ /* Older kernels do not have the select_queue callback */ ++ skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb)); ++#endif + ieee80211_set_qos_hdr(sdata, skb); + ieee80211_tx(sdata, skb, false, band); + } diff --git a/patches/collateral-evolutions/network/24-pcmcia.patch b/patches/collateral-evolutions/network/24-pcmcia.patch new file mode 100644 index 000000000000..634c44764d22 --- /dev/null +++ b/patches/collateral-evolutions/network/24-pcmcia.patch @@ -0,0 +1,1414 @@ +--- a/drivers/bluetooth/bluecard_cs.c ++++ b/drivers/bluetooth/bluecard_cs.c +@@ -158,7 +158,12 @@ static void bluecard_detach(struct pcmci + static void bluecard_activity_led_timeout(u_long arg) + { + bluecard_info_t *info = (bluecard_info_t *)arg; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif ++ + + if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) + return; +@@ -175,7 +180,11 @@ static void bluecard_activity_led_timeou + + static void bluecard_enable_activity_led(bluecard_info_t *info) + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + + if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) + return; +@@ -231,7 +240,11 @@ static void bluecard_write_wakeup(blueca + } + + do { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + unsigned int offset; + unsigned char command; + unsigned long ready_bit; +@@ -378,7 +391,11 @@ static void bluecard_receive(bluecard_in + return; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + if (test_bit(XMIT_SENDING_READY, &(info->tx_state))) + bluecard_enable_activity_led(info); +@@ -507,7 +524,11 @@ static irqreturn_t bluecard_interrupt(in + if (!test_bit(CARD_READY, &(info->hw_state))) + return IRQ_HANDLED; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + spin_lock(&(info->lock)); + +@@ -629,7 +650,11 @@ static int bluecard_hci_open(struct hci_ + return 0; + + if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + + /* Enable LED */ + outb(0x08 | 0x20, iobase + 0x30); +@@ -649,7 +674,11 @@ static int bluecard_hci_close(struct hci + bluecard_hci_flush(hdev); + + if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + + /* Disable LED */ + outb(0x00, iobase + 0x30); +@@ -705,7 +734,11 @@ static int bluecard_hci_ioctl(struct hci + + static int bluecard_open(bluecard_info_t *info) + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + struct hci_dev *hdev; + unsigned char id; + +@@ -821,7 +854,11 @@ static int bluecard_open(bluecard_info_t + + static int bluecard_close(bluecard_info_t *info) + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + struct hci_dev *hdev = info->hdev; + + if (!hdev) +@@ -856,7 +893,18 @@ static int bluecard_probe(struct pcmcia_ + info->p_dev = link; + link->priv = info; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; ++ ++ link->irq.Handler = bluecard_interrupt; ++#endif ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + link->config_flags |= CONF_ENABLE_IRQ; ++#else ++ link->conf.Attributes = CONF_ENABLE_IRQ; ++ link->conf.IntType = INT_MEMORY_AND_IO; ++#endif + + return bluecard_config(link); + } +@@ -873,15 +921,30 @@ static int bluecard_config(struct pcmcia + bluecard_info_t *info = link->priv; + int i, n; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + link->config_index = 0x20; ++#else ++ link->conf.ConfigIndex = 0x20; ++#endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; + link->resource[0]->end = 64; + link->io_lines = 6; ++#else ++ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ++ link->io.NumPorts1 = 64; ++ link->io.IOAddrLines = 6; ++#endif + + for (n = 0; n < 0x400; n += 0x40) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + link->resource[0]->start = n ^ 0x300; + i = pcmcia_request_io(link); ++#else ++ link->io.BasePort1 = n ^ 0x300; ++ i = pcmcia_request_io(link, &link->io); ++#endif + if (i == 0) + break; + } +@@ -889,9 +952,15 @@ static int bluecard_config(struct pcmcia + if (i != 0) + goto failed; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + i = pcmcia_request_irq(link, bluecard_interrupt); + if (i != 0) + goto failed; ++#else ++ i = pcmcia_request_irq(link, &link->irq); ++ if (i != 0) ++ link->irq.AssignedIRQ = 0; ++#endif + + i = pcmcia_enable_device(link); + if (i != 0) +@@ -929,7 +998,13 @@ MODULE_DEVICE_TABLE(pcmcia, bluecard_ids + + static struct pcmcia_driver bluecard_driver = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + .name = "bluecard_cs", ++#else ++ .drv = { ++ .name = "bluecard_cs", ++ }, ++#endif + .probe = bluecard_probe, + .remove = bluecard_detach, + .id_table = bluecard_ids, +--- a/drivers/bluetooth/bt3c_cs.c ++++ b/drivers/bluetooth/bt3c_cs.c +@@ -186,7 +186,11 @@ static void bt3c_write_wakeup(bt3c_info_ + return; + + do { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + register struct sk_buff *skb; + int len; + +@@ -224,7 +228,11 @@ static void bt3c_receive(bt3c_info_t *in + return; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + avail = bt3c_read(iobase, 0x7006); + //printk("bt3c_cs: receiving %d bytes\n", avail); +@@ -345,7 +353,11 @@ static irqreturn_t bt3c_interrupt(int ir + /* our irq handler is shared */ + return IRQ_NONE; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + spin_lock(&(info->lock)); + +@@ -473,7 +485,11 @@ static int bt3c_load_firmware(bt3c_info_ + unsigned int iobase, size, addr, fcs, tmp; + int i, err = 0; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + /* Reset */ + bt3c_io_write(iobase, 0x8040, 0x0404); +@@ -645,8 +661,27 @@ static int bt3c_probe(struct pcmcia_devi + info->p_dev = link; + link->priv = info; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | + CONF_AUTO_SET_IO; ++#else ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; ++ link->resource[0]->end = 8; ++#else ++ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ++ link->io.NumPorts1= 8; ++#endif ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; ++ ++ link->irq.Handler = bt3c_interrupt; ++#endif ++ ++ link->conf.Attributes = CONF_ENABLE_IRQ; ++ link->conf.IntType = INT_MEMORY_AND_IO; ++#endif + + return bt3c_config(link); + } +@@ -657,6 +692,7 @@ static void bt3c_detach(struct pcmcia_de + bt3c_release(link); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data) + { + int *try = priv_data; +@@ -695,6 +731,63 @@ static int bt3c_check_config_notpicky(st + } + return -ENODEV; + } ++#else ++static int bt3c_check_config(struct pcmcia_device *p_dev, ++ cistpl_cftable_entry_t *cf, ++ cistpl_cftable_entry_t *dflt, ++ unsigned int vcc, ++ void *priv_data) ++{ ++ unsigned long try = (unsigned long) priv_data; ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; ++#endif ++ ++ if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) ++ p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; ++ if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && ++ (cf->io.win[0].base != 0)) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ p_dev->resource[0]->start = cf->io.win[0].base; ++ if (!pcmcia_request_io(p_dev)) ++#else ++ p_dev->io.BasePort1 = cf->io.win[0].base; ++ p_dev->io.IOAddrLines = (try == 0) ? 16 : ++ cf->io.flags & CISTPL_IO_LINES_MASK; ++ if (!pcmcia_request_io(p_dev, &p_dev->io)) ++#endif ++ return 0; ++ } ++ return -ENODEV; ++} ++ ++static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev, ++ cistpl_cftable_entry_t *cf, ++ cistpl_cftable_entry_t *dflt, ++ unsigned int vcc, ++ void *priv_data) ++{ ++ static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; ++ int j; ++ ++ if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { ++ for (j = 0; j < 5; j++) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ p_dev->resource[0]->start = base[j]; ++ p_dev->io_lines = base[j] ? 16 : 3; ++ if (!pcmcia_request_io(p_dev)) ++#else ++ p_dev->io.BasePort1 = base[j]; ++ p_dev->io.IOAddrLines = base[j] ? 16 : 3; ++ if (!pcmcia_request_io(p_dev, &p_dev->io)) ++#endif ++ return 0; ++ } ++ } ++ return -ENODEV; ++} ++#endif + + static int bt3c_config(struct pcmcia_device *link) + { +@@ -718,9 +811,15 @@ static int bt3c_config(struct pcmcia_dev + goto failed; + + found_port: ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + i = pcmcia_request_irq(link, &bt3c_interrupt); + if (i != 0) + goto failed; ++#else ++ i = pcmcia_request_irq(link, &link->irq); ++ if (i != 0) ++ link->irq.AssignedIRQ = 0; ++#endif + + i = pcmcia_enable_device(link); + if (i != 0) +@@ -755,7 +854,13 @@ MODULE_DEVICE_TABLE(pcmcia, bt3c_ids); + + static struct pcmcia_driver bt3c_driver = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + .name = "bt3c_cs", ++#else ++ .drv = { ++ .name = "bt3c_cs", ++ }, ++#endif + .probe = bt3c_probe, + .remove = bt3c_detach, + .id_table = bt3c_ids, +--- a/drivers/bluetooth/btuart_cs.c ++++ b/drivers/bluetooth/btuart_cs.c +@@ -140,7 +140,11 @@ static void btuart_write_wakeup(btuart_i + } + + do { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + register struct sk_buff *skb; + int len; + +@@ -181,7 +185,11 @@ static void btuart_receive(btuart_info_t + return; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + do { + info->hdev->stat.byte_rx++; +@@ -295,7 +303,11 @@ static irqreturn_t btuart_interrupt(int + /* our irq handler is shared */ + return IRQ_NONE; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + spin_lock(&(info->lock)); + +@@ -352,7 +364,11 @@ static void btuart_change_speed(btuart_i + return; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + spin_lock_irqsave(&(info->lock), flags); + +@@ -471,7 +487,11 @@ static int btuart_hci_ioctl(struct hci_d + static int btuart_open(btuart_info_t *info) + { + unsigned long flags; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + struct hci_dev *hdev; + + spin_lock_init(&(info->lock)); +@@ -538,7 +558,11 @@ static int btuart_open(btuart_info_t *in + static int btuart_close(btuart_info_t *info) + { + unsigned long flags; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + struct hci_dev *hdev = info->hdev; + + if (!hdev) +@@ -574,8 +598,27 @@ static int btuart_probe(struct pcmcia_de + info->p_dev = link; + link->priv = info; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | + CONF_AUTO_SET_IO; ++#else ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; ++ link->resource[0]->end = 8; ++#else ++ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ++ link->io.NumPorts1= 8; ++#endif ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; ++ ++ link->irq.Handler = btuart_interrupt; ++#endif ++ ++ link->conf.Attributes = CONF_ENABLE_IRQ; ++ link->conf.IntType = INT_MEMORY_AND_IO; ++#endif + + return btuart_config(link); + } +@@ -586,6 +629,7 @@ static void btuart_detach(struct pcmcia_ + btuart_release(link); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data) + { + int *try = priv_data; +@@ -624,6 +668,63 @@ static int btuart_check_config_notpicky( + } + return -ENODEV; + } ++#else ++static int btuart_check_config(struct pcmcia_device *p_dev, ++ cistpl_cftable_entry_t *cf, ++ cistpl_cftable_entry_t *dflt, ++ unsigned int vcc, ++ void *priv_data) ++{ ++ int *try = priv_data; ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; ++#endif ++ ++ if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) ++ p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; ++ if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && ++ (cf->io.win[0].base != 0)) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ p_dev->resource[0]->start = cf->io.win[0].base; ++ if (!pcmcia_request_io(p_dev)) ++#else ++ p_dev->io.BasePort1 = cf->io.win[0].base; ++ p_dev->io.IOAddrLines = (*try == 0) ? 16 : ++ cf->io.flags & CISTPL_IO_LINES_MASK; ++ if (!pcmcia_request_io(p_dev, &p_dev->io)) ++#endif ++ return 0; ++ } ++ return -ENODEV; ++} ++ ++static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, ++ cistpl_cftable_entry_t *cf, ++ cistpl_cftable_entry_t *dflt, ++ unsigned int vcc, ++ void *priv_data) ++{ ++ static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; ++ int j; ++ ++ if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { ++ for (j = 0; j < 5; j++) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ p_dev->resource[0]->start = base[j]; ++ p_dev->io_lines = base[j] ? 16 : 3; ++ if (!pcmcia_request_io(p_dev)) ++#else ++ p_dev->io.BasePort1 = base[j]; ++ p_dev->io.IOAddrLines = base[j] ? 16 : 3; ++ if (!pcmcia_request_io(p_dev, &p_dev->io)) ++#endif ++ return 0; ++ } ++ } ++ return -ENODEV; ++} ++#endif + + static int btuart_config(struct pcmcia_device *link) + { +@@ -647,9 +748,15 @@ static int btuart_config(struct pcmcia_d + goto failed; + + found_port: ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + i = pcmcia_request_irq(link, btuart_interrupt); + if (i != 0) + goto failed; ++#else ++ i = pcmcia_request_irq(link, &link->irq); ++ if (i != 0) ++ link->irq.AssignedIRQ = 0; ++#endif + + i = pcmcia_enable_device(link); + if (i != 0) +@@ -683,7 +790,13 @@ MODULE_DEVICE_TABLE(pcmcia, btuart_ids); + + static struct pcmcia_driver btuart_driver = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + .name = "btuart_cs", ++#else ++ .drv = { ++ .name = "btuart_cs", ++ }, ++#endif + .probe = btuart_probe, + .remove = btuart_detach, + .id_table = btuart_ids, +--- a/drivers/bluetooth/dtl1_cs.c ++++ b/drivers/bluetooth/dtl1_cs.c +@@ -144,7 +144,11 @@ static void dtl1_write_wakeup(dtl1_info_ + } + + do { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + register struct sk_buff *skb; + int len; + +@@ -209,7 +213,11 @@ static void dtl1_receive(dtl1_info_t *in + return; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + do { + info->hdev->stat.byte_rx++; +@@ -296,7 +304,11 @@ static irqreturn_t dtl1_interrupt(int ir + /* our irq handler is shared */ + return IRQ_NONE; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + iobase = info->p_dev->resource[0]->start; ++#else ++ iobase = info->p_dev->io.BasePort1; ++#endif + + spin_lock(&(info->lock)); + +@@ -451,7 +463,11 @@ static int dtl1_hci_ioctl(struct hci_dev + static int dtl1_open(dtl1_info_t *info) + { + unsigned long flags; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + struct hci_dev *hdev; + + spin_lock_init(&(info->lock)); +@@ -495,8 +511,13 @@ static int dtl1_open(dtl1_info_t *info) + outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */ + outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + info->ri_latch = inb(info->p_dev->resource[0]->start + UART_MSR) + & UART_MSR_RI; ++#else ++ info->ri_latch = inb(info->p_dev->io.BasePort1 + UART_MSR) ++ & UART_MSR_RI; ++#endif + + /* Turn on interrupts */ + outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER); +@@ -521,7 +542,11 @@ static int dtl1_open(dtl1_info_t *info) + static int dtl1_close(dtl1_info_t *info) + { + unsigned long flags; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unsigned int iobase = info->p_dev->resource[0]->start; ++#else ++ unsigned int iobase = info->p_dev->io.BasePort1; ++#endif + struct hci_dev *hdev = info->hdev; + + if (!hdev) +@@ -557,7 +582,24 @@ static int dtl1_probe(struct pcmcia_devi + info->p_dev = link; + link->priv = info; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; ++#else ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; ++ link->resource[0]->end = 8; ++#else ++ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ++ link->io.NumPorts1= 8; ++#endif ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; ++ link->irq.Handler = dtl1_interrupt; ++#endif ++ ++ link->conf.Attributes = CONF_ENABLE_IRQ; ++ link->conf.IntType = INT_MEMORY_AND_IO; ++#endif + + return dtl1_config(link); + } +@@ -571,6 +613,7 @@ static void dtl1_detach(struct pcmcia_de + pcmcia_disable_device(link); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) + { + if ((p_dev->resource[1]->end) || (p_dev->resource[1]->end < 8)) +@@ -581,6 +624,29 @@ static int dtl1_confcheck(struct pcmcia_ + + return pcmcia_request_io(p_dev); + } ++#else ++static int dtl1_confcheck(struct pcmcia_device *p_dev, ++ cistpl_cftable_entry_t *cf, ++ cistpl_cftable_entry_t *dflt, ++ unsigned int vcc, ++ void *priv_data) ++{ ++ if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8)) ++ return -ENODEV; ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ p_dev->resource[0]->start = cf->io.win[0].base; ++ p_dev->resource[0]->end = cf->io.win[0].len; /*yo */ ++ p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK; ++ return pcmcia_request_io(p_dev); ++#else ++ p_dev->io.BasePort1 = cf->io.win[0].base; ++ p_dev->io.NumPorts1 = cf->io.win[0].len; /*yo */ ++ p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; ++ return pcmcia_request_io(p_dev, &p_dev->io); ++#endif ++} ++#endif + + static int dtl1_config(struct pcmcia_device *link) + { +@@ -588,14 +654,24 @@ static int dtl1_config(struct pcmcia_dev + int ret; + + /* Look for a generic full-sized window */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + link->resource[0]->end = 8; ++#else ++ link->io.NumPorts1 = 8; ++#endif + ret = pcmcia_loop_config(link, dtl1_confcheck, NULL); + if (ret) + goto failed; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ret = pcmcia_request_irq(link, dtl1_interrupt); + if (ret) + goto failed; ++#else ++ ret = pcmcia_request_irq(link, &link->irq); ++ if (ret != 0) ++ link->irq.AssignedIRQ = 0; ++#endif + + ret = pcmcia_enable_device(link); + if (ret) +@@ -623,7 +699,13 @@ MODULE_DEVICE_TABLE(pcmcia, dtl1_ids); + + static struct pcmcia_driver dtl1_driver = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + .name = "dtl1_cs", ++#else ++ .drv = { ++ .name = "dtl1_cs", ++ }, ++#endif + .probe = dtl1_probe, + .remove = dtl1_detach, + .id_table = dtl1_ids, +--- a/drivers/net/wireless/b43/pcmcia.c ++++ b/drivers/net/wireless/b43/pcmcia.c +@@ -63,6 +63,9 @@ static int b43_pcmcia_resume(struct pcmc + static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) + { + struct ssb_bus *ssb; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) ++ win_req_t win; ++#endif + int err = -ENOMEM; + int res = 0; + +@@ -72,6 +75,7 @@ static int __devinit b43_pcmcia_probe(st + + err = -ENODEV; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + dev->config_flags |= CONF_ENABLE_IRQ; + + dev->resource[2]->flags |= WIN_ENABLE | WIN_DATA_WIDTH_16 | +@@ -79,21 +83,46 @@ static int __devinit b43_pcmcia_probe(st + dev->resource[2]->start = 0; + dev->resource[2]->end = SSB_CORE_SIZE; + res = pcmcia_request_window(dev, dev->resource[2], 250); ++#else ++ dev->conf.Attributes = CONF_ENABLE_IRQ; ++ dev->conf.IntType = INT_MEMORY_AND_IO; ++ ++ win.Attributes = WIN_ENABLE | WIN_DATA_WIDTH_16 | ++ WIN_USE_WAIT; ++ win.Base = 0; ++ win.Size = SSB_CORE_SIZE; ++ win.AccessSpeed = 250; ++ res = pcmcia_request_window(dev, &win, &dev->win); ++#endif + if (res != 0) + goto err_kfree_ssb; +- ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + res = pcmcia_map_mem_page(dev, dev->resource[2], 0); ++#else ++ res = pcmcia_map_mem_page(dev, dev->win, 0); ++#endif + if (res != 0) + goto err_disable; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + if (!dev->irq) ++#else ++ dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; ++ dev->irq.Handler = NULL; /* The handler is registered later. */ ++ res = pcmcia_request_irq(dev, &dev->irq); ++ if (res != 0) ++#endif + goto err_disable; + + res = pcmcia_enable_device(dev); + if (res != 0) + goto err_disable; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + err = ssb_bus_pcmciabus_register(ssb, dev, dev->resource[2]->start); ++#else ++ err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); ++#endif + if (err) + goto err_disable; + dev->priv = ssb; +@@ -122,7 +151,13 @@ static void __devexit b43_pcmcia_remove( + + static struct pcmcia_driver b43_pcmcia_driver = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + .name = "b43-pcmcia", ++#else ++ .drv = { ++ .name = "b43-pcmcia", ++ }, ++#endif + .id_table = b43_pcmcia_tbl, + .probe = b43_pcmcia_probe, + .remove = __devexit_p(b43_pcmcia_remove), +--- a/drivers/net/wireless/libertas/if_cs.c ++++ b/drivers/net/wireless/libertas/if_cs.c +@@ -757,7 +757,11 @@ static void if_cs_prog_firmware(struct l + goto out; + + /* Now actually get the IRQ */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ret = request_irq(card->p_dev->irq, if_cs_interrupt, ++#else ++ ret = request_irq(card->p_dev->irq.AssignedIRQ, if_cs_interrupt, ++#endif + IRQF_SHARED, DRV_NAME, card); + if (ret) { + pr_err("error in request_irq\n"); +@@ -775,7 +779,11 @@ static void if_cs_prog_firmware(struct l + priv->fw_ready = 1; + if (lbs_start_card(priv) != 0) { + pr_err("could not activate card\n"); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + free_irq(card->p_dev->irq, card); ++#else ++ free_irq(card->p_dev->irq.AssignedIRQ, card); ++#endif + } + + out: +@@ -824,7 +832,11 @@ static void if_cs_release(struct pcmcia_ + + lbs_deb_enter(LBS_DEB_CS); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + free_irq(p_dev->irq, card); ++#else ++ free_irq(p_dev->irq.AssignedIRQ, card); ++#endif + pcmcia_disable_device(p_dev); + if (card->iobase) + ioport_unmap(card->iobase); +@@ -832,7 +844,7 @@ static void if_cs_release(struct pcmcia_ + lbs_deb_leave(LBS_DEB_CS); + } + +- ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + static int if_cs_ioprobe(struct pcmcia_device *p_dev, void *priv_data) + { + p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; +@@ -842,9 +854,39 @@ static int if_cs_ioprobe(struct pcmcia_d + pr_err("wrong CIS (check number of IO windows)\n"); + return -ENODEV; + } ++#else ++static int if_cs_ioprobe(struct pcmcia_device *p_dev, ++ cistpl_cftable_entry_t *cfg, ++ cistpl_cftable_entry_t *dflt, ++ unsigned int vcc, ++ void *priv_data) ++{ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; ++ p_dev->resource[0]->start = cfg->io.win[0].base; ++ p_dev->resource[0]->end = cfg->io.win[0].len; ++#else ++ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; ++ p_dev->io.BasePort1 = cfg->io.win[0].base; ++ p_dev->io.NumPorts1 = cfg->io.win[0].len; ++#endif ++ ++ /* Do we need to allocate an interrupt? */ ++ p_dev->conf.Attributes |= CONF_ENABLE_IRQ; ++ ++ /* IO window settings */ ++ if (cfg->io.nwin != 1) { ++ pr_err("wrong CIS (check number of IO windows)\n"); ++ return -ENODEV; ++ } ++#endif + + /* This reserves IO space but doesn't actually enable it */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + return pcmcia_request_io(p_dev); ++#else ++ return pcmcia_request_io(p_dev, &p_dev->io); ++#endif + } + + static int if_cs_probe(struct pcmcia_device *p_dev) +@@ -863,7 +905,16 @@ static int if_cs_probe(struct pcmcia_dev + card->p_dev = p_dev; + p_dev->priv = card; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; ++#else ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; ++ p_dev->irq.Handler = NULL; ++#endif ++ p_dev->conf.Attributes = 0; ++ p_dev->conf.IntType = INT_MEMORY_AND_IO; ++#endif + + if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) { + pr_err("error in pcmcia_loop_config\n"); +@@ -875,12 +926,26 @@ static int if_cs_probe(struct pcmcia_dev + * a handler to the interrupt, unless the 'Handler' member of + * the irq structure is initialized. + */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + if (!p_dev->irq) + goto out1; ++#else ++ if (p_dev->conf.Attributes & CONF_ENABLE_IRQ) { ++ ret = pcmcia_request_irq(p_dev, &p_dev->irq); ++ if (ret) { ++ pr_err("error in pcmcia_request_irq\n"); ++ goto out1; ++ } ++ } ++#endif + + /* Initialize io access */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + card->iobase = ioport_map(p_dev->resource[0]->start, + resource_size(p_dev->resource[0])); ++#else ++ card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1); ++#endif + if (!card->iobase) { + pr_err("error in ioport_map\n"); + ret = -EIO; +@@ -894,7 +959,17 @@ static int if_cs_probe(struct pcmcia_dev + } + + /* Finally, report what we've done */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + lbs_deb_cs("irq %d, io %pR", p_dev->irq, p_dev->resource[0]); ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) ++ lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n", ++ p_dev->irq, p_dev->io.BasePort1, ++ p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); ++#else ++ lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n", ++ p_dev->irq.AssignedIRQ, p_dev->io.BasePort1, ++ p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); ++#endif + + /* + * Most of the libertas cards can do unaligned register access, but some +@@ -1002,7 +1077,13 @@ MODULE_DEVICE_TABLE(pcmcia, if_cs_ids); + + static struct pcmcia_driver lbs_driver = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + .name = DRV_NAME, ++#else ++ .drv = { ++ .name = DRV_NAME, ++ }, ++#endif + .probe = if_cs_probe, + .remove = if_cs_detach, + .id_table = if_cs_ids, +--- a/drivers/net/wireless/orinoco/orinoco_cs.c ++++ b/drivers/net/wireless/orinoco/orinoco_cs.c +@@ -78,7 +78,11 @@ orinoco_cs_hard_reset(struct orinoco_pri + /* We need atomic ops here, because we're not holding the lock */ + set_bit(0, &card->hard_reset_in_progress); + ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27) ++ err = pcmcia_reset_card(link, NULL); ++#else + err = pcmcia_reset_card(link->socket); ++#endif + if (err) + return err; + +@@ -108,6 +112,16 @@ orinoco_cs_probe(struct pcmcia_device *l + card->p_dev = link; + link->priv = priv; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ /* Interrupt setup */ ++ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; ++ link->irq.Handler = orinoco_interrupt; ++#endif ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) ++ link->conf.Attributes = 0; ++ link->conf.IntType = INT_MEMORY_AND_IO; ++#endif ++ + return orinoco_cs_config(link); + } /* orinoco_cs_attach */ + +@@ -122,6 +136,7 @@ static void orinoco_cs_detach(struct pcm + free_orinocodev(priv); + } /* orinoco_cs_detach */ + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + static int orinoco_cs_config_check(struct pcmcia_device *p_dev, void *priv_data) + { + if (p_dev->config_index == 0) +@@ -129,6 +144,98 @@ static int orinoco_cs_config_check(struc + + return pcmcia_request_io(p_dev); + }; ++#else ++static int orinoco_cs_config_check(struct pcmcia_device *p_dev, ++ cistpl_cftable_entry_t *cfg, ++ cistpl_cftable_entry_t *dflt, ++ unsigned int vcc, ++ void *priv_data) ++{ ++ if (cfg->index == 0) ++ goto next_entry; ++ ++ /* Use power settings for Vcc and Vpp if present */ ++ /* Note that the CIS values need to be rescaled */ ++ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { ++ if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { ++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", ++ __func__, vcc, ++ cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); ++ if (!ignore_cis_vcc) ++ goto next_entry; ++ } ++ } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { ++ if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { ++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", ++ __func__, vcc, ++ dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); ++ if (!ignore_cis_vcc) ++ goto next_entry; ++ } ++ } ++ ++ if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) ++ p_dev->conf.Vpp = ++ cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; ++ else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) ++ p_dev->conf.Vpp = ++ dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; ++ ++ /* Do we need to allocate an interrupt? */ ++ p_dev->conf.Attributes |= CONF_ENABLE_IRQ; ++ ++ /* IO window settings */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ++#else ++ p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; ++#endif ++ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { ++ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; ++ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; ++ p_dev->resource[0]->flags |= ++ pcmcia_io_cfg_data_width(io->flags); ++ p_dev->resource[0]->start = io->win[0].base; ++ p_dev->resource[0]->end = io->win[0].len; ++#else ++ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; ++ if (!(io->flags & CISTPL_IO_8BIT)) ++ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; ++ if (!(io->flags & CISTPL_IO_16BIT)) ++ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ++ p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; ++ p_dev->io.BasePort1 = io->win[0].base; ++ p_dev->io.NumPorts1 = io->win[0].len; ++#endif ++ if (io->nwin > 1) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ p_dev->resource[1]->flags = p_dev->resource[0]->flags; ++ p_dev->resource[1]->start = io->win[1].base; ++ p_dev->resource[1]->end = io->win[1].len; ++#else ++ p_dev->io.Attributes2 = p_dev->io.Attributes1; ++ p_dev->io.BasePort2 = io->win[1].base; ++ p_dev->io.NumPorts2 = io->win[1].len; ++#endif ++ } ++ ++ /* This reserves IO space but doesn't actually enable it */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ if (pcmcia_request_io(p_dev) != 0) ++#else ++ if (pcmcia_request_io(p_dev, &p_dev->io) != 0) ++#endif ++ goto next_entry; ++ } ++ return 0; ++ ++next_entry: ++ pcmcia_disable_device(p_dev); ++ return -ENODEV; ++}; ++#endif + + static int + orinoco_cs_config(struct pcmcia_device *link) +@@ -138,10 +245,12 @@ orinoco_cs_config(struct pcmcia_device * + int ret; + void __iomem *mem; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC | + CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; + if (ignore_cis_vcc) + link->config_flags &= ~CONF_AUTO_CHECK_VCC; ++#endif + ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL); + if (ret) { + if (!ignore_cis_vcc) +@@ -151,8 +260,12 @@ orinoco_cs_config(struct pcmcia_device * + goto failed; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) + mem = ioport_map(link->resource[0]->start, + resource_size(link->resource[0])); ++#else ++ mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); ++#endif + if (!mem) + goto failed; + +@@ -161,7 +274,11 @@ orinoco_cs_config(struct pcmcia_device * + * called. */ + hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ret = pcmcia_request_irq(link, orinoco_interrupt); ++#else ++ ret = pcmcia_request_irq(link, &link->irq); ++#endif + if (ret) + goto failed; + +@@ -176,8 +293,16 @@ orinoco_cs_config(struct pcmcia_device * + } + + /* Register an interface with the stack */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + if (orinoco_if_add(priv, link->resource[0]->start, + link->irq, NULL) != 0) { ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) ++ if (orinoco_if_add(priv, link->io.BasePort1, ++ link->irq, NULL) != 0) { ++#else ++ if (orinoco_if_add(priv, link->io.BasePort1, ++ link->irq.AssignedIRQ, NULL) != 0) { ++#endif + printk(KERN_ERR PFX "orinoco_if_add() failed\n"); + goto failed; + } +@@ -331,7 +456,13 @@ MODULE_DEVICE_TABLE(pcmcia, orinoco_cs_i + + static struct pcmcia_driver orinoco_driver = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + .name = DRIVER_NAME, ++#else ++ .drv = { ++ .name = DRIVER_NAME, ++ }, ++#endif + .probe = orinoco_cs_probe, + .remove = orinoco_cs_detach, + .id_table = orinoco_cs_ids, +--- a/drivers/net/wireless/orinoco/spectrum_cs.c ++++ b/drivers/net/wireless/orinoco/spectrum_cs.c +@@ -170,6 +170,16 @@ spectrum_cs_probe(struct pcmcia_device * + card->p_dev = link; + link->priv = priv; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ /* Interrupt setup */ ++ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; ++ link->irq.Handler = orinoco_interrupt; ++#endif ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) ++ link->conf.Attributes = 0; ++ link->conf.IntType = INT_MEMORY_AND_IO; ++#endif ++ + return spectrum_cs_config(link); + } /* spectrum_cs_attach */ + +@@ -184,6 +194,7 @@ static void spectrum_cs_detach(struct pc + free_orinocodev(priv); + } /* spectrum_cs_detach */ + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + static int spectrum_cs_config_check(struct pcmcia_device *p_dev, + void *priv_data) + { +@@ -192,6 +203,98 @@ static int spectrum_cs_config_check(stru + + return pcmcia_request_io(p_dev); + }; ++#else ++static int spectrum_cs_config_check(struct pcmcia_device *p_dev, ++ cistpl_cftable_entry_t *cfg, ++ cistpl_cftable_entry_t *dflt, ++ unsigned int vcc, ++ void *priv_data) ++{ ++ if (cfg->index == 0) ++ goto next_entry; ++ ++ /* Use power settings for Vcc and Vpp if present */ ++ /* Note that the CIS values need to be rescaled */ ++ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { ++ if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { ++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", ++ __func__, vcc, ++ cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); ++ if (!ignore_cis_vcc) ++ goto next_entry; ++ } ++ } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { ++ if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { ++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", ++ __func__, vcc, ++ dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); ++ if (!ignore_cis_vcc) ++ goto next_entry; ++ } ++ } ++ ++ if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) ++ p_dev->conf.Vpp = ++ cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; ++ else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) ++ p_dev->conf.Vpp = ++ dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; ++ ++ /* Do we need to allocate an interrupt? */ ++ p_dev->conf.Attributes |= CONF_ENABLE_IRQ; ++ ++ /* IO window settings */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ++#else ++ p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; ++#endif ++ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { ++ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; ++ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; ++ p_dev->resource[0]->flags |= ++ pcmcia_io_cfg_data_width(io->flags); ++ p_dev->resource[0]->start = io->win[0].base; ++ p_dev->resource[0]->end = io->win[0].len; ++#else ++ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; ++ if (!(io->flags & CISTPL_IO_8BIT)) ++ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; ++ if (!(io->flags & CISTPL_IO_16BIT)) ++ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ++ p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; ++ p_dev->io.BasePort1 = io->win[0].base; ++ p_dev->io.NumPorts1 = io->win[0].len; ++#endif ++ if (io->nwin > 1) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ p_dev->resource[1]->flags = p_dev->resource[0]->flags; ++ p_dev->resource[1]->start = io->win[1].base; ++ p_dev->resource[1]->end = io->win[1].len; ++#else ++ p_dev->io.Attributes2 = p_dev->io.Attributes1; ++ p_dev->io.BasePort2 = io->win[1].base; ++ p_dev->io.NumPorts2 = io->win[1].len; ++#endif ++ } ++ ++ /* This reserves IO space but doesn't actually enable it */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++ if (pcmcia_request_io(p_dev) != 0) ++#else ++ if (pcmcia_request_io(p_dev, &p_dev->io) != 0) ++#endif ++ goto next_entry; ++ } ++ return 0; ++ ++next_entry: ++ pcmcia_disable_device(p_dev); ++ return -ENODEV; ++}; ++#endif + + static int + spectrum_cs_config(struct pcmcia_device *link) +@@ -201,10 +304,12 @@ spectrum_cs_config(struct pcmcia_device + int ret; + void __iomem *mem; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC | + CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; + if (ignore_cis_vcc) + link->config_flags &= ~CONF_AUTO_CHECK_VCC; ++#endif + ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL); + if (ret) { + if (!ignore_cis_vcc) +@@ -214,8 +319,12 @@ spectrum_cs_config(struct pcmcia_device + goto failed; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) + mem = ioport_map(link->resource[0]->start, + resource_size(link->resource[0])); ++#else ++ mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); ++#endif + if (!mem) + goto failed; + +@@ -225,7 +334,11 @@ spectrum_cs_config(struct pcmcia_device + hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); + hw->eeprom_pda = true; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ret = pcmcia_request_irq(link, orinoco_interrupt); ++#else ++ ret = pcmcia_request_irq(link, &link->irq); ++#endif + if (ret) + goto failed; + +@@ -244,8 +357,16 @@ spectrum_cs_config(struct pcmcia_device + } + + /* Register an interface with the stack */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + if (orinoco_if_add(priv, link->resource[0]->start, + link->irq, NULL) != 0) { ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) ++ if (orinoco_if_add(priv, link->io.BasePort1, ++ link->irq, NULL) != 0) { ++#else ++ if (orinoco_if_add(priv, link->io.BasePort1, ++ link->irq.AssignedIRQ, NULL) != 0) { ++#endif + printk(KERN_ERR PFX "orinoco_if_add() failed\n"); + goto failed; + } +@@ -311,7 +432,13 @@ MODULE_DEVICE_TABLE(pcmcia, spectrum_cs_ + + static struct pcmcia_driver orinoco_driver = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + .name = DRIVER_NAME, ++#else ++ .drv = { ++ .name = DRIVER_NAME, ++ }, ++#endif + .probe = spectrum_cs_probe, + .remove = spectrum_cs_detach, + .suspend = spectrum_cs_suspend, +--- a/drivers/ssb/main.c ++++ b/drivers/ssb/main.c +@@ -504,7 +504,11 @@ static int ssb_devices_register(struct s + break; + case SSB_BUSTYPE_PCMCIA: + #ifdef CONFIG_SSB_PCMCIAHOST ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + sdev->irq = bus->host_pcmcia->irq; ++#else ++ sdev->irq = bus->host_pcmcia->irq.AssignedIRQ; ++#endif + dev->parent = &bus->host_pcmcia->dev; + #endif + break; diff --git a/patches/collateral-evolutions/network/25-multicast-list_head.patch b/patches/collateral-evolutions/network/25-multicast-list_head.patch new file mode 100644 index 000000000000..3efa9e2c1525 --- /dev/null +++ b/patches/collateral-evolutions/network/25-multicast-list_head.patch @@ -0,0 +1,820 @@ +Backport commit 22bedad3ce112d5ca1eaf043d4990fa2ed698c87: + net: convert multicast list to list_head + + Converts the list and the core manipulating with it to be the same as uc_list. + + +uses two functions for adding/removing mc address (normal and "global" + variant) instead of a function parameter. + +removes dev_mcast.c completely. + +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for + manipulation with lists on a sandbox (used in bonding and 80211 drivers) + +This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856 + +--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c ++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +@@ -410,7 +410,11 @@ static void atl1c_set_multi(struct net_d + + /* comoute mc addresses' hash value ,and put it into hash table */ + netdev_for_each_mc_addr(ha, netdev) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + hash_value = atl1c_hash_mc_addr(hw, ha->addr); ++#else ++ hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr); ++#endif + atl1c_hash_set(hw, hash_value); + } + } +--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c ++++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c +@@ -308,7 +308,11 @@ static void atl1e_set_multi(struct net_d + + /* comoute mc addresses' hash value ,and put it into hash table */ + netdev_for_each_mc_addr(ha, netdev) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + hash_value = atl1e_hash_mc_addr(hw, ha->addr); ++#else ++ hash_value = atl1e_hash_mc_addr(hw, ha->dmi_addr); ++#endif + atl1e_hash_set(hw, hash_value); + } + } +--- a/drivers/net/ethernet/atheros/atlx/atl2.c ++++ b/drivers/net/ethernet/atheros/atlx/atl2.c +@@ -159,7 +159,11 @@ static void atl2_set_multi(struct net_de + + /* comoute mc addresses' hash value ,and put it into hash table */ + netdev_for_each_mc_addr(ha, netdev) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + hash_value = atl2_hash_mc_addr(hw, ha->addr); ++#else ++ hash_value = atl2_hash_mc_addr(hw, ha->dmi_addr); ++#endif + atl2_hash_set(hw, hash_value); + } + } +--- a/drivers/net/ethernet/atheros/atlx/atlx.c ++++ b/drivers/net/ethernet/atheros/atlx/atlx.c +@@ -150,7 +150,11 @@ static void atlx_set_multi(struct net_de + + /* compute mc addresses' hash value ,and put it into hash table */ + netdev_for_each_mc_addr(ha, netdev) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + hash_value = atlx_hash_mc_addr(hw, ha->addr); ++#else ++ hash_value = atlx_hash_mc_addr(hw, ha->dmi_addr); ++#endif + atlx_hash_set(hw, hash_value); + } + } +--- a/drivers/net/ethernet/broadcom/b44.c ++++ b/drivers/net/ethernet/broadcom/b44.c +@@ -1696,7 +1696,11 @@ static int __b44_load_mcast(struct b44 * + netdev_for_each_mc_addr(ha, dev) { + if (i == num_ents) + break; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + __b44_cam_write(bp, ha->addr, i++ + 1); ++#else ++ __b44_cam_write(bp, ha->dmi_addr, i++ + 1); ++#endif + } + return i+1; + } +--- a/drivers/net/wireless/adm8211.c ++++ b/drivers/net/wireless/adm8211.c +@@ -1320,19 +1320,37 @@ static void adm8211_bss_info_changed(str + } + + static u64 adm8211_prepare_multicast(struct ieee80211_hw *hw, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list) ++#else ++ int mc_count, struct dev_addr_list *ha) ++#endif + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + unsigned int bit_nr; +- u32 mc_filter[2]; + struct netdev_hw_addr *ha; ++#else ++ unsigned int bit_nr, i; ++#endif ++ u32 mc_filter[2]; + + mc_filter[1] = mc_filter[0] = 0; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + netdev_hw_addr_list_for_each(ha, mc_list) { + bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26; ++#else ++ for (i = 0; i < mc_count; i++) { ++ if (!ha) ++ break; ++ bit_nr = ether_crc(ETH_ALEN, ha->dmi_addr) >> 26; ++#endif + + bit_nr &= 0x3F; + mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ ha = ha->next; ++#endif + } + + return mc_filter[0] | ((u64)(mc_filter[1]) << 32); +--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c ++++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c +@@ -318,20 +318,42 @@ ath5k_bss_info_changed(struct ieee80211_ + + static u64 + ath5k_prepare_multicast(struct ieee80211_hw *hw, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list) ++#else ++ int mc_count, struct dev_addr_list *ha) ++#endif + { + u32 mfilt[2], val; + u8 pos; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr *ha; ++#else ++ int i; ++#endif + + mfilt[0] = 0; + mfilt[1] = 1; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + netdev_hw_addr_list_for_each(ha, mc_list) { ++#else ++ for (i = 0; i < mc_count; i++) { ++ if (!ha) ++ break; ++#endif + /* calculate XOR of eight 6-bit values */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + val = get_unaligned_le32(ha->addr + 0); ++#else ++ val = get_unaligned_le32(ha->dmi_addr + 0); ++#endif + pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + val = get_unaligned_le32(ha->addr + 3); ++#else ++ val = get_unaligned_le32(ha->dmi_addr + 3); ++#endif + pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; + pos &= 0x3f; + mfilt[pos / 32] |= (1 << (pos % 32)); +@@ -340,6 +362,9 @@ ath5k_prepare_multicast(struct ieee80211 + * need to inform below not to reset the mcast */ + /* ath5k_hw_set_mcast_filterindex(ah, + * ha->addr[5]); */ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ ha = ha->next; ++#endif + } + + return ((u64)(mfilt[1]) << 32) | mfilt[0]; +--- a/drivers/net/wireless/ath/carl9170/main.c ++++ b/drivers/net/wireless/ath/carl9170/main.c +@@ -898,17 +898,35 @@ out: + return err; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw, + struct netdev_hw_addr_list *mc_list) ++#else ++static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count, ++ struct dev_addr_list *ha) ++#endif + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr *ha; ++#else ++ int i; ++#endif + u64 mchash; + + /* always get broadcast frames */ + mchash = 1ULL << (0xff >> 2); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + netdev_hw_addr_list_for_each(ha, mc_list) + mchash |= 1ULL << (ha->addr[5] >> 2); ++#else ++ for (i = 0; i < mc_count; i++) { ++ if (WARN_ON(!ha)) ++ break; ++ mchash |= 1ULL << (ha->dmi_addr[5] >> 2); ++ ha = ha->next; ++ } ++#endif + + return mchash; + } +--- a/drivers/net/wireless/libertas/main.c ++++ b/drivers/net/wireless/libertas/main.c +@@ -349,18 +349,34 @@ static int lbs_add_mcast_addrs(struct cm + netif_addr_lock_bh(dev); + cnt = netdev_mc_count(dev); + netdev_for_each_mc_addr(ha, dev) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + if (mac_in_list(cmd->maclist, nr_addrs, ha->addr)) { ++#else ++ if (mac_in_list(cmd->maclist, nr_addrs, ha->dmi_addr)) { ++#endif + lbs_deb_net("mcast address %s:%pM skipped\n", dev->name, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ha->addr); ++#else ++ ha->dmi_addr); ++#endif + cnt--; + continue; + } + + if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE) + break; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + memcpy(&cmd->maclist[6*i], ha->addr, ETH_ALEN); ++#else ++ memcpy(&cmd->maclist[6*i], ha->dmi_addr, ETH_ALEN); ++#endif + lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ha->addr); ++#else ++ ha->dmi_addr); ++#endif + i++; + cnt--; + } +--- a/drivers/net/wireless/libertas_tf/main.c ++++ b/drivers/net/wireless/libertas_tf/main.c +@@ -421,20 +421,36 @@ static int lbtf_op_config(struct ieee802 + } + + static u64 lbtf_op_prepare_multicast(struct ieee80211_hw *hw, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list) ++#else ++ int mc_count, struct dev_addr_list *ha) ++#endif + { + struct lbtf_private *priv = hw->priv; + int i; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr *ha; + int mc_count = netdev_hw_addr_list_count(mc_list); ++#endif + + if (!mc_count || mc_count > MRVDRV_MAX_MULTICAST_LIST_SIZE) + return mc_count; + + priv->nr_of_multicastmacaddr = mc_count; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + i = 0; + netdev_hw_addr_list_for_each(ha, mc_list) + memcpy(&priv->multicastlist[i++], ha->addr, ETH_ALEN); ++#else ++ for (i = 0; i < mc_count; i++) { ++ if (!ha) ++ break; ++ memcpy(&priv->multicastlist[i], ha->da_addr, ++ ETH_ALEN); ++ ha = ha->next; ++ } ++#endif + + return mc_count; + } +--- a/drivers/net/wireless/mwifiex/sta_ioctl.c ++++ b/drivers/net/wireless/mwifiex/sta_ioctl.c +@@ -43,7 +43,11 @@ int mwifiex_copy_mcast_addr(struct mwifi + struct netdev_hw_addr *ha; + + netdev_for_each_mc_addr(ha, dev) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + memcpy(&mlist->mac_list[i++], ha->addr, ETH_ALEN); ++#else ++ memcpy(&mlist->mac_list[i++], ha->dmi_addr, ETH_ALEN); ++#endif + + return i; + } +--- a/drivers/net/wireless/mwifiex/debugfs.c ++++ b/drivers/net/wireless/mwifiex/debugfs.c +@@ -217,7 +217,11 @@ mwifiex_info_read(struct file *file, cha + + netdev_for_each_mc_addr(ha, netdev) + p += sprintf(p, "multicast_address[%d]=\"%pM\"\n", ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + i++, ha->addr); ++#else ++ i++, ha->dmi_addr); ++#endif + } + + p += sprintf(p, "num_tx_bytes = %lu\n", priv->stats.tx_bytes); +--- a/drivers/net/wireless/mwl8k.c ++++ b/drivers/net/wireless/mwl8k.c +@@ -2574,15 +2574,21 @@ struct mwl8k_cmd_mac_multicast_adr { + + static struct mwl8k_cmd_pkt * + __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list) ++#else ++ int mc_count, struct dev_addr_list *ha) ++#endif + { + struct mwl8k_priv *priv = hw->priv; + struct mwl8k_cmd_mac_multicast_adr *cmd; + int size; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + int mc_count = 0; + + if (mc_list) + mc_count = netdev_hw_addr_list_count(mc_list); ++#endif + + if (allmulti || mc_count > priv->num_mcaddrs) { + allmulti = 1; +@@ -2603,13 +2609,27 @@ __mwl8k_cmd_mac_multicast_adr(struct iee + if (allmulti) { + cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_ALL_MULTICAST); + } else if (mc_count) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr *ha; + int i = 0; ++#else ++ int i; ++#endif + + cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST); + cmd->numaddr = cpu_to_le16(mc_count); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + netdev_hw_addr_list_for_each(ha, mc_list) { + memcpy(cmd->addr[i], ha->addr, ETH_ALEN); ++#else ++ for (i = 0; i < mc_count && ha; i++) { ++ if (ha->da_addrlen != ETH_ALEN) { ++ kfree(cmd); ++ return NULL; ++ } ++ memcpy(cmd->addr[i], ha->da_addr, ETH_ALEN); ++ ha = ha->next; ++#endif + } + } + +@@ -4836,7 +4856,11 @@ mwl8k_bss_info_changed(struct ieee80211_ + } + + static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list) ++#else ++ int mc_count, struct dev_addr_list *ha) ++#endif + { + struct mwl8k_cmd_pkt *cmd; + +@@ -4847,7 +4871,11 @@ static u64 mwl8k_prepare_multicast(struc + * we'll end up throwing this packet away and creating a new + * one in mwl8k_configure_filter(). + */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_list); ++#else ++ cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_count, ha); ++#endif + + return (unsigned long)cmd; + } +@@ -4969,7 +4997,11 @@ static void mwl8k_configure_filter(struc + */ + if (*total_flags & FIF_ALLMULTI) { + kfree(cmd); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, NULL); ++#else ++ cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, 0, NULL); ++#endif + } + + if (cmd != NULL) { +--- a/drivers/net/wireless/orinoco/hw.c ++++ b/drivers/net/wireless/orinoco/hw.c +@@ -1093,7 +1093,11 @@ int __orinoco_hw_set_multicast_list(stru + netdev_for_each_mc_addr(ha, dev) { + if (i == mc_count) + break; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + memcpy(mclist.addr[i++], ha->addr, ETH_ALEN); ++#else ++ memcpy(mclist.addr[i++], ha->dmi_addr, ETH_ALEN); ++#endif + } + + err = hw->ops->write_ltv(hw, USER_BAP, +--- a/drivers/net/wireless/orinoco/hw.h ++++ b/drivers/net/wireless/orinoco/hw.h +@@ -22,6 +22,9 @@ + + /* Forward declarations */ + struct orinoco_private; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++struct dev_addr_list; ++#endif + + int determine_fw_capabilities(struct orinoco_private *priv, char *fw_name, + size_t fw_name_len, u32 *hw_ver); +--- a/drivers/net/wireless/p54/main.c ++++ b/drivers/net/wireless/p54/main.c +@@ -364,11 +364,18 @@ out: + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + static u64 p54_prepare_multicast(struct ieee80211_hw *dev, + struct netdev_hw_addr_list *mc_list) ++#else ++static u64 p54_prepare_multicast(struct ieee80211_hw *dev, int mc_count, ++ struct dev_addr_list *ha) ++#endif + { + struct p54_common *priv = dev->priv; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr *ha; ++#endif + int i; + + BUILD_BUG_ON(ARRAY_SIZE(priv->mc_maclist) != +@@ -378,12 +385,23 @@ static u64 p54_prepare_multicast(struct + * Otherwise the firmware will drop it and ARP will no longer work. + */ + i = 1; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + priv->mc_maclist_num = netdev_hw_addr_list_count(mc_list) + i; + netdev_hw_addr_list_for_each(ha, mc_list) { + memcpy(&priv->mc_maclist[i], ha->addr, ETH_ALEN); ++#else ++ priv->mc_maclist_num = mc_count + i; ++ while (i <= mc_count) { ++ if (!ha) ++ break; ++ memcpy(&priv->mc_maclist[i], ha->dmi_addr, ETH_ALEN); ++#endif + i++; + if (i >= ARRAY_SIZE(priv->mc_maclist)) + break; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ ha = ha->next; ++#endif + } + + return 1; /* update */ +--- a/drivers/net/wireless/rndis_wlan.c ++++ b/drivers/net/wireless/rndis_wlan.c +@@ -1632,7 +1632,11 @@ static void set_multicast_list(struct us + + netdev_for_each_mc_addr(ha, usbdev->net) + memcpy(mc_addrs + i++ * ETH_ALEN, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ha->addr, ETH_ALEN); ++#else ++ ha->dmi_addr, ETH_ALEN); ++#endif + } + netif_addr_unlock_bh(usbdev->net); + +--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c ++++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c +@@ -818,10 +818,19 @@ static void rtl8180_bss_info_changed(str + } + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, + struct netdev_hw_addr_list *mc_list) ++#else ++static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, int mc_count, ++ struct dev_addr_list *mc_list) ++#endif + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + return netdev_hw_addr_list_count(mc_list); ++#else ++ return mc_count; ++#endif + } + + static void rtl8180_configure_filter(struct ieee80211_hw *dev, +--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c ++++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c +@@ -1290,9 +1290,17 @@ static void rtl8187_bss_info_changed(str + } + + static u64 rtl8187_prepare_multicast(struct ieee80211_hw *dev, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list) ++#else ++ int mc_count, struct dev_addr_list *mc_list) ++#endif + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + return netdev_hw_addr_list_count(mc_list); ++#else ++ return mc_count; ++#endif + } + + static void rtl8187_configure_filter(struct ieee80211_hw *dev, +--- a/drivers/net/wireless/ti/wlcore/main.c ++++ b/drivers/net/wireless/ti/wlcore/main.c +@@ -2786,11 +2786,20 @@ struct wl1271_filter_params { + u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN]; + }; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, + struct netdev_hw_addr_list *mc_list) ++#else ++static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count, ++ struct dev_addr_list *mc_list) ++#endif + { + struct wl1271_filter_params *fp; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr *ha; ++#else ++ int i; ++#endif + + fp = kzalloc(sizeof(*fp), GFP_ATOMIC); + if (!fp) { +@@ -2799,16 +2808,40 @@ static u64 wl1271_op_prepare_multicast(s + } + + /* update multicast filtering parameters */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + fp->mc_list_length = 0; + if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) { ++#else ++ fp->enabled = true; ++ if (mc_count > ACX_MC_ADDRESS_GROUP_MAX) { ++ mc_count = 0; ++#endif + fp->enabled = false; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + } else { + fp->enabled = true; + netdev_hw_addr_list_for_each(ha, mc_list) { ++#else ++ } ++ ++ fp->mc_list_length = 0; ++ for (i = 0; i < mc_count; i++) { ++ if (mc_list->da_addrlen == ETH_ALEN) { ++#endif + memcpy(fp->mc_list[fp->mc_list_length], ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ha->addr, ETH_ALEN); ++#else ++ mc_list->da_addr, ETH_ALEN); ++#endif + fp->mc_list_length++; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + } ++#else ++ } else ++ wl1271_warning("Unknown mc address length."); ++ mc_list = mc_list->next; ++#endif + } + + return (u64)(unsigned long)fp; +--- a/drivers/net/wireless/zd1211rw/zd_mac.c ++++ b/drivers/net/wireless/zd1211rw/zd_mac.c +@@ -1215,17 +1215,34 @@ static void zd_process_intr(struct work_ + + + static u64 zd_op_prepare_multicast(struct ieee80211_hw *hw, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list) ++#else ++ int mc_count, struct dev_addr_list *ha) ++#endif + { + struct zd_mac *mac = zd_hw_mac(hw); + struct zd_mc_hash hash; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr *ha; ++#else ++ int i; ++#endif + + zd_mc_clear(&hash); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + netdev_hw_addr_list_for_each(ha, mc_list) { + dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->addr); + zd_mc_add_addr(&hash, ha->addr); ++#else ++ for (i = 0; i < mc_count; i++) { ++ if (!ha) ++ break; ++ dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->dmi_addr); ++ zd_mc_add_addr(&hash, ha->dmi_addr); ++ ha = ha->next; ++#endif + } + + return hash.low | ((u64)hash.high << 32); +--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +@@ -95,7 +95,11 @@ static void _brcmf_set_multicast_list(st + netdev_for_each_mc_addr(ha, ndev) { + if (!cnt) + break; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + memcpy(bufp, ha->addr, ETH_ALEN); ++#else ++ memcpy(bufp, ha->dmi_addr, ETH_ALEN); ++#endif + bufp += ETH_ALEN; + cnt--; + } +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -2494,7 +2494,11 @@ struct ieee80211_ops { + void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); + + u64 (*prepare_multicast)(struct ieee80211_hw *hw, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list); ++#else ++ int mc_count, struct dev_addr_list *mc_list); ++#endif + void (*configure_filter)(struct ieee80211_hw *hw, + unsigned int changed_flags, + unsigned int *total_flags, +--- a/net/bluetooth/bnep/netdev.c ++++ b/net/bluetooth/bnep/netdev.c +@@ -93,8 +93,13 @@ static void bnep_net_set_mc_list(struct + netdev_for_each_mc_addr(ha, dev) { + if (i == BNEP_MAX_MULTICAST_FILTERS) + break; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN); + memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN); ++#else ++ memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN); ++ memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN); ++#endif + + i++; + } +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -216,14 +216,28 @@ static inline void drv_bss_info_changed( + } + + static inline u64 drv_prepare_multicast(struct ieee80211_local *local, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list *mc_list) ++#else ++ int mc_count, ++ struct dev_addr_list *mc_list) ++#endif + { + u64 ret = 0; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + trace_drv_prepare_multicast(local, mc_list->count); ++#else ++ trace_drv_prepare_multicast(local, mc_count); ++#endif + + if (local->ops->prepare_multicast) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ret = local->ops->prepare_multicast(&local->hw, mc_list); ++#else ++ ret = local->ops->prepare_multicast(&local->hw, mc_count, ++ mc_list); ++#endif + + trace_drv_return_u64(local, ret); + +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -925,7 +925,12 @@ struct ieee80211_local { + struct work_struct reconfig_filter; + + /* aggregated multicast list */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + struct netdev_hw_addr_list mc_list; ++#else ++ struct dev_addr_list *mc_list; ++ int mc_count; ++#endif + + bool tim_in_locked_section; /* see ieee80211_beacon_get() */ + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -762,8 +762,13 @@ static void ieee80211_do_stop(struct iee + if (sdata->dev) { + netif_addr_lock_bh(sdata->dev); + spin_lock_bh(&local->filter_lock); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + __hw_addr_unsync(&local->mc_list, &sdata->dev->mc, + sdata->dev->addr_len); ++#else ++ __dev_addr_unsync(&local->mc_list, &local->mc_count, ++ &sdata->dev->mc_list, &sdata->dev->mc_count); ++#endif + spin_unlock_bh(&local->filter_lock); + netif_addr_unlock_bh(sdata->dev); + +@@ -920,7 +925,12 @@ static void ieee80211_set_multicast_list + sdata->flags ^= IEEE80211_SDATA_PROMISC; + } + spin_lock_bh(&local->filter_lock); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len); ++#else ++ __dev_addr_sync(&local->mc_list, &local->mc_count, ++ &dev->mc_list, &dev->mc_count); ++#endif + spin_unlock_bh(&local->filter_lock); + ieee80211_queue_work(&local->hw, &local->reconfig_filter); + } +--- a/net/mac80211/main.c ++++ b/net/mac80211/main.c +@@ -72,7 +72,11 @@ void ieee80211_configure_filter(struct i + spin_lock_bh(&local->filter_lock); + changed_flags = local->filter_flags ^ new_flags; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + mc = drv_prepare_multicast(local, &local->mc_list); ++#else ++ mc = drv_prepare_multicast(local, local->mc_count, local->mc_list); ++#endif + spin_unlock_bh(&local->filter_lock); + + /* be a bit nasty */ +@@ -642,9 +646,11 @@ struct ieee80211_hw *ieee80211_alloc_hw( + wiphy->ht_capa_mod_mask = &mac80211_ht_capa_mod_mask; + + INIT_LIST_HEAD(&local->interfaces); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + + __hw_addr_init(&local->mc_list); + ++#endif + mutex_init(&local->iflist_mtx); + mutex_init(&local->mtx); + +--- a/drivers/net/wireless/ath/ath6kl/main.c ++++ b/drivers/net/wireless/ath/ath6kl/main.c +@@ -1238,7 +1238,11 @@ static void ath6kl_set_multicast_list(st + list_for_each_entry_safe(mc_filter, tmp, &vif->mc_filter, list) { + found = false; + netdev_for_each_mc_addr(ha, ndev) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + if (memcmp(ha->addr, mc_filter->hw_addr, ++#else ++ if (memcmp(ha->dmi_addr, mc_filter->hw_addr, ++#endif + ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE) == 0) { + found = true; + break; +@@ -1272,7 +1276,11 @@ static void ath6kl_set_multicast_list(st + netdev_for_each_mc_addr(ha, ndev) { + found = false; + list_for_each_entry(mc_filter, &vif->mc_filter, list) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + if (memcmp(ha->addr, mc_filter->hw_addr, ++#else ++ if (memcmp(ha->dmi_addr, mc_filter->hw_addr, ++#endif + ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE) == 0) { + found = true; + break; +@@ -1287,7 +1295,11 @@ static void ath6kl_set_multicast_list(st + goto out; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + memcpy(mc_filter->hw_addr, ha->addr, ++#else ++ memcpy(mc_filter->hw_addr, ha->dmi_addr, ++#endif + ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE); + /* Set the multicast filter */ + ath6kl_dbg(ATH6KL_DBG_TRC, diff --git a/patches/collateral-evolutions/network/26-sdio-quirks.patch b/patches/collateral-evolutions/network/26-sdio-quirks.patch new file mode 100644 index 000000000000..0281c6bacc0a --- /dev/null +++ b/patches/collateral-evolutions/network/26-sdio-quirks.patch @@ -0,0 +1,32 @@ +The quirks attribute is not available on older kernels. + +--- a/drivers/net/wireless/libertas/if_sdio.c ++++ b/drivers/net/wireless/libertas/if_sdio.c +@@ -873,6 +873,7 @@ static int if_sdio_power_on(struct if_sd + if (ret) + goto release; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) + /* For 1-bit transfers to the 8686 model, we need to enable the + * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 + * bit to allow access to non-vendor registers. */ +@@ -891,6 +892,7 @@ static int if_sdio_power_on(struct if_sd + if (ret) + goto disable; + } ++#endif + + card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret); + if (ret) +--- a/drivers/net/wireless/mwifiex/sdio.c ++++ b/drivers/net/wireless/mwifiex/sdio.c +@@ -75,7 +75,9 @@ mwifiex_sdio_probe(struct sdio_func *fun + + card->func = func; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; ++#endif + + sdio_claim_host(func); + ret = sdio_enable_func(func); diff --git a/patches/collateral-evolutions/network/27-hermes-read-pda-conflict.patch b/patches/collateral-evolutions/network/27-hermes-read-pda-conflict.patch new file mode 100644 index 000000000000..c50624764587 --- /dev/null +++ b/patches/collateral-evolutions/network/27-hermes-read-pda-conflict.patch @@ -0,0 +1,56 @@ +Rename read_pda to something else because this symbol is used in a +define for something else in arch/um/include/asm/pda.h on older kernels. + +--- a/drivers/net/wireless/orinoco/fw.c ++++ b/drivers/net/wireless/orinoco/fw.c +@@ -123,7 +123,7 @@ orinoco_dl_firmware(struct orinoco_priva + dev_dbg(dev, "Attempting to download firmware %s\n", firmware); + + /* Read current plug data */ +- err = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size); ++ err = hw->ops->read_pda_h(hw, pda, fw->pda_addr, fw->pda_size); + dev_dbg(dev, "Read PDA returned %d\n", err); + if (err) + goto free; +@@ -225,7 +225,7 @@ symbol_dl_image(struct orinoco_private * + if (!pda) + return -ENOMEM; + +- ret = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size); ++ ret = hw->ops->read_pda_h(hw, pda, fw->pda_addr, fw->pda_size); + if (ret) + goto free; + } +--- a/drivers/net/wireless/orinoco/hermes.c ++++ b/drivers/net/wireless/orinoco/hermes.c +@@ -767,7 +767,7 @@ static const struct hermes_ops hermes_op + .write_ltv = hermes_write_ltv, + .bap_pread = hermes_bap_pread, + .bap_pwrite = hermes_bap_pwrite, +- .read_pda = hermes_read_pda, ++ .read_pda_h = hermes_read_pda, + .program_init = hermesi_program_init, + .program_end = hermesi_program_end, + .program = hermes_program_bytes, +--- a/drivers/net/wireless/orinoco/hermes.h ++++ b/drivers/net/wireless/orinoco/hermes.h +@@ -393,7 +393,7 @@ struct hermes_ops { + u16 id, u16 offset); + int (*bap_pwrite)(struct hermes *hw, int bap, const void *buf, + int len, u16 id, u16 offset); +- int (*read_pda)(struct hermes *hw, __le16 *pda, ++ int (*read_pda_h)(struct hermes *hw, __le16 *pda, + u32 pda_addr, u16 pda_len); + int (*program_init)(struct hermes *hw, u32 entry_point); + int (*program_end)(struct hermes *hw); +--- a/drivers/net/wireless/orinoco/orinoco_usb.c ++++ b/drivers/net/wireless/orinoco/orinoco_usb.c +@@ -1547,7 +1547,7 @@ static const struct hermes_ops ezusb_ops + .read_ltv = ezusb_read_ltv, + .write_ltv = ezusb_write_ltv, + .bap_pread = ezusb_bap_pread, +- .read_pda = ezusb_read_pda, ++ .read_pda_h = ezusb_read_pda, + .program_init = ezusb_program_init, + .program_end = ezusb_program_end, + .program = ezusb_program, diff --git a/patches/collateral-evolutions/network/29-sdio_no_suspend.patch b/patches/collateral-evolutions/network/29-sdio_no_suspend.patch new file mode 100644 index 000000000000..b3654a2143dd --- /dev/null +++ b/patches/collateral-evolutions/network/29-sdio_no_suspend.patch @@ -0,0 +1,199 @@ +Starting with commit 66fceb69b72ff7e9cd8da2ca70033982d5376e0e +"libertas: Added callback functions to support SDIO suspend/resume." +libertas uses new functions from the in kernel sdio framework for +suspend and resume that are not backported. + +--- a/drivers/net/wireless/ath/ath6kl/sdio.c ++++ b/drivers/net/wireless/ath/ath6kl/sdio.c +@@ -807,6 +807,7 @@ out: + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + static int ath6kl_set_sdio_pm_caps(struct ath6kl *ar) + { + struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); +@@ -940,6 +941,17 @@ static int ath6kl_sdio_resume(struct ath + + return 0; + } ++#else ++static int ath6kl_sdio_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow) ++{ ++ return 0; ++} ++ ++static int ath6kl_sdio_resume(struct ath6kl *ar) ++{ ++ return 0; ++} ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ + + /* set the window address register (using 4-byte register access ). */ + static int ath6kl_set_addrwin_reg(struct ath6kl *ar, u32 reg_addr, u32 addr) +@@ -1251,7 +1263,7 @@ static const struct ath6kl_hif_ops ath6k + .stop = ath6kl_sdio_stop, + }; + +-#ifdef CONFIG_PM_SLEEP ++#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + + /* + * Empty handlers so that mmc subsystem doesn't remove us entirely during +@@ -1401,7 +1413,9 @@ static struct sdio_driver ath6kl_sdio_dr + .id_table = ath6kl_sdio_devices, + .probe = ath6kl_sdio_probe, + .remove = ath6kl_sdio_remove, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + .drv.pm = ATH6KL_SDIO_PM_OPS, ++#endif + }; + + static int __init ath6kl_sdio_init(void) +--- a/drivers/net/wireless/libertas/if_sdio.c ++++ b/drivers/net/wireless/libertas/if_sdio.c +@@ -1341,6 +1341,7 @@ static void if_sdio_remove(struct sdio_f + lbs_deb_leave(LBS_DEB_SDIO); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + static int if_sdio_suspend(struct device *dev) + { + struct sdio_func *func = dev_to_sdio_func(dev); +@@ -1399,15 +1400,18 @@ static const struct dev_pm_ops if_sdio_p + .suspend = if_sdio_suspend, + .resume = if_sdio_resume, + }; ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ + + static struct sdio_driver if_sdio_driver = { + .name = "libertas_sdio", + .id_table = if_sdio_ids, + .probe = if_sdio_probe, + .remove = if_sdio_remove, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + .drv = { + .pm = &if_sdio_pm_ops, + }, ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ + }; + + /*******************************************************************/ +--- a/drivers/net/wireless/mwifiex/sdio.c ++++ b/drivers/net/wireless/mwifiex/sdio.c +@@ -129,8 +129,10 @@ mwifiex_sdio_remove(struct sdio_func *fu + wait_for_completion(&adapter->fw_load); + + if (user_rmmod) { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + if (adapter->is_suspended) + mwifiex_sdio_resume(adapter->dev); ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ + + for (i = 0; i < adapter->priv_num; i++) + if ((GET_BSS_ROLE(adapter->priv[i]) == +@@ -147,6 +149,7 @@ mwifiex_sdio_remove(struct sdio_func *fu + kfree(card); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + /* + * SDIO suspend. + * +@@ -255,6 +258,7 @@ static int mwifiex_sdio_resume(struct de + + return 0; + } ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ + + /* Device ID for SD8786 */ + #define SDIO_DEVICE_ID_MARVELL_8786 (0x9116) +@@ -273,10 +277,12 @@ static const struct sdio_device_id mwifi + + MODULE_DEVICE_TABLE(sdio, mwifiex_ids); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + static const struct dev_pm_ops mwifiex_sdio_pm_ops = { + .suspend = mwifiex_sdio_suspend, + .resume = mwifiex_sdio_resume, + }; ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ + + static struct sdio_driver mwifiex_sdio = { + .name = "mwifiex_sdio", +@@ -285,7 +291,9 @@ static struct sdio_driver mwifiex_sdio = + .remove = mwifiex_sdio_remove, + .drv = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + .pm = &mwifiex_sdio_pm_ops, ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ + } + }; + +--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +@@ -73,7 +73,7 @@ static bool + brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev) + { + bool is_err = false; +-#ifdef CONFIG_PM_SLEEP ++#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + is_err = atomic_read(&sdiodev->suspend); + #endif + return is_err; +@@ -82,7 +82,7 @@ brcmf_pm_resume_error(struct brcmf_sdio_ + static void + brcmf_pm_resume_wait(struct brcmf_sdio_dev *sdiodev, wait_queue_head_t *wq) + { +-#ifdef CONFIG_PM_SLEEP ++#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + int retry = 0; + while (atomic_read(&sdiodev->suspend) && retry++ != 30) + wait_event_timeout(*wq, false, HZ/100); +@@ -550,7 +550,7 @@ static void brcmf_ops_sdio_remove(struct + brcmf_dbg(TRACE, "Exit\n"); + } + +-#ifdef CONFIG_PM_SLEEP ++#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + static int brcmf_sdio_suspend(struct device *dev) + { + mmc_pm_flag_t sdio_flags; +@@ -600,7 +600,7 @@ static struct sdio_driver brcmf_sdmmc_dr + .remove = brcmf_ops_sdio_remove, + .name = "brcmfmac", + .id_table = brcmf_sdmmc_ids, +-#ifdef CONFIG_PM_SLEEP ++#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + .drv = { + .pm = &brcmf_sdio_pm_ops, + }, +--- a/drivers/bluetooth/btmrvl_sdio.c ++++ b/drivers/bluetooth/btmrvl_sdio.c +@@ -1050,6 +1050,7 @@ static void btmrvl_sdio_remove(struct sd + } + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + static int btmrvl_sdio_suspend(struct device *dev) + { + struct sdio_func *func = dev_to_sdio_func(dev); +@@ -1145,6 +1146,7 @@ static const struct dev_pm_ops btmrvl_sd + .suspend = btmrvl_sdio_suspend, + .resume = btmrvl_sdio_resume, + }; ++#endif + + static struct sdio_driver bt_mrvl_sdio = { + .name = "btmrvl_sdio", +@@ -1153,7 +1155,9 @@ static struct sdio_driver bt_mrvl_sdio = + .remove = btmrvl_sdio_remove, + .drv = { + .owner = THIS_MODULE, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + .pm = &btmrvl_sdio_pm_ops, ++#endif + } + }; + diff --git a/patches/collateral-evolutions/network/30-bridge-port.patch b/patches/collateral-evolutions/network/30-bridge-port.patch new file mode 100644 index 000000000000..a426274e6c84 --- /dev/null +++ b/patches/collateral-evolutions/network/30-bridge-port.patch @@ -0,0 +1,45 @@ +The patch titled: + + bridge: use rx_handler_data pointer to store net_bridge_port pointer + +by Jiri Pirko moved the br_ports pointer +out of the netdev which older kernels relied on and then added +a flag to the netdev to check for it as follows: + +- dev->br_port) { ++ (dev->priv_flags & IFF_BRIDGE_PORT)) { + +So to backport this we instead rely on a br_port_exists() call +which compat.git provides and depending on the kernel it will either +check for the dev->br_port or the IFF_BRIDGE_PORT flag. A patch +to get the blow code merged upstream and to use br_port_exists() +everywhere else will be submitted but not sure if it will be +accepted. + +This patch can be removed once we get br_port_exists() accessible +to drivers and not just private bridge code. If that patch doesn't +get accepted upstream we'l have to carry this patch around for +compat-drivers. + +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -813,7 +813,7 @@ int cfg80211_change_iface(struct cfg8021 + return -EOPNOTSUPP; + + /* if it's part of a bridge, reject changing type to station/ibss */ +- if ((dev->priv_flags & IFF_BRIDGE_PORT) && ++ if (br_port_exists(dev) && + (ntype == NL80211_IFTYPE_ADHOC || + ntype == NL80211_IFTYPE_STATION || + ntype == NL80211_IFTYPE_P2P_CLIENT)) +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -2014,7 +2014,7 @@ static int nl80211_valid_4addr(struct cf + enum nl80211_iftype iftype) + { + if (!use_4addr) { +- if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT)) ++ if (netdev && br_port_exists(netdev)) + return -EBUSY; + return 0; + } diff --git a/patches/collateral-evolutions/network/32-remove-ns-type.patch b/patches/collateral-evolutions/network/32-remove-ns-type.patch new file mode 100644 index 000000000000..8e981b79082e --- /dev/null +++ b/patches/collateral-evolutions/network/32-remove-ns-type.patch @@ -0,0 +1,28 @@ +--- a/net/wireless/sysfs.c ++++ b/net/wireless/sysfs.c +@@ -122,12 +122,14 @@ static int wiphy_resume(struct device *d + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + static const void *wiphy_namespace(struct device *d) + { + struct wiphy *wiphy = container_of(d, struct wiphy, dev); + + return wiphy_net(wiphy); + } ++#endif + + struct class ieee80211_class = { + .name = "ieee80211", +@@ -139,8 +141,10 @@ struct class ieee80211_class = { + #endif + .suspend = wiphy_suspend, + .resume = wiphy_resume, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + .ns_type = &net_ns_type_operations, + .namespace = wiphy_namespace, ++#endif + }; + + int wiphy_sysfs_init(void) diff --git a/patches/collateral-evolutions/network/35-fix-makefile-includes.patch b/patches/collateral-evolutions/network/35-fix-makefile-includes.patch new file mode 100644 index 000000000000..d0e0089c6b1e --- /dev/null +++ b/patches/collateral-evolutions/network/35-fix-makefile-includes.patch @@ -0,0 +1,71 @@ +When some other headers are included in some makefile it must be +relative to the current object file processed. When giving the full +path the make process will search in the kernel tree for the headers. + +--- a/drivers/net/wireless/rtl818x/rtl8180/Makefile ++++ b/drivers/net/wireless/rtl818x/rtl8180/Makefile +@@ -2,4 +2,4 @@ rtl8180-objs := dev.o rtl8225.o sa2400. + + obj-$(CONFIG_RTL8180) += rtl8180.o + +-ccflags-y += -Idrivers/net/wireless/rtl818x ++ccflags-y += -I$(obj)/.. +--- a/drivers/net/wireless/rtl818x/rtl8187/Makefile ++++ b/drivers/net/wireless/rtl818x/rtl8187/Makefile +@@ -2,4 +2,4 @@ rtl8187-objs := dev.o rtl8225.o leds.o + + obj-$(CONFIG_RTL8187) += rtl8187.o + +-ccflags-y += -Idrivers/net/wireless/rtl818x ++ccflags-y += -I$(obj)/.. +--- a/drivers/net/wireless/brcm80211/brcmfmac/Makefile ++++ b/drivers/net/wireless/brcm80211/brcmfmac/Makefile +@@ -16,8 +16,8 @@ + # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ccflags-y += \ +- -Idrivers/net/wireless/brcm80211/brcmfmac \ +- -Idrivers/net/wireless/brcm80211/include ++ -I$(obj) \ ++ -I$(obj)/../include + + ccflags-y += -D__CHECK_ENDIAN__ + +--- a/drivers/net/wireless/brcm80211/brcmsmac/Makefile ++++ b/drivers/net/wireless/brcm80211/brcmsmac/Makefile +@@ -17,9 +17,9 @@ + + ccflags-y := \ + -D__CHECK_ENDIAN__ \ +- -Idrivers/net/wireless/brcm80211/brcmsmac \ +- -Idrivers/net/wireless/brcm80211/brcmsmac/phy \ +- -Idrivers/net/wireless/brcm80211/include ++ -I$(obj) \ ++ -I$(obj)/phy \ ++ -I$(obj)/../include + + BRCMSMAC_OFILES := \ + mac80211_if.o \ +--- a/drivers/net/wireless/brcm80211/brcmutil/Makefile ++++ b/drivers/net/wireless/brcm80211/brcmutil/Makefile +@@ -16,8 +16,8 @@ + # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ccflags-y := \ +- -Idrivers/net/wireless/brcm80211/brcmutil \ +- -Idrivers/net/wireless/brcm80211/include ++ -I$(obj) \ ++ -I$(obj)/../include + + BRCMUTIL_OFILES := \ + utils.o +--- a/net/wireless/Makefile ++++ b/net/wireless/Makefile +@@ -20,6 +20,6 @@ CFLAGS_trace.o := -I$(src) + ccflags-y += -D__CHECK_ENDIAN__ + + $(obj)/regdb.c: $(src)/db.txt $(src)/genregdb.awk +- @$(AWK) -f $(srctree)/$(src)/genregdb.awk < $< > $@ ++ @$(AWK) -f $(src)/genregdb.awk < $< > $@ + + clean-files := regdb.c diff --git a/patches/collateral-evolutions/network/36-workqueue.patch b/patches/collateral-evolutions/network/36-workqueue.patch new file mode 100644 index 000000000000..f7a2b1a701f0 --- /dev/null +++ b/patches/collateral-evolutions/network/36-workqueue.patch @@ -0,0 +1,16 @@ +Backport commit 99b88a0ecbdbc6df03527292571b2b442965814a +The rest is backported in include/linux/compat-2.6.37.h + +--- a/net/mac80211/main.c ++++ b/net/mac80211/main.c +@@ -1194,6 +1194,10 @@ static void __exit ieee80211_exit(void) + rc80211_minstrel_ht_exit(); + rc80211_minstrel_exit(); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) ++ flush_scheduled_work(); ++#endif ++ + if (mesh_allocated) + ieee80211s_stop(); + diff --git a/patches/collateral-evolutions/network/37-vsnprintk.patch b/patches/collateral-evolutions/network/37-vsnprintk.patch new file mode 100644 index 000000000000..2a3d30440034 --- /dev/null +++ b/patches/collateral-evolutions/network/37-vsnprintk.patch @@ -0,0 +1,35 @@ +--- a/drivers/net/wireless/ath/main.c ++++ b/drivers/net/wireless/ath/main.c +@@ -59,6 +59,7 @@ struct sk_buff *ath_rxbuf_alloc(struct a + } + EXPORT_SYMBOL(ath_rxbuf_alloc); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + void ath_printk(const char *level, const struct ath_common* common, + const char *fmt, ...) + { +@@ -78,4 +79,24 @@ void ath_printk(const char *level, const + + va_end(args); + } ++#else ++void ath_printk(const char *level, const struct ath_common* common, ++ const char *fmt, ...) ++{ ++ va_list args; ++ ++ va_start(args, fmt); ++ ++ if (common && common->hw && common->hw->wiphy) ++ printk("%sath: %s: ", ++ level, wiphy_name(common->hw->wiphy)); ++ else ++ printk("%sath: ", level); ++ ++ vprintk(fmt, args); ++ ++ va_end(args); ++} ++#endif ++ + EXPORT_SYMBOL(ath_printk); diff --git a/patches/collateral-evolutions/network/38-led-max-brightness.patch b/patches/collateral-evolutions/network/38-led-max-brightness.patch new file mode 100644 index 000000000000..fa0dee71b0e6 --- /dev/null +++ b/patches/collateral-evolutions/network/38-led-max-brightness.patch @@ -0,0 +1,24 @@ +--- a/drivers/net/wireless/iwlegacy/common.c ++++ b/drivers/net/wireless/iwlegacy/common.c +@@ -562,7 +562,9 @@ il_leds_init(struct il_priv *il) + kasprintf(GFP_KERNEL, "%s-led", wiphy_name(il->hw->wiphy)); + il->led.brightness_set = il_led_brightness_set; + il->led.blink_set = il_led_blink_set; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + il->led.max_brightness = 1; ++#endif + + switch (mode) { + case IL_LED_DEFAULT: +--- a/drivers/net/wireless/iwlwifi/dvm/led.c ++++ b/drivers/net/wireless/iwlwifi/dvm/led.c +@@ -187,7 +187,9 @@ void iwl_leds_init(struct iwl_priv *priv + wiphy_name(priv->hw->wiphy)); + priv->led.brightness_set = iwl_led_brightness_set; + priv->led.blink_set = iwl_led_blink_set; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + priv->led.max_brightness = 1; ++#endif + + switch (mode) { + case IWL_LED_DEFAULT: diff --git a/patches/collateral-evolutions/network/39-remove_blink_set.patch b/patches/collateral-evolutions/network/39-remove_blink_set.patch new file mode 100644 index 000000000000..dc9af73fb7b1 --- /dev/null +++ b/patches/collateral-evolutions/network/39-remove_blink_set.patch @@ -0,0 +1,56 @@ +--- a/drivers/net/wireless/iwlegacy/common.c ++++ b/drivers/net/wireless/iwlegacy/common.c +@@ -540,6 +540,7 @@ il_led_brightness_set(struct led_classde + il_led_cmd(il, on, 0); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) + static int + il_led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on, + unsigned long *delay_off) +@@ -548,6 +549,7 @@ il_led_blink_set(struct led_classdev *le + + return il_led_cmd(il, *delay_on, *delay_off); + } ++#endif + + void + il_leds_init(struct il_priv *il) +@@ -561,7 +563,9 @@ il_leds_init(struct il_priv *il) + il->led.name = + kasprintf(GFP_KERNEL, "%s-led", wiphy_name(il->hw->wiphy)); + il->led.brightness_set = il_led_brightness_set; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) + il->led.blink_set = il_led_blink_set; ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + il->led.max_brightness = 1; + #endif +--- a/drivers/net/wireless/iwlwifi/dvm/led.c ++++ b/drivers/net/wireless/iwlwifi/dvm/led.c +@@ -162,6 +162,7 @@ static void iwl_led_brightness_set(struc + iwl_led_cmd(priv, on, 0); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) + static int iwl_led_blink_set(struct led_classdev *led_cdev, + unsigned long *delay_on, + unsigned long *delay_off) +@@ -170,6 +171,7 @@ static int iwl_led_blink_set(struct led_ + + return iwl_led_cmd(priv, *delay_on, *delay_off); + } ++#endif + + void iwl_leds_init(struct iwl_priv *priv) + { +@@ -186,7 +188,9 @@ void iwl_leds_init(struct iwl_priv *priv + priv->led.name = kasprintf(GFP_KERNEL, "%s-led", + wiphy_name(priv->hw->wiphy)); + priv->led.brightness_set = iwl_led_brightness_set; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) + priv->led.blink_set = iwl_led_blink_set; ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + priv->led.max_brightness = 1; + #endif diff --git a/patches/collateral-evolutions/network/40-netdev-hw-features.patch b/patches/collateral-evolutions/network/40-netdev-hw-features.patch new file mode 100644 index 000000000000..605e97f1d281 --- /dev/null +++ b/patches/collateral-evolutions/network/40-netdev-hw-features.patch @@ -0,0 +1,372 @@ +This reverts the commits that deal with hw_features and +set_features, fix_features for kernels < 2.6.39. + +Below is one example commit being reverted, but we also do +this for ath6kl and any driver that uses this in this file. + +commit 782d640afd15af7a1faf01cfe566ca4ac511319d +Author: Michał Mirosław +Date: Thu Apr 7 07:32:18 2011 +0000 + + net: atl*: convert to hw_features + + Things left as they were: + - atl1: is RX checksum really enabled? + - atl2: copy-paste from atl1, with-errors-on-modify I presume + - atl1c: there's a bug: MTU can't be changed if device is not up + + Signed-off-by: Michał Mirosław + Signed-off-by: David S. Miller + +--- a/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c ++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c +@@ -114,6 +114,13 @@ static int atl1c_set_settings(struct net + return 0; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) ++static u32 atl1c_get_tx_csum(struct net_device *netdev) ++{ ++ return (netdev->features & NETIF_F_HW_CSUM) != 0; ++} ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ ++ + static u32 atl1c_get_msglevel(struct net_device *netdev) + { + struct atl1c_adapter *adapter = netdev_priv(netdev); +@@ -301,6 +308,11 @@ static const struct ethtool_ops atl1c_et + .get_link = ethtool_op_get_link, + .get_eeprom_len = atl1c_get_eeprom_len, + .get_eeprom = atl1c_get_eeprom, ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) ++ .get_tx_csum = atl1c_get_tx_csum, ++ .get_sg = ethtool_op_get_sg, ++ .set_sg = ethtool_op_set_sg, ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ + }; + + void atl1c_set_ethtool_ops(struct net_device *netdev) +--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c ++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +@@ -492,6 +492,7 @@ static void atl1c_set_rxbufsize(struct a + roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + static netdev_features_t atl1c_fix_features(struct net_device *netdev, + netdev_features_t features) + { +@@ -520,6 +521,7 @@ static int atl1c_set_features(struct net + + return 0; + } ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + + /** + * atl1c_change_mtu - Change the Maximum Transfer Unit +@@ -552,8 +554,19 @@ static int atl1c_change_mtu(struct net_d + netdev->mtu = new_mtu; + adapter->hw.max_frame_size = new_mtu; + atl1c_set_rxbufsize(adapter, netdev); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) ++ if (new_mtu > MAX_TSO_FRAME_SIZE) { ++ adapter->netdev->features &= ~NETIF_F_TSO; ++ adapter->netdev->features &= ~NETIF_F_TSO6; ++ } else { ++ adapter->netdev->features |= NETIF_F_TSO; ++ adapter->netdev->features |= NETIF_F_TSO6; ++ } ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ + atl1c_down(adapter); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + netdev_update_features(netdev); ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + atl1c_up(adapter); + clear_bit(__AT_RESETTING, &adapter->flags); + } +@@ -2405,8 +2418,10 @@ static const struct net_device_ops atl1c + .ndo_set_mac_address = atl1c_set_mac_addr, + .ndo_set_rx_mode = atl1c_set_multi, + .ndo_change_mtu = atl1c_change_mtu, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + .ndo_fix_features = atl1c_fix_features, + .ndo_set_features = atl1c_set_features, ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + .ndo_do_ioctl = atl1c_ioctl, + .ndo_tx_timeout = atl1c_tx_timeout, + .ndo_get_stats = atl1c_get_stats, +@@ -2425,6 +2440,7 @@ static int atl1c_init_netdev(struct net_ + atl1c_set_ethtool_ops(netdev); + + /* TODO: add when ready */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + netdev->hw_features = NETIF_F_SG | + NETIF_F_HW_CSUM | + NETIF_F_HW_VLAN_RX | +@@ -2432,6 +2448,14 @@ static int atl1c_init_netdev(struct net_ + NETIF_F_TSO6; + netdev->features = netdev->hw_features | + NETIF_F_HW_VLAN_TX; ++#else ++ netdev->features = NETIF_F_SG | ++ NETIF_F_HW_CSUM | ++ NETIF_F_HW_VLAN_TX | ++ NETIF_F_HW_VLAN_RX | ++ NETIF_F_TSO | ++ NETIF_F_TSO6; ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + return 0; + } + +--- a/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c ++++ b/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c +@@ -384,6 +384,11 @@ static const struct ethtool_ops atl1e_et + .get_eeprom_len = atl1e_get_eeprom_len, + .get_eeprom = atl1e_get_eeprom, + .set_eeprom = atl1e_set_eeprom, ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) ++ .set_tx_csum = ethtool_op_set_tx_hw_csum, ++ .set_sg = ethtool_op_set_sg, ++ .set_tso = ethtool_op_set_tso, ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ + }; + + void atl1e_set_ethtool_ops(struct net_device *netdev) +--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c ++++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c +@@ -375,6 +375,7 @@ static int atl1e_set_mac_addr(struct net + return 0; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + static netdev_features_t atl1e_fix_features(struct net_device *netdev, + netdev_features_t features) + { +@@ -400,6 +401,7 @@ static int atl1e_set_features(struct net + + return 0; + } ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + + /** + * atl1e_change_mtu - Change the Maximum Transfer Unit +@@ -1929,7 +1931,11 @@ void atl1e_down(struct atl1e_adapter *ad + * reschedule our watchdog timer */ + set_bit(__AT_DOWN, &adapter->flags); + ++#if defined(NETIF_F_LLTX) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + netif_stop_queue(netdev); ++#else ++ netif_tx_disable(netdev); ++#endif + + /* reset MAC to disable all RX/TX */ + atl1e_reset_hw(&adapter->hw); +@@ -2199,8 +2205,10 @@ static const struct net_device_ops atl1e + .ndo_set_rx_mode = atl1e_set_multi, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = atl1e_set_mac_addr, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + .ndo_fix_features = atl1e_fix_features, + .ndo_set_features = atl1e_set_features, ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + .ndo_change_mtu = atl1e_change_mtu, + .ndo_do_ioctl = atl1e_ioctl, + .ndo_tx_timeout = atl1e_tx_timeout, +@@ -2220,10 +2228,15 @@ static int atl1e_init_netdev(struct net_ + netdev->watchdog_timeo = AT_TX_WATCHDOG; + atl1e_set_ethtool_ops(netdev); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + netdev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | + NETIF_F_HW_VLAN_RX; + netdev->features = netdev->hw_features | NETIF_F_LLTX | + NETIF_F_HW_VLAN_TX; ++#else ++ netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | ++ NETIF_F_HW_VLAN_RX | NETIF_F_LLTX | NETIF_F_HW_VLAN_TX; ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + + return 0; + } +--- a/drivers/net/ethernet/atheros/atlx/atl1.c ++++ b/drivers/net/ethernet/atheros/atlx/atl1.c +@@ -2917,8 +2917,10 @@ static const struct net_device_ops atl1_ + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = atl1_set_mac, + .ndo_change_mtu = atl1_change_mtu, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + .ndo_fix_features = atlx_fix_features, + .ndo_set_features = atlx_set_features, ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + .ndo_do_ioctl = atlx_ioctl, + .ndo_tx_timeout = atlx_tx_timeout, + #ifdef CONFIG_NET_POLL_CONTROLLER +@@ -3029,11 +3031,13 @@ static int __devinit atl1_probe(struct p + netdev->features |= NETIF_F_SG; + netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + netdev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_TSO | + NETIF_F_HW_VLAN_RX; + + /* is this valid? see atl1_setup_mac_ctrl() */ + netdev->features |= NETIF_F_RXCSUM; ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + + /* + * patch for some L1 of old version, +@@ -3646,6 +3650,14 @@ static int atl1_set_pauseparam(struct ne + return 0; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) ++/* FIXME: is this right? -- CHS */ ++static u32 atl1_get_rx_csum(struct net_device *netdev) ++{ ++ return 1; ++} ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ ++ + static void atl1_get_strings(struct net_device *netdev, u32 stringset, + u8 *data) + { +@@ -3718,4 +3730,10 @@ static const struct ethtool_ops atl1_eth + .nway_reset = atl1_nway_reset, + .get_ethtool_stats = atl1_get_ethtool_stats, + .get_sset_count = atl1_get_sset_count, ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) ++ .get_rx_csum = atl1_get_rx_csum, ++ .set_tx_csum = ethtool_op_set_tx_hw_csum, ++ .set_sg = ethtool_op_set_sg, ++ .set_tso = ethtool_op_set_tso, ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ + }; +--- a/drivers/net/ethernet/atheros/atlx/atl2.c ++++ b/drivers/net/ethernet/atheros/atlx/atl2.c +@@ -396,6 +396,7 @@ static void atl2_restore_vlan(struct atl + atl2_vlan_mode(adapter->netdev, adapter->netdev->features); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + static netdev_features_t atl2_fix_features(struct net_device *netdev, + netdev_features_t features) + { +@@ -421,6 +422,7 @@ static int atl2_set_features(struct net_ + + return 0; + } ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + + static void atl2_intr_rx(struct atl2_adapter *adapter) + { +@@ -1322,8 +1324,10 @@ static const struct net_device_ops atl2_ + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = atl2_set_mac, + .ndo_change_mtu = atl2_change_mtu, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + .ndo_fix_features = atl2_fix_features, + .ndo_set_features = atl2_set_features, ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + .ndo_do_ioctl = atl2_ioctl, + .ndo_tx_timeout = atl2_tx_timeout, + #ifdef CONFIG_NET_POLL_CONTROLLER +@@ -1421,8 +1425,12 @@ static int __devinit atl2_probe(struct p + + err = -EIO; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_RX; ++#endif ++#if defined(NETIF_F_HW_VLAN_TX) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); ++#endif + + /* Init PHY as early as possible due to power saving issue */ + atl2_phy_init(&adapter->hw); +@@ -1849,6 +1857,13 @@ static int atl2_set_settings(struct net_ + return 0; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) ++static u32 atl2_get_tx_csum(struct net_device *netdev) ++{ ++ return (netdev->features & NETIF_F_HW_CSUM) != 0; ++} ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ ++ + static u32 atl2_get_msglevel(struct net_device *netdev) + { + return 0; +@@ -2118,6 +2133,14 @@ static const struct ethtool_ops atl2_eth + .get_eeprom_len = atl2_get_eeprom_len, + .get_eeprom = atl2_get_eeprom, + .set_eeprom = atl2_set_eeprom, ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) ++ .get_tx_csum = atl2_get_tx_csum, ++ .get_sg = ethtool_op_get_sg, ++ .set_sg = ethtool_op_set_sg, ++#ifdef NETIF_F_TSO ++ .get_tso = ethtool_op_get_tso, ++#endif ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ + }; + + static void atl2_set_ethtool_ops(struct net_device *netdev) +--- a/drivers/net/ethernet/atheros/atlx/atlx.c ++++ b/drivers/net/ethernet/atheros/atlx/atlx.c +@@ -255,6 +255,7 @@ static void atlx_restore_vlan(struct atl + atlx_vlan_mode(adapter->netdev, adapter->netdev->features); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + static netdev_features_t atlx_fix_features(struct net_device *netdev, + netdev_features_t features) + { +@@ -280,5 +281,6 @@ static int atlx_set_features(struct net_ + + return 0; + } ++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ + + #endif /* ATLX_C */ +--- a/drivers/net/wireless/ath/ath6kl/main.c ++++ b/drivers/net/wireless/ath/ath6kl/main.c +@@ -1149,6 +1149,7 @@ static struct net_device_stats *ath6kl_g + return &vif->net_stats; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + static int ath6kl_set_features(struct net_device *dev, + netdev_features_t features) + { +@@ -1181,6 +1182,7 @@ static int ath6kl_set_features(struct ne + + return err; + } ++#endif + + static void ath6kl_set_multicast_list(struct net_device *ndev) + { +@@ -1328,7 +1330,9 @@ static const struct net_device_ops ath6k + .ndo_stop = ath6kl_close, + .ndo_start_xmit = ath6kl_data_tx, + .ndo_get_stats = ath6kl_get_stats, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + .ndo_set_features = ath6kl_set_features, ++#endif + .ndo_set_rx_mode = ath6kl_set_multicast_list, + }; + +@@ -1343,7 +1347,11 @@ void init_netdev(struct net_device *dev) + sizeof(struct wmi_data_hdr) + HTC_HDR_LENGTH + + WMI_MAX_TX_META_SZ + ATH6KL_HTC_ALIGN_BYTES; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM; ++#else ++ dev->features |= NETIF_F_IP_CSUM; ++#endif + + return; + } diff --git a/patches/collateral-evolutions/network/42-netlink_seq.patch b/patches/collateral-evolutions/network/42-netlink_seq.patch new file mode 100644 index 000000000000..bb065ab1cbca --- /dev/null +++ b/patches/collateral-evolutions/network/42-netlink_seq.patch @@ -0,0 +1,12 @@ +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -4910,7 +4910,9 @@ static int nl80211_dump_scan(struct sk_b + spin_lock_bh(&rdev->bss_lock); + cfg80211_bss_expire(rdev); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) + cb->seq = rdev->bss_generation; ++#endif + + list_for_each_entry(scan, &rdev->bss_list, list) { + if (++idx <= start) diff --git a/patches/collateral-evolutions/network/43-rename_pm_qos_request.patch b/patches/collateral-evolutions/network/43-rename_pm_qos_request.patch new file mode 100644 index 000000000000..d000d913d3d5 --- /dev/null +++ b/patches/collateral-evolutions/network/43-rename_pm_qos_request.patch @@ -0,0 +1,14 @@ +--- a/drivers/net/wireless/ipw2x00/ipw2100.c ++++ b/drivers/net/wireless/ipw2x00/ipw2100.c +@@ -175,7 +175,11 @@ that only one external action is invoked + #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver" + #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) ++static struct pm_qos_request_list ipw2100_pm_qos_req; ++#else + static struct pm_qos_request ipw2100_pm_qos_req; ++#endif + + /* Debugging stuff */ + #ifdef CONFIG_IPW2100_DEBUG diff --git a/patches/collateral-evolutions/network/44-deactivate-mac80211-tracing.patch b/patches/collateral-evolutions/network/44-deactivate-mac80211-tracing.patch new file mode 100644 index 000000000000..9c9858ddb1ee --- /dev/null +++ b/patches/collateral-evolutions/network/44-deactivate-mac80211-tracing.patch @@ -0,0 +1,27 @@ +Do not activate the mac80211 tracing for kernels <= 2.6.32 + +--- a/net/mac80211/Makefile ++++ b/net/mac80211/Makefile +@@ -25,7 +25,9 @@ mac80211-y := \ + wme.o \ + event.o \ + chan.o \ +- trace.o mlme.o ++ mlme.o ++ ++mac80211-$(CONFIG_COMPAT_MAC80211_DRIVER_API_TRACER) += trace.o + + mac80211-$(CONFIG_MAC80211_LEDS) += led.o + mac80211-$(CONFIG_MAC80211_DEBUGFS) += \ +--- a/net/wireless/Makefile ++++ b/net/wireless/Makefile +@@ -10,7 +10,8 @@ obj-$(CONFIG_WEXT_SPY) += wext-spy.o + obj-$(CONFIG_WEXT_PRIV) += wext-priv.o + + cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o +-cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o trace.o ++cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o ++cfg80211-$(CONFIG_COMPAT_CFG80211_DRIVER_API_TRACER) += trace.o + cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o + cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o + cfg80211-$(CONFIG_CFG80211_INTERNAL_REGDB) += regdb.o diff --git a/patches/collateral-evolutions/network/45-remove-platform-id-table.patch b/patches/collateral-evolutions/network/45-remove-platform-id-table.patch new file mode 100644 index 000000000000..886b52d222de --- /dev/null +++ b/patches/collateral-evolutions/network/45-remove-platform-id-table.patch @@ -0,0 +1,23 @@ +--- a/drivers/net/wireless/ti/wl12xx/main.c ++++ b/drivers/net/wireless/ti/wl12xx/main.c +@@ -1725,16 +1725,20 @@ out: + return ret; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + static const struct platform_device_id wl12xx_id_table[] __devinitconst = { + { "wl12xx", 0 }, + { } /* Terminating Entry */ + }; + MODULE_DEVICE_TABLE(platform, wl12xx_id_table); ++#endif + + static struct platform_driver wl12xx_driver = { + .probe = wl12xx_probe, + .remove = __devexit_p(wlcore_remove), ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + .id_table = wl12xx_id_table, ++#endif + .driver = { + .name = "wl12xx_driver", + .owner = THIS_MODULE, diff --git a/patches/collateral-evolutions/network/46-use_other_workqueue.patch b/patches/collateral-evolutions/network/46-use_other_workqueue.patch new file mode 100644 index 000000000000..16fa39b56b0e --- /dev/null +++ b/patches/collateral-evolutions/network/46-use_other_workqueue.patch @@ -0,0 +1,19 @@ +Old kernel versions do not support WQ_HIGHPRI and WQ_MEM_RECLAIM so we +should use create_singlethread_workqueue() which was used at this +position before. + +--- a/net/bluetooth/hci_core.c ++++ b/net/bluetooth/hci_core.c +@@ -1789,8 +1789,12 @@ int hci_register_dev(struct hci_dev *hde + list_add(&hdev->list, &hci_dev_list); + write_unlock(&hci_dev_list_lock); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + hdev->workqueue = alloc_workqueue(hdev->name, WQ_HIGHPRI | WQ_UNBOUND | + WQ_MEM_RECLAIM, 1); ++#else ++ hdev->workqueue = create_singlethread_workqueue(hdev->name); ++#endif + if (!hdev->workqueue) { + error = -ENOMEM; + goto err; diff --git a/patches/collateral-evolutions/network/47-no_trans_start_on_netdev_queue.patch b/patches/collateral-evolutions/network/47-no_trans_start_on_netdev_queue.patch new file mode 100644 index 000000000000..8dea0756e651 --- /dev/null +++ b/patches/collateral-evolutions/network/47-no_trans_start_on_netdev_queue.patch @@ -0,0 +1,17 @@ +The struct netdev_queue does not have the attribute trans_start in +kernel < 2.6.31. trans_start on struct net_device does the same +on older kernels. + +--- a/drivers/net/wireless/mwifiex/init.c ++++ b/drivers/net/wireless/mwifiex/init.c +@@ -375,8 +375,10 @@ void mwifiex_set_trans_start(struct net_ + { + int i; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)) + for (i = 0; i < dev->num_tx_queues; i++) + netdev_get_tx_queue(dev, i)->trans_start = jiffies; ++#endif + + dev->trans_start = jiffies; + } diff --git a/patches/collateral-evolutions/network/48-use_skb_get_queue_mapping.patch b/patches/collateral-evolutions/network/48-use_skb_get_queue_mapping.patch new file mode 100644 index 000000000000..f27801d73c92 --- /dev/null +++ b/patches/collateral-evolutions/network/48-use_skb_get_queue_mapping.patch @@ -0,0 +1,38 @@ +Use skb_get_queue_mapping() for getting the queue_mapping member of +skb. Some old kernels do not have the member queue_mapping, but this +function always returns something. + +--- a/drivers/net/wireless/b43/main.c ++++ b/drivers/net/wireless/b43/main.c +@@ -3424,11 +3424,11 @@ static void b43_op_tx(struct ieee80211_h + } + B43_WARN_ON(skb_shinfo(skb)->nr_frags); + +- skb_queue_tail(&wl->tx_queue[skb->queue_mapping], skb); +- if (!wl->tx_queue_stopped[skb->queue_mapping]) { ++ skb_queue_tail(&wl->tx_queue[skb_get_queue_mapping(skb)], skb); ++ if (!wl->tx_queue_stopped[skb_get_queue_mapping(skb)]) { + ieee80211_queue_work(wl->hw, &wl->tx_work); + } else { +- ieee80211_stop_queue(wl->hw, skb->queue_mapping); ++ ieee80211_stop_queue(wl->hw, skb_get_queue_mapping(skb)); + } + } + +--- a/drivers/net/wireless/b43legacy/main.c ++++ b/drivers/net/wireless/b43legacy/main.c +@@ -2504,11 +2504,11 @@ static void b43legacy_op_tx(struct ieee8 + } + B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags); + +- skb_queue_tail(&wl->tx_queue[skb->queue_mapping], skb); +- if (!wl->tx_queue_stopped[skb->queue_mapping]) ++ skb_queue_tail(&wl->tx_queue[skb_get_queue_mapping(skb)], skb); ++ if (!wl->tx_queue_stopped[skb_get_queue_mapping(skb)]) + ieee80211_queue_work(wl->hw, &wl->tx_work); + else +- ieee80211_stop_queue(wl->hw, skb->queue_mapping); ++ ieee80211_stop_queue(wl->hw, skb_get_queue_mapping(skb)); + } + + static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, diff --git a/patches/collateral-evolutions/network/50-libertas-olpc-ec-wakeup.patch b/patches/collateral-evolutions/network/50-libertas-olpc-ec-wakeup.patch new file mode 100644 index 000000000000..5997a7527b5a --- /dev/null +++ b/patches/collateral-evolutions/network/50-libertas-olpc-ec-wakeup.patch @@ -0,0 +1,23 @@ +This section of the libertas driver calls functions that simply don't +exist before the release of 3.1. This code in question was an addition, +not a change from any existing code. It is safe to simply remove it for +older kernels. + +--- a/drivers/net/wireless/libertas/if_usb.c ++++ b/drivers/net/wireless/libertas/if_usb.c +@@ -962,6 +962,7 @@ static int if_usb_suspend(struct usb_int + goto out; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) + #ifdef CONFIG_OLPC + if (machine_is_olpc()) { + if (priv->wol_criteria == EHS_REMOVE_WAKEUP) +@@ -970,6 +971,7 @@ static int if_usb_suspend(struct usb_int + olpc_ec_wakeup_set(EC_SCI_SRC_WLAN); + } + #endif ++#endif + + ret = lbs_suspend(priv); + if (ret) diff --git a/patches/collateral-evolutions/network/52-tty-dev.patch b/patches/collateral-evolutions/network/52-tty-dev.patch new file mode 100644 index 000000000000..659aa6928b4b --- /dev/null +++ b/patches/collateral-evolutions/network/52-tty-dev.patch @@ -0,0 +1,32 @@ + +tty->dev does not exist until 2.6.37. Typically +subsystems will assign the tty device to a child +to make a symlink under /sys/class/foobar. An example +is the bluetooth subsystem. + +commit 7f4b2b04c88377af30c022f36c060190182850fb +Author: Andrei Warkentin +Date: Fri Feb 11 17:19:26 2011 -0600 + + Bluetooth: Make hci a child of the corresponding tty device. + + Make /sys/class/bluetooth/hciX a symlink to + path under corresponding tty. + + Signed-off-by: Andrei Warkentin + Signed-off-by: Gustavo F. Padovan + + +--- a/drivers/bluetooth/hci_ldisc.c ++++ b/drivers/bluetooth/hci_ldisc.c +@@ -421,7 +421,10 @@ static int hci_uart_register_dev(struct + hdev->close = hci_uart_close; + hdev->flush = hci_uart_flush; + hdev->send = hci_uart_send_frame; ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)) + SET_HCIDEV_DEV(hdev, hu->tty->dev); ++#endif + + if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags)) + set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); diff --git a/patches/collateral-evolutions/network/53-pr_fmt.patch b/patches/collateral-evolutions/network/53-pr_fmt.patch new file mode 100644 index 000000000000..9dc8d6446583 --- /dev/null +++ b/patches/collateral-evolutions/network/53-pr_fmt.patch @@ -0,0 +1,820 @@ +This is the correct way to use pr_fmt. This helps avoid +compiler warnings. This is going to be sent upstream. + +--- a/drivers/bcma/bcma_private.h ++++ b/drivers/bcma/bcma_private.h +@@ -1,10 +1,10 @@ + #ifndef LINUX_BCMA_PRIVATE_H_ + #define LINUX_BCMA_PRIVATE_H_ + +-#ifndef pr_fmt ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +-#endif + ++#include + #include + #include + +--- a/drivers/net/ethernet/broadcom/b44.c ++++ b/drivers/net/ethernet/broadcom/b44.c +@@ -10,9 +10,11 @@ + * Distribute under GPL. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/drivers/net/wireless/iwlegacy/3945-mac.c ++++ b/drivers/net/wireless/iwlegacy/3945-mac.c +@@ -27,9 +27,11 @@ + * + *****************************************************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/drivers/net/wireless/iwlegacy/4965-mac.c ++++ b/drivers/net/wireless/iwlegacy/4965-mac.c +@@ -27,9 +27,11 @@ + * + *****************************************************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas/cfg.c ++++ b/drivers/net/wireless/libertas/cfg.c +@@ -6,8 +6,10 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas/if_usb.c ++++ b/drivers/net/wireless/libertas/if_usb.c +@@ -2,8 +2,10 @@ + * This file contains functions used in USB interface module. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas/if_sdio.c ++++ b/drivers/net/wireless/libertas/if_sdio.c +@@ -26,9 +26,11 @@ + * if_sdio_card_to_host() to pad the data. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas/if_spi.c ++++ b/drivers/net/wireless/libertas/if_spi.c +@@ -17,8 +17,10 @@ + * (at your option) any later version. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas/rx.c ++++ b/drivers/net/wireless/libertas/rx.c +@@ -2,8 +2,10 @@ + * This file contains the handling of RX in wlan driver. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas/if_cs.c ++++ b/drivers/net/wireless/libertas/if_cs.c +@@ -21,8 +21,10 @@ + + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas/mesh.c ++++ b/drivers/net/wireless/libertas/mesh.c +@@ -1,5 +1,7 @@ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas/main.c ++++ b/drivers/net/wireless/libertas/main.c +@@ -4,8 +4,10 @@ + * thread etc.. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas_tf/cmd.c ++++ b/drivers/net/wireless/libertas_tf/cmd.c +@@ -7,8 +7,10 @@ + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + */ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas_tf/if_usb.c ++++ b/drivers/net/wireless/libertas_tf/if_usb.c +@@ -9,11 +9,13 @@ + */ + #define DRV_NAME "lbtf_usb" + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "libertas_tf.h" + #include "if_usb.h" + ++#include + #include + #include + #include +--- a/drivers/net/wireless/libertas_tf/main.c ++++ b/drivers/net/wireless/libertas_tf/main.c +@@ -7,8 +7,10 @@ + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + */ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + +--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c ++++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +@@ -14,9 +14,11 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + +--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c ++++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +@@ -15,8 +15,10 @@ + */ + + #define __UNDEF_NO_VERSION__ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c ++++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c +@@ -14,8 +14,10 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmutil/utils.c ++++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c +@@ -14,8 +14,10 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + +--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +@@ -14,8 +14,10 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c +@@ -19,8 +19,10 @@ + * For certain dcmd codes, the dongle interprets string data from the host. + ******************************************************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + +--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +@@ -15,8 +15,10 @@ + */ + /* ****************** SDIO CARD Interface Functions **************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +@@ -14,10 +14,12 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include + #include ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +@@ -14,9 +14,11 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +@@ -15,8 +15,10 @@ + */ + /* ***** SDIO interface chip backplane handle functions ***** */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +@@ -16,9 +16,11 @@ + + /* Toplevel file. Relies on dhd_linux.c to send commands to the dongle. */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +@@ -14,6 +14,7 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +--- a/net/bluetooth/lib.c ++++ b/net/bluetooth/lib.c +@@ -24,9 +24,11 @@ + + /* Bluetooth kernel library. */ + ++#undef pr_fmt + #define pr_fmt(fmt) "Bluetooth: " fmt + + #include ++#include + + #include + +--- a/net/wireless/lib80211.c ++++ b/net/wireless/lib80211.c +@@ -13,8 +13,10 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/net/wireless/reg.c ++++ b/net/wireless/reg.c +@@ -42,9 +42,11 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -4,8 +4,10 @@ + * Copyright 2006-2010 Johannes Berg + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/net/wireless/lib80211_crypt_tkip.c ++++ b/net/wireless/lib80211_crypt_tkip.c +@@ -10,8 +10,10 @@ + * more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c ++++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +@@ -16,8 +16,10 @@ + * File contents: support functions for PCI/PCIe + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + + #include +--- a/drivers/net/wireless/rtlwifi/wifi.h ++++ b/drivers/net/wireless/rtlwifi/wifi.h +@@ -30,8 +30,10 @@ + #ifndef __RTL_WIFI_H__ + #define __RTL_WIFI_H__ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/main.c ++++ b/drivers/net/wireless/ath/main.c +@@ -14,9 +14,11 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + + #include "ath.h" +--- a/drivers/net/wireless/ath/regd.c ++++ b/drivers/net/wireless/ath/regd.c +@@ -14,9 +14,11 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath5k/initvals.c ++++ b/drivers/net/wireless/ath/ath5k/initvals.c +@@ -19,8 +19,11 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "ath5k.h" + #include "reg.h" + #include "debug.h" +--- a/drivers/net/wireless/ath/ath5k/desc.c ++++ b/drivers/net/wireless/ath/ath5k/desc.c +@@ -21,8 +21,11 @@ + Hardware Descriptor Functions + \******************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "ath5k.h" + #include "reg.h" + #include "debug.h" +--- a/drivers/net/wireless/ath/ath5k/dma.c ++++ b/drivers/net/wireless/ath/ath5k/dma.c +@@ -29,8 +29,11 @@ + * status registers (ISR). + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "ath5k.h" + #include "reg.h" + #include "debug.h" +--- a/drivers/net/wireless/ath/ath5k/qcu.c ++++ b/drivers/net/wireless/ath/ath5k/qcu.c +@@ -20,8 +20,11 @@ + Queue Control Unit, DCF Control Unit Functions + \********************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "ath5k.h" + #include "reg.h" + #include "debug.h" +--- a/drivers/net/wireless/ath/ath5k/phy.c ++++ b/drivers/net/wireless/ath/ath5k/phy.c +@@ -22,8 +22,10 @@ + * PHY related functions * + \***********************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath5k/reset.c ++++ b/drivers/net/wireless/ath/ath5k/reset.c +@@ -23,10 +23,12 @@ + Reset function and helpers + \****************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include + ++#include + #include /* To determine if a card is pci-e */ + #include + #include +--- a/drivers/net/wireless/ath/ath5k/attach.c ++++ b/drivers/net/wireless/ath/ath5k/attach.c +@@ -20,8 +20,10 @@ + * Attach/Detach Functions and helpers * + \*************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include "ath5k.h" +--- a/drivers/net/wireless/ath/ath5k/base.c ++++ b/drivers/net/wireless/ath/ath5k/base.c +@@ -40,8 +40,10 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath5k/led.c ++++ b/drivers/net/wireless/ath/ath5k/led.c +@@ -39,8 +39,10 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include "ath5k.h" + +--- a/drivers/net/wireless/ath/ath5k/ani.c ++++ b/drivers/net/wireless/ath/ath5k/ani.c +@@ -14,8 +14,11 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "ath5k.h" + #include "reg.h" + #include "debug.h" +--- a/drivers/net/wireless/ath/ath5k/sysfs.c ++++ b/drivers/net/wireless/ath/ath5k/sysfs.c +@@ -1,5 +1,7 @@ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + +--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c ++++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c +@@ -41,11 +41,14 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include + #include + ++#include ++ + #include "ath5k.h" + #include "base.h" + #include "reg.h" +--- a/drivers/net/wireless/ath/ath5k/pci.c ++++ b/drivers/net/wireless/ath/ath5k/pci.c +@@ -14,8 +14,10 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c ++++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c +@@ -15,8 +15,10 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath6kl/init.c ++++ b/drivers/net/wireless/ath/ath6kl/init.c +@@ -16,8 +16,10 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath6kl/main.c ++++ b/drivers/net/wireless/ath/ath6kl/main.c +@@ -15,8 +15,11 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "core.h" + #include "hif-ops.h" + #include "cfg80211.h" +--- a/drivers/net/wireless/ath/ath6kl/txrx.c ++++ b/drivers/net/wireless/ath/ath6kl/txrx.c +@@ -15,8 +15,11 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "core.h" + #include "debug.h" + #include "htc-ops.h" +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -14,8 +14,10 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath9k/pci.c ++++ b/drivers/net/wireless/ath/ath9k/pci.c +@@ -14,8 +14,10 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath9k/htc_hst.c ++++ b/drivers/net/wireless/ath/ath9k/htc_hst.c +@@ -14,8 +14,11 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "htc.h" + + static int htc_issue_send(struct htc_target *target, struct sk_buff* skb, +--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c ++++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c +@@ -14,8 +14,11 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include ++ + #include "htc.h" + + MODULE_AUTHOR("Atheros Communications"); +--- a/drivers/net/wireless/iwlwifi/dvm/main.c ++++ b/drivers/net/wireless/iwlwifi/dvm/main.c +@@ -27,8 +27,10 @@ + * + *****************************************************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/iwlwifi/pcie/drv.c ++++ b/drivers/net/wireless/iwlwifi/pcie/drv.c +@@ -61,8 +61,10 @@ + * + *****************************************************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +--- a/drivers/net/wireless/ath/ath5k/eeprom.c ++++ b/drivers/net/wireless/ath/ath5k/eeprom.c +@@ -21,8 +21,10 @@ + * EEPROM access functions and helpers * + \*************************************/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + + #include "ath5k.h" +--- a/drivers/net/wireless/ath/ath5k/debug.c ++++ b/drivers/net/wireless/ath/ath5k/debug.c +@@ -58,8 +58,10 @@ + * THE POSSIBILITY OF SUCH DAMAGES. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + diff --git a/patches/collateral-evolutions/network/54-get_ts_info.patch b/patches/collateral-evolutions/network/54-get_ts_info.patch new file mode 100644 index 000000000000..d28b39ba4990 --- /dev/null +++ b/patches/collateral-evolutions/network/54-get_ts_info.patch @@ -0,0 +1,39 @@ +Linux 3.5 will have get_ts_info to support the Precision Time Protocol. + +http://linuxptp.sourceforge.net/ +http://en.wikipedia.org/wiki/Precision_Time_Protocol + +We cannot backport this support given that this introduces +a data structure change on the ethtool_ops. + +commit c8f3a8c31069137fe0100e6920558f1a7487ef3c +Author: Richard Cochran +Date: Tue Apr 3 22:59:17 2012 +0000 + + ethtool: Introduce a method for getting time stamping capabilities. + + This commit adds a new ethtool ioctl that exposes the SO_TIMESTAMPING + capabilities of a network interface. In addition, user space programs + can use this ioctl to discover the PTP Hardware Clock (PHC) device + associated with the interface. + + Since software receive time stamps are handled by the stack, the generic + ethtool code can answer the query correctly in case the MAC or PHY + drivers lack special time stamping features. + + Signed-off-by: Richard Cochran + Reviewed-by: Ben Hutchings + Signed-off-by: David S. Miller + +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -910,7 +910,9 @@ static const struct ethtool_ops usbnet_e + .get_drvinfo = usbnet_get_drvinfo, + .get_msglevel = usbnet_get_msglevel, + .set_msglevel = usbnet_set_msglevel, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .get_ts_info = ethtool_op_get_ts_info, ++#endif + }; + + /*-------------------------------------------------------------------------*/ diff --git a/patches/collateral-evolutions/network/55-iwlwifi-msg-trace-fix.patch b/patches/collateral-evolutions/network/55-iwlwifi-msg-trace-fix.patch new file mode 100644 index 000000000000..6ccb5d19a2fb --- /dev/null +++ b/patches/collateral-evolutions/network/55-iwlwifi-msg-trace-fix.patch @@ -0,0 +1,70 @@ +In recent kernels, %pV will copy the va_list before using it. +This isn't true for all kernels, so copy the va_list for use +by the dev_*() functions, otherwise the kernel will crash if +the message is printed and traced. + +--- a/drivers/net/wireless/iwlwifi/iwl-debug.c ++++ b/drivers/net/wireless/iwlwifi/iwl-debug.c +@@ -75,13 +75,16 @@ void __iwl_ ##fn(struct device *dev, con + struct va_format vaf = { \ + .fmt = fmt, \ + }; \ +- va_list args; \ ++ va_list args1, args2; \ + \ +- va_start(args, fmt); \ +- vaf.va = &args; \ ++ va_start(args1, fmt); \ ++ va_copy(args2, args1); \ ++ vaf.va = &args2; \ + dev_ ##fn(dev, "%pV", &vaf); \ ++ va_end(args2); \ ++ vaf.va = &args1; \ + trace_iwlwifi_ ##fn(&vaf); \ +- va_end(args); \ ++ va_end(args1); \ + } + + __iwl_fn(warn) +@@ -100,13 +103,18 @@ void __iwl_err(struct device *dev, bool + va_list args; + + va_start(args, fmt); +- vaf.va = &args; + if (!trace_only) { ++ va_list args2; ++ ++ va_copy(args2, args); ++ vaf.va = &args2; + if (rfkill_prefix) + dev_err(dev, "(RFKILL) %pV", &vaf); + else + dev_err(dev, "%pV", &vaf); ++ va_end(args2); + } ++ vaf.va = &args; + trace_iwlwifi_err(&vaf); + va_end(args); + } +@@ -123,13 +131,19 @@ void __iwl_dbg(struct device *dev, + va_list args; + + va_start(args, fmt); +- vaf.va = &args; + #ifdef CONFIG_IWLWIFI_DEBUG + if (iwl_have_debug_level(level) && +- (!limit || net_ratelimit())) ++ (!limit || net_ratelimit())) { ++ va_list args2; ++ ++ va_copy(args2, args); ++ vaf.va = &args2; + dev_dbg(dev, "%c %s %pV", in_interrupt() ? 'I' : 'U', + function, &vaf); ++ va_end(args2); ++ } + #endif ++ vaf.va = &args; + trace_iwlwifi_dbg(level, in_interrupt(), function, &vaf); + va_end(args); + } diff --git a/patches/collateral-evolutions/network/56-mac80211-trace-fix.patch b/patches/collateral-evolutions/network/56-mac80211-trace-fix.patch new file mode 100644 index 000000000000..183cec252fe3 --- /dev/null +++ b/patches/collateral-evolutions/network/56-mac80211-trace-fix.patch @@ -0,0 +1,79 @@ +--- a/net/mac80211/trace.c ++++ b/net/mac80211/trace.c +@@ -15,12 +15,16 @@ void __sdata_info(const char *fmt, ...) + struct va_format vaf = { + .fmt = fmt, + }; +- va_list args; ++ va_list args, args2; + + va_start(args, fmt); +- vaf.va = &args; + ++ va_copy(args2, args); ++ vaf.va = &args2; + pr_info("%pV", &vaf); ++ va_end(args2); ++ ++ vaf.va = &args; + trace_mac80211_info(&vaf); + va_end(args); + } +@@ -33,10 +37,16 @@ void __sdata_dbg(bool print, const char + va_list args; + + va_start(args, fmt); +- vaf.va = &args; + +- if (print) ++ if (print) { ++ va_list args2; ++ ++ va_copy(args2, args); ++ vaf.va = &args2; + pr_debug("%pV", &vaf); ++ va_end(args2); ++ } ++ vaf.va = &args; + trace_mac80211_dbg(&vaf); + va_end(args); + } +@@ -46,12 +56,16 @@ void __sdata_err(const char *fmt, ...) + struct va_format vaf = { + .fmt = fmt, + }; +- va_list args; ++ va_list args, args2; + + va_start(args, fmt); +- vaf.va = &args; + ++ va_copy(args2, args); ++ vaf.va = &args2; + pr_err("%pV", &vaf); ++ va_end(args2); ++ ++ vaf.va = &args; + trace_mac80211_err(&vaf); + va_end(args); + } +@@ -64,10 +78,16 @@ void __wiphy_dbg(struct wiphy *wiphy, bo + va_list args; + + va_start(args, fmt); +- vaf.va = &args; + +- if (print) +- wiphy_dbg(wiphy, "%pV", &vaf); ++ if (print) { ++ va_list args2; ++ ++ va_copy(args2, args); ++ vaf.va = &args2; ++ pr_debug("%pV", &vaf); ++ va_end(args2); ++ } ++ vaf.va = &args; + trace_mac80211_dbg(&vaf); + va_end(args); + } diff --git a/patches/collateral-evolutions/network/57-iwlwifi-debug-fix.patch b/patches/collateral-evolutions/network/57-iwlwifi-debug-fix.patch new file mode 100644 index 000000000000..4b2dfa9d26f6 --- /dev/null +++ b/patches/collateral-evolutions/network/57-iwlwifi-debug-fix.patch @@ -0,0 +1,19 @@ +Due to compat including linux/device.h before we do, +we don't get a chance to #define DEBUG to get our +debugging prints. This patch replaces dev_dbg with +dev_printk to make them show up again. + +--- a/drivers/net/wireless/iwlwifi/iwl-debug.c ++++ b/drivers/net/wireless/iwlwifi/iwl-debug.c +@@ -138,8 +138,9 @@ void __iwl_dbg(struct device *dev, + + va_copy(args2, args); + vaf.va = &args2; +- dev_dbg(dev, "%c %s %pV", in_interrupt() ? 'I' : 'U', +- function, &vaf); ++ dev_printk(KERN_DEBUG, dev, "%c %s %pV", ++ in_interrupt() ? 'I' : 'U', ++ function, &vaf); + va_end(args2); + } + #endif diff --git a/patches/collateral-evolutions/network/61-netdev-addr_assign_type.patch b/patches/collateral-evolutions/network/61-netdev-addr_assign_type.patch new file mode 100644 index 000000000000..8f8754e47a12 --- /dev/null +++ b/patches/collateral-evolutions/network/61-netdev-addr_assign_type.patch @@ -0,0 +1,53 @@ +You cannot backport assignment of netdev->addr_assign_type +given that its part of the netdev data structure only in future +kernels. + +mcgrof@tux ~/linux-next (git::master)$ git describe --contains c1f79426 +v2.6.36-rc1~571^2~104 + +--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c ++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +@@ -476,7 +476,9 @@ static int atl1c_set_mac_addr(struct net + + memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); + memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + netdev->addr_assign_type &= ~NET_ADDR_RANDOM; ++#endif + + atl1c_hw_set_mac_addr(&adapter->hw, adapter->hw.mac_addr); + +@@ -2569,7 +2571,9 @@ static int __devinit atl1c_probe(struct + } + if (atl1c_read_mac_addr(&adapter->hw)) { + /* got a random MAC address, set NET_ADDR_RANDOM to netdev */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + netdev->addr_assign_type |= NET_ADDR_RANDOM; ++#endif + } + memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len); + memcpy(netdev->perm_addr, adapter->hw.mac_addr, netdev->addr_len); +--- a/drivers/net/ethernet/atheros/atlx/atlx.c ++++ b/drivers/net/ethernet/atheros/atlx/atlx.c +@@ -84,7 +84,9 @@ static int atlx_set_mac(struct net_devic + + memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); + memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + netdev->addr_assign_type &= ~NET_ADDR_RANDOM; ++#endif + + atlx_set_mac_addr(&adapter->hw); + return 0; +--- a/drivers/net/ethernet/atheros/atlx/atl1.c ++++ b/drivers/net/ethernet/atheros/atlx/atl1.c +@@ -3061,7 +3061,9 @@ static int __devinit atl1_probe(struct p + /* copy the MAC address out of the EEPROM */ + if (atl1_read_mac_addr(&adapter->hw)) { + /* mark random mac */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + netdev->addr_assign_type |= NET_ADDR_RANDOM; ++#endif + } + memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len); + diff --git a/patches/collateral-evolutions/network/62-usb_driver_lpm.patch b/patches/collateral-evolutions/network/62-usb_driver_lpm.patch new file mode 100644 index 000000000000..02f18bbd35ce --- /dev/null +++ b/patches/collateral-evolutions/network/62-usb_driver_lpm.patch @@ -0,0 +1,276 @@ +--- a/drivers/bluetooth/ath3k.c ++++ b/drivers/bluetooth/ath3k.c +@@ -453,7 +453,9 @@ static struct usb_driver ath3k_driver = + .probe = ath3k_probe, + .disconnect = ath3k_disconnect, + .id_table = ath3k_table, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(ath3k_driver); +--- a/drivers/bluetooth/bcm203x.c ++++ b/drivers/bluetooth/bcm203x.c +@@ -273,7 +273,9 @@ static struct usb_driver bcm203x_driver + .probe = bcm203x_probe, + .disconnect = bcm203x_disconnect, + .id_table = bcm203x_table, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(bcm203x_driver); +--- a/drivers/bluetooth/bfusb.c ++++ b/drivers/bluetooth/bfusb.c +@@ -745,7 +745,9 @@ static struct usb_driver bfusb_driver = + .probe = bfusb_probe, + .disconnect = bfusb_disconnect, + .id_table = bfusb_table, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(bfusb_driver); +--- a/drivers/bluetooth/bpa10x.c ++++ b/drivers/bluetooth/bpa10x.c +@@ -504,7 +504,9 @@ static struct usb_driver bpa10x_driver = + .probe = bpa10x_probe, + .disconnect = bpa10x_disconnect, + .id_table = bpa10x_table, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(bpa10x_driver); +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -1224,7 +1224,9 @@ static struct usb_driver btusb_driver = + #endif + .id_table = btusb_table, + .supports_autosuspend = 1, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(btusb_driver); +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -716,7 +716,9 @@ static struct usb_driver cdc_driver = { + .resume = usbnet_resume, + .reset_resume = usbnet_resume, + .supports_autosuspend = 1, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(cdc_driver); +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -643,7 +643,9 @@ static struct usb_driver rndis_driver = + .disconnect = usbnet_disconnect, + .suspend = usbnet_suspend, + .resume = usbnet_resume, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(rndis_driver); +--- a/drivers/net/wireless/at76c50x-usb.c ++++ b/drivers/net/wireless/at76c50x-usb.c +@@ -2453,7 +2453,9 @@ static struct usb_driver at76_driver = { + .probe = at76_probe, + .disconnect = at76_disconnect, + .id_table = dev_table, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + static int __init at76_mod_init(void) +--- a/drivers/net/wireless/ath/ath6kl/usb.c ++++ b/drivers/net/wireless/ath/ath6kl/usb.c +@@ -1201,7 +1201,9 @@ static struct usb_driver ath6kl_usb_driv + .disconnect = ath6kl_usb_remove, + .id_table = ath6kl_usb_ids, + .supports_autosuspend = true, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + static int ath6kl_usb_init(void) +--- a/drivers/net/wireless/ath/ath9k/hif_usb.c ++++ b/drivers/net/wireless/ath/ath9k/hif_usb.c +@@ -1373,7 +1373,9 @@ static struct usb_driver ath9k_hif_usb_d + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + .soft_unbind = 1, + #endif ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + int ath9k_hif_usb_init(void) +--- a/drivers/net/wireless/ath/carl9170/usb.c ++++ b/drivers/net/wireless/ath/carl9170/usb.c +@@ -1166,7 +1166,9 @@ static struct usb_driver carl9170_driver + .resume = carl9170_usb_resume, + .reset_resume = carl9170_usb_resume, + #endif /* CONFIG_PM */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(carl9170_driver); +--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c +@@ -1502,7 +1502,9 @@ static struct usb_driver brcmf_usbdrvr = + .resume = brcmf_usb_resume, + .reset_resume = brcmf_usb_reset_resume, + .supports_autosuspend = 1, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + static void brcmf_release_fw(struct list_head *q) +--- a/drivers/net/wireless/libertas/if_usb.c ++++ b/drivers/net/wireless/libertas/if_usb.c +@@ -1015,7 +1015,9 @@ static struct usb_driver if_usb_driver = + .suspend = if_usb_suspend, + .resume = if_usb_resume, + .reset_resume = if_usb_resume, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(if_usb_driver); +--- a/drivers/net/wireless/libertas_tf/if_usb.c ++++ b/drivers/net/wireless/libertas_tf/if_usb.c +@@ -922,7 +922,9 @@ static struct usb_driver if_usb_driver = + .id_table = if_usb_table, + .suspend = if_usb_suspend, + .resume = if_usb_resume, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(if_usb_driver); +--- a/drivers/net/wireless/orinoco/orinoco_usb.c ++++ b/drivers/net/wireless/orinoco/orinoco_usb.c +@@ -1751,7 +1751,9 @@ static struct usb_driver orinoco_driver + .probe = ezusb_probe, + .disconnect = ezusb_disconnect, + .id_table = ezusb_table, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(orinoco_driver); +--- a/drivers/net/wireless/p54/p54usb.c ++++ b/drivers/net/wireless/p54/p54usb.c +@@ -1142,7 +1142,9 @@ static struct usb_driver p54u_driver = { + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + .soft_unbind = 1, + #endif ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(p54u_driver); +--- a/drivers/net/wireless/rndis_wlan.c ++++ b/drivers/net/wireless/rndis_wlan.c +@@ -3761,7 +3761,9 @@ static struct usb_driver rndis_wlan_driv + .disconnect = usbnet_disconnect, + .suspend = usbnet_suspend, + .resume = usbnet_resume, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(rndis_wlan_driver); +--- a/drivers/net/wireless/rt2x00/rt2500usb.c ++++ b/drivers/net/wireless/rt2x00/rt2500usb.c +@@ -1989,7 +1989,9 @@ static struct usb_driver rt2500usb_drive + .suspend = rt2x00usb_suspend, + .resume = rt2x00usb_resume, + .reset_resume = rt2x00usb_resume, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(rt2500usb_driver); +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -1284,7 +1284,9 @@ static struct usb_driver rt2800usb_drive + .suspend = rt2x00usb_suspend, + .resume = rt2x00usb_resume, + .reset_resume = rt2x00usb_resume, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(rt2800usb_driver); +--- a/drivers/net/wireless/rt2x00/rt73usb.c ++++ b/drivers/net/wireless/rt2x00/rt73usb.c +@@ -2536,7 +2536,9 @@ static struct usb_driver rt73usb_driver + .suspend = rt2x00usb_suspend, + .resume = rt2x00usb_resume, + .reset_resume = rt2x00usb_resume, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(rt73usb_driver); +--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c ++++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c +@@ -1673,7 +1673,9 @@ static struct usb_driver rtl8187_driver + .id_table = rtl8187_table, + .probe = rtl8187_probe, + .disconnect = __devexit_p(rtl8187_disconnect), ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(rtl8187_driver); +--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c ++++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +@@ -377,7 +377,9 @@ static struct usb_driver rtl8192cu_drive + #ifdef CONFIG_AUTOSUSPEND + .supports_autosuspend = 1, + #endif ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + module_usb_driver(rtl8192cu_driver); +--- a/drivers/net/wireless/zd1211rw/zd_usb.c ++++ b/drivers/net/wireless/zd1211rw/zd_usb.c +@@ -1541,7 +1541,9 @@ static struct usb_driver driver = { + .disconnect = disconnect, + .pre_reset = pre_reset, + .post_reset = post_reset, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .disable_hub_initiated_lpm = 1, ++#endif + }; + + struct workqueue_struct *zd_workqueue; diff --git a/patches/collateral-evolutions/network/63-tty-termios.patch b/patches/collateral-evolutions/network/63-tty-termios.patch new file mode 100644 index 000000000000..0841106e5695 --- /dev/null +++ b/patches/collateral-evolutions/network/63-tty-termios.patch @@ -0,0 +1,49 @@ +This patch requires a manual backport: + +commit adc8d746caa67fff4b53ba3e5163a6cbacc3b523 +Author: Alan Cox +Date: Sat Jul 14 15:31:47 2012 +0100 + + tty: move the termios object into the tty + + This will let us sort out a whole pile of tty related races. The + alternative would be to keep points and refcount the termios objects. + However + 1. They are tiny anyway + 2. Many devices don't use the stored copies + 3. We can remove a pty special case + + Signed-off-by: Alan Cox + Signed-off-by: Greg Kroah-Hartman + +We cannot use compat.git for this given that the assignment +was not done through a static inline helper. + +--- a/drivers/bluetooth/hci_ath.c ++++ b/drivers/bluetooth/hci_ath.c +@@ -58,7 +58,11 @@ static int ath_wakeup_ar3k(struct tty_st + return status; + + /* Disable Automatic RTSCTS */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) + ktermios = tty->termios; ++#else ++ memcpy(&ktermios, tty->termios, sizeof(ktermios)); ++#endif + ktermios.c_cflag &= ~CRTSCTS; + tty_set_termios(tty, &ktermios); + +--- a/net/bluetooth/rfcomm/tty.c ++++ b/net/bluetooth/rfcomm/tty.c +@@ -873,7 +873,11 @@ static int rfcomm_tty_ioctl(struct tty_s + + static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old) + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) + struct ktermios *new = &tty->termios; ++#else ++ struct ktermios *new = tty->termios; ++#endif + int old_baud_rate = tty_termios_baud_rate(old); + int new_baud_rate = tty_termios_baud_rate(new); + diff --git a/patches/collateral-evolutions/network/64-b44-32bit-stats.patch b/patches/collateral-evolutions/network/64-b44-32bit-stats.patch new file mode 100644 index 000000000000..b3138f8183fe --- /dev/null +++ b/patches/collateral-evolutions/network/64-b44-32bit-stats.patch @@ -0,0 +1,54 @@ +This patch requires a manual backport: + +commit eeda8585522bcc173f91d6254dfa63e871087c54 +Author: Kevin Groeneveld +Date: Tue Jul 17 17:46:01 2012 +0000 + + b44: add 64 bit stats + + Add support for 64 bit stats to Broadcom b44 ethernet driver. + + Signed-off-by: Kevin Groeneveld + Signed-off-by: Eric Dumazet + Signed-off-by: David S. Miller + +--- a/drivers/net/ethernet/broadcom/b44.c ++++ b/drivers/net/ethernet/broadcom/b44.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -1641,10 +1642,17 @@ static int b44_close(struct net_device * + return 0; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev, + struct rtnl_link_stats64 *nstat) ++#else ++static struct net_device_stats *b44_get_stats(struct net_device *dev) ++#endif + { + struct b44 *bp = netdev_priv(dev); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) ++ struct net_device_stats *nstat = &dev->stats; ++#endif + struct b44_hw_stats *hwstat = &bp->hw_stats; + unsigned int start; + +@@ -2135,7 +2143,11 @@ static const struct net_device_ops b44_n + .ndo_open = b44_open, + .ndo_stop = b44_close, + .ndo_start_xmit = b44_start_xmit, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + .ndo_get_stats64 = b44_get_stats64, ++#else ++ .ndo_get_stats = b44_get_stats, ++#endif + .ndo_set_rx_mode = b44_set_rx_mode, + .ndo_set_mac_address = b44_set_mac_addr, + .ndo_validate_addr = eth_validate_addr, diff --git a/patches/collateral-evolutions/network/65-ignore-dismantle.patch b/patches/collateral-evolutions/network/65-ignore-dismantle.patch new file mode 100644 index 000000000000..fde4ce247534 --- /dev/null +++ b/patches/collateral-evolutions/network/65-ignore-dismantle.patch @@ -0,0 +1,23 @@ +The following patch makes use of the dismantle member in struct +net_device, this patch removes that access on older kernels. + +commit 9d5d496c3464b7ad0ba942b4ada5f27c07e07079 +Author: Daniel Drake +Date: Mon Jul 30 22:58:04 2012 +0100 + + libertas: don't reset card on error when it is being removed + +--- a/drivers/net/wireless/libertas/main.c ++++ b/drivers/net/wireless/libertas/main.c +@@ -592,7 +592,11 @@ static int lbs_thread(void *data) + + /* Reset card, but only when it isn't in the process + * of being shutdown anyway. */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) + if (!dev->dismantle && priv->reset_card) ++#else ++ if (priv->reset_card) ++#endif + priv->reset_card(priv); + } + priv->cmd_timed_out = 0; diff --git a/patches/collateral-evolutions/network/66-uapi-changes.patch b/patches/collateral-evolutions/network/66-uapi-changes.patch new file mode 100644 index 000000000000..362f9bc1bde0 --- /dev/null +++ b/patches/collateral-evolutions/network/66-uapi-changes.patch @@ -0,0 +1,29 @@ +The UAPI changes split up the kernel and userspace API +headers into separate directories. We provide backport +support for the new rfkill module to kernels older than +2.6.31. To allow us to dynamically provide only backport +support for those kernels we have a trick within compat +to provide its own include/linux/rfkill.h header which +then will include either your own kernel's rkfill.h or +include the one we are taking from linux-next. The one +we take from linux-next is renamed to rfkill_backport.h. +In order to allow the call to include your own kernel's +rfkill.h the compat rfkill.h uses include_next. The UAPI +changes would mean though that instead of getting your +own kernel's rfkill.h you'd end up getting the UAPI +header file. Fix this by ensuring that for new kernels +we linux_next into the user's kernels rfkill.h and if +the kernel is old we still to the rfkill_backport.h +naming scheme. + +--- a/include/linux/rfkill_backport.h ++++ b/include/linux/rfkill_backport.h +@@ -18,7 +18,7 @@ + #ifndef __RFKILL_H + #define __RFKILL_H + +-#include ++#include + + /* don't allow anyone to use these in the kernel */ + enum rfkill_user_states { diff --git a/patches/collateral-evolutions/network/67-use_spinlock_t.patch b/patches/collateral-evolutions/network/67-use_spinlock_t.patch new file mode 100644 index 000000000000..4c9f315c3ccd --- /dev/null +++ b/patches/collateral-evolutions/network/67-use_spinlock_t.patch @@ -0,0 +1,11 @@ +--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h ++++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h +@@ -158,7 +158,7 @@ typedef int (*brcmf_fweh_handler_t)(stru + */ + struct brcmf_fweh_info { + struct work_struct event_work; +- struct spinlock evt_q_lock; ++ spinlock_t evt_q_lock; + struct list_head event_q; + int (*evt_handler[BRCMF_E_LAST])(struct brcmf_if *ifp, + const struct brcmf_event_msg *evtmsg, diff --git a/patches/collateral-evolutions/network/99-change-makefiles.patch b/patches/collateral-evolutions/network/99-change-makefiles.patch new file mode 100644 index 000000000000..fc26a78ca0d6 --- /dev/null +++ b/patches/collateral-evolutions/network/99-change-makefiles.patch @@ -0,0 +1,101 @@ + +This patch removes all drivers we do not support +or do not want to support. This lets us build +only the wireless stuff. + +--- a/drivers/misc/eeprom/Makefile ++++ b/drivers/misc/eeprom/Makefile +@@ -1,7 +1 @@ +-obj-$(CONFIG_EEPROM_AT24) += at24.o +-obj-$(CONFIG_EEPROM_AT25) += at25.o +-obj-$(CONFIG_EEPROM_LEGACY) += eeprom.o +-obj-$(CONFIG_EEPROM_MAX6875) += max6875.o + obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o +-obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o +-obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o +--- a/drivers/net/usb/Makefile ++++ b/drivers/net/usb/Makefile +@@ -2,34 +2,7 @@ + # Makefile for USB Network drivers + # + +-obj-$(CONFIG_USB_CATC) += catc.o +-obj-$(CONFIG_USB_KAWETH) += kaweth.o +-obj-$(CONFIG_USB_PEGASUS) += pegasus.o +-obj-$(CONFIG_USB_RTL8150) += rtl8150.o +-obj-$(CONFIG_USB_HSO) += hso.o +-obj-$(CONFIG_USB_NET_AX8817X) += asix.o +-asix-y := asix_devices.o asix_common.o ax88172a.o + obj-$(CONFIG_USB_NET_COMPAT_CDCETHER) += cdc_ether.o +-obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o +-obj-$(CONFIG_USB_NET_DM9601) += dm9601.o +-obj-$(CONFIG_USB_NET_SMSC75XX) += smsc75xx.o +-obj-$(CONFIG_USB_NET_SMSC95XX) += smsc95xx.o +-obj-$(CONFIG_USB_NET_GL620A) += gl620a.o +-obj-$(CONFIG_USB_NET_NET1080) += net1080.o +-obj-$(CONFIG_USB_NET_PLUSB) += plusb.o + obj-$(CONFIG_USB_NET_COMPAT_RNDIS_HOST) += rndis_host.o +-obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o +-obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o +-obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o + obj-$(CONFIG_USB_COMPAT_USBNET) += usbnet.o +-obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o +-obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o +-obj-$(CONFIG_USB_NET_KALMIA) += kalmia.o +-obj-$(CONFIG_USB_IPHETH) += ipheth.o +-obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o +-obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o +-obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o +-obj-$(CONFIG_USB_VL600) += lg-vl600.o +-obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o +-obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o + +--- a/drivers/net/wireless/Makefile ++++ b/drivers/net/wireless/Makefile +@@ -7,18 +7,8 @@ obj-$(CONFIG_IPW2200) += ipw2x00/ + + obj-$(CONFIG_HERMES) += orinoco/ + +-obj-$(CONFIG_AIRO) += airo.o +-obj-$(CONFIG_AIRO_CS) += airo_cs.o airo.o +- +-obj-$(CONFIG_ATMEL) += atmel.o +-obj-$(CONFIG_PCI_ATMEL) += atmel_pci.o +-obj-$(CONFIG_PCMCIA_ATMEL) += atmel_cs.o +- + obj-$(CONFIG_AT76C50X_USB) += at76c50x-usb.o + +-obj-$(CONFIG_PRISM54) += prism54/ +- +-obj-$(CONFIG_HOSTAP) += hostap/ + obj-$(CONFIG_B43) += b43/ + obj-$(CONFIG_B43LEGACY) += b43legacy/ + obj-$(CONFIG_COMPAT_ZD1211RW) += zd1211rw/ +@@ -26,13 +16,8 @@ obj-$(CONFIG_RTL8180) += rtl818x/ + obj-$(CONFIG_RTL8187) += rtl818x/ + obj-$(CONFIG_RTLWIFI) += rtlwifi/ + +-# 16-bit wireless PCMCIA client drivers +-obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o +-obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o +- + obj-$(CONFIG_USB_NET_COMPAT_RNDIS_WLAN) += rndis_wlan.o + +-obj-$(CONFIG_USB_ZD1201) += zd1201.o + obj-$(CONFIG_LIBERTAS) += libertas/ + + obj-$(CONFIG_LIBERTAS_THINFIRM) += libertas_tf/ +--- a/net/wireless/Makefile ++++ b/net/wireless/Makefile +@@ -4,11 +4,6 @@ obj-$(CONFIG_LIB80211_CRYPT_WEP) += lib8 + obj-$(CONFIG_LIB80211_CRYPT_CCMP) += lib80211_crypt_ccmp.o + obj-$(CONFIG_LIB80211_CRYPT_TKIP) += lib80211_crypt_tkip.o + +-obj-$(CONFIG_WEXT_CORE) += wext-core.o +-obj-$(CONFIG_WEXT_PROC) += wext-proc.o +-obj-$(CONFIG_WEXT_SPY) += wext-spy.o +-obj-$(CONFIG_WEXT_PRIV) += wext-priv.o +- + cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o + cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o + cfg80211-$(CONFIG_COMPAT_CFG80211_DRIVER_API_TRACER) += trace.o diff --git a/patches/crap/README b/patches/crap/README new file mode 100644 index 000000000000..ff1ae85c2523 --- /dev/null +++ b/patches/crap/README @@ -0,0 +1,17 @@ + +compat-drivers crap patches +============================ + +If you are including patches into this directory you +must be fixing some critical bug for a customer which needs +immediate release or immediate testing. + +Alternatively you would use this to apply some sort of +crap code you are maintaining. + +You must have a really good reason to be adding files +in this directory. If possible you should explain your +reasoning of why the patch is getting included here and +not upstream and why it hasn't even yet been posted. + +You should avoid these patches at all costs. diff --git a/patches/drm/01-dma_buf_ops-addition.patch b/patches/drm/01-dma_buf_ops-addition.patch deleted file mode 100644 index 3decf0e27eb5..000000000000 --- a/patches/drm/01-dma_buf_ops-addition.patch +++ /dev/null @@ -1,55 +0,0 @@ -Assign vmap, vunmap and mmap fields in dma_buf_ops structs only -if kernel version >= 3.5.0 as they are added in 3.5. The begin_cpu_access -was added as of the original dma-buf code via 3.4. - -mcgrof@frijol ~/linux-next (git::master)$ git describe --contains fc13020e086bfedf2afb95c91c026d5af1f80107 -v3.4-rc1~57^2~3 - -Note that the dma-buf itself was added with 3.4. It is not available -on kernels < 3.4. - ---- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c -+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c -@@ -215,10 +215,14 @@ static const struct dma_buf_ops i915_dma - .kmap_atomic = i915_gem_dmabuf_kmap_atomic, - .kunmap = i915_gem_dmabuf_kunmap, - .kunmap_atomic = i915_gem_dmabuf_kunmap_atomic, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .mmap = i915_gem_dmabuf_mmap, - .vmap = i915_gem_dmabuf_vmap, - .vunmap = i915_gem_dmabuf_vunmap, -+#endif -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - .begin_cpu_access = i915_gem_begin_cpu_access, -+#endif - }; - - struct dma_buf *i915_gem_prime_export(struct drm_device *dev, ---- a/drivers/gpu/drm/nouveau/nouveau_prime.c -+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c -@@ -132,9 +132,11 @@ static const struct dma_buf_ops nouveau_ - .kmap_atomic = nouveau_gem_kmap_atomic, - .kunmap = nouveau_gem_kunmap, - .kunmap_atomic = nouveau_gem_kunmap_atomic, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .mmap = nouveau_gem_prime_mmap, - .vmap = nouveau_gem_prime_vmap, - .vunmap = nouveau_gem_prime_vunmap, -+#endif - }; - - static int ---- a/drivers/gpu/drm/radeon/radeon_prime.c -+++ b/drivers/gpu/drm/radeon/radeon_prime.c -@@ -133,9 +133,11 @@ const static struct dma_buf_ops radeon_d - .kmap_atomic = radeon_gem_kmap_atomic, - .kunmap = radeon_gem_kunmap, - .kunmap_atomic = radeon_gem_kunmap_atomic, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .mmap = radeon_gem_prime_mmap, - .vmap = radeon_gem_prime_vmap, - .vunmap = radeon_gem_prime_vunmap, -+#endif - }; - - static int radeon_prime_create(struct drm_device *dev, diff --git a/patches/drm/02-revert-vm_mmap.patch b/patches/drm/02-revert-vm_mmap.patch deleted file mode 100644 index b96562e600f4..000000000000 --- a/patches/drm/02-revert-vm_mmap.patch +++ /dev/null @@ -1,94 +0,0 @@ -vm_mmap() and vm_munmap() were introduced in kernels >= 3.4.0. Revert -those changes for versions older than that. - -These can't be backported as they rely on non-exported symbols. - ---- a/drivers/gpu/drm/drm_bufs.c -+++ b/drivers/gpu/drm/drm_bufs.c -@@ -1541,6 +1541,20 @@ int drm_mapbufs(struct drm_device *dev, - retcode = -EINVAL; - goto done; - } -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -+ down_write(¤t->mm->mmap_sem); -+ virtual = do_mmap(file_priv->filp, 0, map->size, -+ PROT_READ | PROT_WRITE, -+ MAP_SHARED, -+ token); -+ up_write(¤t->mm->mmap_sem); -+ } else { -+ down_write(¤t->mm->mmap_sem); -+ virtual = do_mmap(file_priv->filp, 0, dma->byte_count, -+ PROT_READ | PROT_WRITE, -+ MAP_SHARED, 0); -+ up_write(¤t->mm->mmap_sem); -+#else - virtual = vm_mmap(file_priv->filp, 0, map->size, - PROT_READ | PROT_WRITE, - MAP_SHARED, -@@ -1549,6 +1563,7 @@ int drm_mapbufs(struct drm_device *dev, - virtual = vm_mmap(file_priv->filp, 0, dma->byte_count, - PROT_READ | PROT_WRITE, - MAP_SHARED, 0); -+#endif - } - if (virtual > -1024UL) { - /* Real error */ ---- a/drivers/gpu/drm/i810/i810_dma.c -+++ b/drivers/gpu/drm/i810/i810_dma.c -@@ -135,9 +135,17 @@ static int i810_map_buffer(struct drm_bu - old_fops = file_priv->filp->f_op; - file_priv->filp->f_op = &i810_buffer_fops; - dev_priv->mmap_buffer = buf; -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -+ down_write(¤t->mm->mmap_sem); -+ buf_priv->virtual = (void *)do_mmap(file_priv->filp, 0, buf->total, -+ PROT_READ | PROT_WRITE, -+ MAP_SHARED, buf->bus_address); -+ up_write(¤t->mm->mmap_sem); -+#else - buf_priv->virtual = (void *)vm_mmap(file_priv->filp, 0, buf->total, - PROT_READ | PROT_WRITE, - MAP_SHARED, buf->bus_address); -+#endif - dev_priv->mmap_buffer = NULL; - file_priv->filp->f_op = old_fops; - if (IS_ERR(buf_priv->virtual)) { -@@ -158,9 +166,15 @@ static int i810_unmap_buffer(struct drm_ - if (buf_priv->currently_mapped != I810_BUF_MAPPED) - return -EINVAL; - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -+ down_write(¤t->mm->mmap_sem); -+ retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual, -+ (size_t) buf->total); -+ up_write(¤t->mm->mmap_sem); -+#else - retcode = vm_munmap((unsigned long)buf_priv->virtual, - (size_t) buf->total); -- -+#endif - buf_priv->currently_mapped = I810_BUF_UNMAPPED; - buf_priv->virtual = NULL; - ---- a/drivers/gpu/drm/i915/i915_gem.c -+++ b/drivers/gpu/drm/i915/i915_gem.c -@@ -1295,10 +1295,17 @@ i915_gem_mmap_ioctl(struct drm_device *d - drm_gem_object_unreference_unlocked(obj); - return -EINVAL; - } -- -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -+ down_write(¤t->mm->mmap_sem); -+ addr = do_mmap(obj->filp, 0, args->size, -+ PROT_READ | PROT_WRITE, MAP_SHARED, -+ args->offset); -+ up_write(¤t->mm->mmap_sem); -+#else - addr = vm_mmap(obj->filp, 0, args->size, - PROT_READ | PROT_WRITE, MAP_SHARED, - args->offset); -+#endif - drm_gem_object_unreference_unlocked(obj); - if (IS_ERR((void *)addr)) - return addr; diff --git a/patches/drm/03-swiotlb.patch b/patches/drm/03-swiotlb.patch deleted file mode 100644 index 697c0634b751..000000000000 --- a/patches/drm/03-swiotlb.patch +++ /dev/null @@ -1,83 +0,0 @@ - -swiotlb_nr_tbl() was available since 3.2 but was exported since 3.3. -Since it uses an internal global state variable, it is impossible -to backport it to compat.git. So revert the changes. - ---- a/drivers/gpu/drm/nouveau/nouveau_bo.c -+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c -@@ -1376,11 +1376,13 @@ nouveau_ttm_tt_populate(struct ttm_tt *t - } - #endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - #ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { - return ttm_dma_populate((void *)ttm, dev->dev); - } - #endif -+#endif - - r = ttm_pool_populate(ttm); - if (r) { -@@ -1426,12 +1428,14 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt - } - #endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - #ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { - ttm_dma_unpopulate((void *)ttm, dev->dev); - return; - } - #endif -+#endif - - for (i = 0; i < ttm->num_pages; i++) { - if (ttm_dma->dma_address[i]) { ---- a/drivers/gpu/drm/radeon/radeon_ttm.c -+++ b/drivers/gpu/drm/radeon/radeon_ttm.c -@@ -601,11 +601,13 @@ static int radeon_ttm_tt_populate(struct - } - #endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - #ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { - return ttm_dma_populate(>t->ttm, rdev->dev); - } - #endif -+#endif - - r = ttm_pool_populate(ttm); - if (r) { -@@ -647,12 +649,14 @@ static void radeon_ttm_tt_unpopulate(str - } - #endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - #ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { - ttm_dma_unpopulate(>t->ttm, rdev->dev); - return; - } - #endif -+#endif - - for (i = 0; i < ttm->num_pages; i++) { - if (gtt->ttm.dma_address[i]) { -@@ -875,6 +879,7 @@ static int radeon_ttm_debugfs_init(struc - radeon_mem_types_list[i].show = &ttm_page_alloc_debugfs; - radeon_mem_types_list[i].driver_features = 0; - radeon_mem_types_list[i++].data = NULL; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - #ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { - sprintf(radeon_mem_types_names[i], "ttm_dma_page_pool"); -@@ -884,6 +889,7 @@ static int radeon_ttm_debugfs_init(struc - radeon_mem_types_list[i++].data = NULL; - } - #endif -+#endif - return radeon_debugfs_add_files(rdev, radeon_mem_types_list, i); - - #endif diff --git a/patches/drm/04-revert-prime-support.patch b/patches/drm/04-revert-prime-support.patch deleted file mode 100644 index e12c396d3044..000000000000 --- a/patches/drm/04-revert-prime-support.patch +++ /dev/null @@ -1,351 +0,0 @@ -Disable PRIME support in core drm, radeon, nouveau and i915 for -kernels < 3.4.0. - -PRIME depends on dma-buf which is added to the kernel with 3.3 but -the one in 3.3 is mostly stub, e.g. it is a skeleton API which -is highly modified in 3.4. So disable PRIME for kernels < 3.4.0, -not < 3.3.0. - ---- a/drivers/gpu/drm/drm_drv.c -+++ b/drivers/gpu/drm/drm_drv.c -@@ -137,8 +137,10 @@ static struct drm_ioctl_desc drm_ioctls[ - - DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETRESOURCES, drm_mode_getresources, DRM_CONTROL_ALLOW|DRM_UNLOCKED), - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - DRM_IOCTL_DEF(DRM_IOCTL_PRIME_HANDLE_TO_FD, drm_prime_handle_to_fd_ioctl, DRM_AUTH|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_PRIME_FD_TO_HANDLE, drm_prime_fd_to_handle_ioctl, DRM_AUTH|DRM_UNLOCKED), -+#endif - - DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPLANERESOURCES, drm_mode_getplane_res, DRM_CONTROL_ALLOW|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCRTC, drm_mode_getcrtc, DRM_CONTROL_ALLOW|DRM_UNLOCKED), ---- a/drivers/gpu/drm/drm_fops.c -+++ b/drivers/gpu/drm/drm_fops.c -@@ -283,8 +283,10 @@ static int drm_open_helper(struct inode - if (dev->driver->driver_features & DRIVER_GEM) - drm_gem_open(dev, priv); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - if (drm_core_check_feature(dev, DRIVER_PRIME)) - drm_prime_init_file_private(&priv->prime); -+#endif - - if (dev->driver->open) { - ret = dev->driver->open(dev, priv); -@@ -537,8 +539,10 @@ int drm_release(struct inode *inode, str - if (dev->driver->postclose) - dev->driver->postclose(dev, file_priv); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - if (drm_core_check_feature(dev, DRIVER_PRIME)) - drm_prime_destroy_file_private(&file_priv->prime); -+#endif - - put_pid(file_priv->pid); - kfree(file_priv); ---- a/drivers/gpu/drm/drm_gem.c -+++ b/drivers/gpu/drm/drm_gem.c -@@ -35,7 +35,9 @@ - #include - #include - #include -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - #include -+#endif - #include - - /** @file drm_gem.c -@@ -204,6 +206,7 @@ EXPORT_SYMBOL(drm_gem_object_alloc); - static void - drm_gem_remove_prime_handles(struct drm_gem_object *obj, struct drm_file *filp) - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - if (obj->import_attach) { - drm_prime_remove_imported_buf_handle(&filp->prime, - obj->import_attach->dmabuf); -@@ -212,6 +215,7 @@ drm_gem_remove_prime_handles(struct drm_ - drm_prime_remove_imported_buf_handle(&filp->prime, - obj->export_dma_buf); - } -+#endif - } - - /** ---- a/drivers/gpu/drm/drm_prime.c -+++ b/drivers/gpu/drm/drm_prime.c -@@ -26,6 +26,8 @@ - * - */ - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -+ - #include - #include - #include -@@ -350,3 +352,4 @@ void drm_prime_remove_imported_buf_handl - mutex_unlock(&prime_fpriv->lock); - } - EXPORT_SYMBOL(drm_prime_remove_imported_buf_handle); -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ ---- a/drivers/gpu/drm/nouveau/nouveau_prime.c -+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c -@@ -24,6 +24,7 @@ - - #include - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - #include - - #include "nouveau_drm.h" -@@ -228,4 +229,4 @@ fail_detach: - dma_buf_detach(dma_buf, attach); - return ERR_PTR(ret); - } -- -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ ---- a/drivers/gpu/drm/radeon/radeon_prime.c -+++ b/drivers/gpu/drm/radeon/radeon_prime.c -@@ -23,6 +23,7 @@ - * - * Authors: Alex Deucher - */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - #include - - #include "radeon.h" -@@ -225,3 +226,4 @@ fail_detach: - dma_buf_detach(dma_buf, attach); - return ERR_PTR(ret); - } -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ ---- a/drivers/gpu/drm/radeon/radeon_drv.c -+++ b/drivers/gpu/drm/radeon/radeon_drv.c -@@ -354,8 +354,10 @@ static const struct file_operations rade - static struct drm_driver kms_driver = { - .driver_features = - DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | -- DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_GEM | -- DRIVER_PRIME, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -+ DRIVER_PRIME | -+#endif -+ DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_GEM, - .dev_priv_size = 0, - .load = radeon_driver_load_kms, - .firstopen = radeon_driver_firstopen_kms, -@@ -390,10 +392,12 @@ static struct drm_driver kms_driver = { - .dumb_destroy = radeon_mode_dumb_destroy, - .fops = &radeon_driver_kms_fops, - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_export = radeon_gem_prime_export, - .gem_prime_import = radeon_gem_prime_import, -+#endif - - .name = DRIVER_NAME, - .desc = DRIVER_DESC, ---- a/drivers/gpu/drm/radeon/radeon_gem.c -+++ b/drivers/gpu/drm/radeon/radeon_gem.c -@@ -41,8 +41,10 @@ void radeon_gem_object_free(struct drm_g - struct radeon_bo *robj = gem_to_radeon_bo(gobj); - - if (robj) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - if (robj->gem_base.import_attach) - drm_prime_gem_destroy(&robj->gem_base, robj->tbo.sg); -+#endif - radeon_bo_unref(&robj); - } - } ---- a/drivers/gpu/drm/radeon/radeon_ttm.c -+++ b/drivers/gpu/drm/radeon/radeon_ttm.c -@@ -582,17 +582,21 @@ static int radeon_ttm_tt_populate(struct - struct radeon_ttm_tt *gtt = (void *)ttm; - unsigned i; - int r; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); -+#endif - - if (ttm->state != tt_unpopulated) - return 0; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - if (slave && ttm->sg) { - drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages, - gtt->ttm.dma_address, ttm->num_pages); - ttm->state = tt_unbound; - return 0; - } -+#endif - - rdev = radeon_get_rdev(ttm->bdev); - #if __OS_HAS_AGP -@@ -636,10 +640,12 @@ static void radeon_ttm_tt_unpopulate(str - struct radeon_device *rdev; - struct radeon_ttm_tt *gtt = (void *)ttm; - unsigned i; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); - - if (slave) - return; -+#endif - - rdev = radeon_get_rdev(ttm->bdev); - #if __OS_HAS_AGP ---- a/drivers/gpu/drm/nouveau/nouveau_bo.c -+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c -@@ -1354,11 +1354,14 @@ nouveau_ttm_tt_populate(struct ttm_tt *t - struct drm_device *dev; - unsigned i; - int r; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); -+#endif - - if (ttm->state != tt_unpopulated) - return 0; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - if (slave && ttm->sg) { - /* make userspace faulting work */ - drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages, -@@ -1366,6 +1369,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *t - ttm->state = tt_unbound; - return 0; - } -+#endif - - drm = nouveau_bdev(ttm->bdev); - dev = drm->dev; -@@ -1413,10 +1417,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt - struct nouveau_drm *drm; - struct drm_device *dev; - unsigned i; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); - - if (slave) - return; -+#endif - - drm = nouveau_bdev(ttm->bdev); - dev = drm->dev; ---- a/drivers/gpu/drm/nouveau/nouveau_drm.c -+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c -@@ -591,7 +591,10 @@ driver = { - .driver_features = - DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG | - DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | -- DRIVER_MODESET | DRIVER_PRIME, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -+ DRIVER_PRIME | -+#endif -+ DRIVER_MODESET, - - .load = nouveau_drm_load, - .unload = nouveau_drm_unload, -@@ -612,10 +615,12 @@ driver = { - .ioctls = nouveau_ioctls, - .fops = &nouveau_driver_fops, - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_export = nouveau_gem_prime_export, - .gem_prime_import = nouveau_gem_prime_import, -+#endif - - .gem_init_object = nouveau_gem_object_new, - .gem_free_object = nouveau_gem_object_del, ---- a/drivers/gpu/drm/nouveau/nouveau_gem.c -+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c -@@ -24,7 +24,9 @@ - * - */ - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - #include -+#endif - - #include - -@@ -57,8 +59,10 @@ nouveau_gem_object_del(struct drm_gem_ob - nouveau_bo_unpin(nvbo); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - if (gem->import_attach) - drm_prime_gem_destroy(gem, nvbo->bo.sg); -+#endif - - ttm_bo_unref(&bo); - ---- a/drivers/gpu/drm/i915/i915_drv.c -+++ b/drivers/gpu/drm/i915/i915_drv.c -@@ -1018,7 +1018,11 @@ static struct drm_driver driver = { - */ - .driver_features = - DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | /* DRIVER_USE_MTRR |*/ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME, -+#else -+ DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM, -+#endif - .load = i915_driver_load, - .unload = i915_driver_unload, - .open = i915_driver_open, -@@ -1041,10 +1045,12 @@ static struct drm_driver driver = { - .gem_free_object = i915_gem_free_object, - .gem_vm_ops = &i915_gem_vm_ops, - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_export = i915_gem_prime_export, - .gem_prime_import = i915_gem_prime_import, -+#endif - - .dumb_create = i915_gem_dumb_create, - .dumb_map_offset = i915_gem_mmap_gtt, ---- a/drivers/gpu/drm/i915/i915_gem.c -+++ b/drivers/gpu/drm/i915/i915_gem.c -@@ -34,7 +34,9 @@ - #include - #include - #include -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - #include -+#endif - - static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj); - static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj); -@@ -3778,8 +3780,10 @@ void i915_gem_free_object(struct drm_gem - - BUG_ON(obj->pages); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - if (obj->base.import_attach) - drm_prime_gem_destroy(&obj->base, NULL); -+#endif - - drm_gem_object_release(&obj->base); - i915_gem_info_remove_obj(dev_priv, obj->base.size); ---- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c -+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c -@@ -23,6 +23,7 @@ - * Authors: - * Dave Airlie - */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - #include - #include "i915_drv.h" - #include -@@ -302,3 +303,4 @@ fail_detach: - dma_buf_detach(dma_buf, attach); - return ERR_PTR(ret); - } -+#endif diff --git a/patches/drm/05-i915-define-acpi-video-class.patch b/patches/drm/05-i915-define-acpi-video-class.patch deleted file mode 100644 index cf7eb389c766..000000000000 --- a/patches/drm/05-i915-define-acpi-video-class.patch +++ /dev/null @@ -1,16 +0,0 @@ -The definition of ACPI_VIDEO_CLASS was moved from video.c -to video.h in 3.1. Define it here to fix build for kernels older -than 3.1. - ---- a/drivers/gpu/drm/i915/intel_opregion.c -+++ b/drivers/gpu/drm/i915/intel_opregion.c -@@ -307,6 +307,9 @@ static int intel_opregion_video_event(st - struct acpi_bus_event *event = data; - int ret = NOTIFY_OK; - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) -+#define ACPI_VIDEO_CLASS "video" -+#endif - if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0) - return NOTIFY_DONE; - diff --git a/patches/drm/06-rename-config-options.patch b/patches/drm/06-rename-config-options.patch deleted file mode 100644 index 9ad2f89b4220..000000000000 --- a/patches/drm/06-rename-config-options.patch +++ /dev/null @@ -1,218 +0,0 @@ ---- a/drivers/gpu/drm/Makefile -+++ b/drivers/gpu/drm/Makefile -@@ -15,39 +15,39 @@ drm-y := drm_auth.o drm_buffer.o d - drm_trace_points.o drm_global.o drm_prime.o - - drm-$(CONFIG_COMPAT) += drm_ioc32.o --drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o -+drm-$(CONFIG_COMPAT_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o - drm-$(CONFIG_PCI) += ati_pcigart.o - - drm-usb-y := drm_usb.o - - drm_kms_helper-y := drm_fb_helper.o drm_crtc_helper.o drm_dp_helper.o --drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o --drm_kms_helper-$(CONFIG_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o -+drm_kms_helper-$(CONFIG_COMPAT_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o -+drm_kms_helper-$(CONFIG_COMPAT_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o - --obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o -+obj-$(CONFIG_COMPAT_DRM_KMS_HELPER) += drm_kms_helper.o - - CFLAGS_drm_trace_points.o := -I$(src) - --obj-$(CONFIG_DRM) += drm.o --obj-$(CONFIG_DRM_USB) += drm_usb.o --obj-$(CONFIG_DRM_TTM) += ttm/ --obj-$(CONFIG_DRM_TDFX) += tdfx/ --obj-$(CONFIG_DRM_R128) += r128/ --obj-$(CONFIG_DRM_RADEON)+= radeon/ --obj-$(CONFIG_DRM_MGA) += mga/ --obj-$(CONFIG_DRM_I810) += i810/ --obj-$(CONFIG_DRM_I915) += i915/ --obj-$(CONFIG_DRM_MGAG200) += mgag200/ --obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus/ --obj-$(CONFIG_DRM_SIS) += sis/ --obj-$(CONFIG_DRM_SAVAGE)+= savage/ --obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/ --obj-$(CONFIG_DRM_VIA) +=via/ --obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/ --obj-$(CONFIG_DRM_EXYNOS) +=exynos/ --obj-$(CONFIG_DRM_GMA500) += gma500/ --obj-$(CONFIG_DRM_UDL) += udl/ --obj-$(CONFIG_DRM_AST) += ast/ --obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/ --obj-$(CONFIG_DRM_TEGRA) += tegra/ -+obj-$(CONFIG_COMPAT_DRM) += drm.o -+obj-$(CONFIG_COMPAT_DRM_USB) += drm_usb.o -+obj-$(CONFIG_COMPAT_DRM_TTM) += ttm/ -+obj-$(CONFIG_COMPAT_DRM_TDFX) += tdfx/ -+obj-$(CONFIG_COMPAT_DRM_R128) += r128/ -+obj-$(CONFIG_COMPAT_DRM_RADEON)+= radeon/ -+obj-$(CONFIG_COMPAT_DRM_MGA) += mga/ -+obj-$(CONFIG_COMPAT_DRM_I810) += i810/ -+obj-$(CONFIG_COMPAT_DRM_I915) += i915/ -+obj-$(CONFIG_COMPAT_DRM_MGAG200) += mgag200/ -+obj-$(CONFIG_COMPAT_DRM_CIRRUS_QEMU) += cirrus/ -+obj-$(CONFIG_COMPAT_DRM_SIS) += sis/ -+obj-$(CONFIG_COMPAT_DRM_SAVAGE)+= savage/ -+obj-$(CONFIG_COMPAT_DRM_VMWGFX)+= vmwgfx/ -+obj-$(CONFIG_COMPAT_DRM_VIA) +=via/ -+obj-$(CONFIG_COMPAT_DRM_NOUVEAU) +=nouveau/ -+obj-$(CONFIG_COMPAT_DRM_EXYNOS) +=exynos/ -+obj-$(CONFIG_COMPAT_DRM_GMA500) += gma500/ -+obj-$(CONFIG_COMPAT_DRM_UDL) += udl/ -+obj-$(CONFIG_COMPAT_DRM_AST) += ast/ -+obj-$(CONFIG_COMPAT_DRM_SHMOBILE) +=shmobile/ -+obj-$(CONFIG_COMPAT_DRM_TEGRA) += tegra/ - obj-y += i2c/ ---- a/drivers/gpu/drm/ast/Makefile -+++ b/drivers/gpu/drm/ast/Makefile -@@ -6,4 +6,4 @@ ccflags-y := -Iinclude/drm - - ast-y := ast_drv.o ast_main.o ast_mode.o ast_fb.o ast_ttm.o ast_post.o - --obj-$(CONFIG_DRM_AST) := ast.o -\ No newline at end of file -+obj-$(CONFIG_COMPAT_DRM_AST) := ast.o ---- a/drivers/gpu/drm/cirrus/Makefile -+++ b/drivers/gpu/drm/cirrus/Makefile -@@ -2,4 +2,4 @@ ccflags-y := -Iinclude/drm - cirrus-y := cirrus_main.o cirrus_mode.o \ - cirrus_drv.o cirrus_fbdev.o cirrus_ttm.o - --obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus.o -+obj-$(CONFIG_COMPAT_DRM_CIRRUS_QEMU) += cirrus.o ---- a/drivers/gpu/drm/drm_crtc_helper.c -+++ b/drivers/gpu/drm/drm_crtc_helper.c -@@ -152,7 +152,7 @@ int drm_helper_probe_single_connector_mo - goto prune; - } - --#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE -+#ifdef CONFIG_COMPAT_DRM_LOAD_EDID_FIRMWARE - count = drm_load_edid_firmware(connector); - if (count == 0) - #endif ---- a/drivers/gpu/drm/gma500/Makefile -+++ b/drivers/gpu/drm/gma500/Makefile -@@ -49,4 +49,4 @@ gma500_gfx-$(CONFIG_DRM_MEDFIELD) += mdf - mdfld_tmd_vid.o \ - tc35876x-dsi-lvds.o - --obj-$(CONFIG_DRM_GMA500) += gma500_gfx.o -+obj-$(CONFIG_COMPAT_DRM_GMA500) += gma500_gfx.o ---- a/drivers/gpu/drm/i2c/Makefile -+++ b/drivers/gpu/drm/i2c/Makefile -@@ -1,7 +1,7 @@ - ccflags-y := -Iinclude/drm - - ch7006-y := ch7006_drv.o ch7006_mode.o --obj-$(CONFIG_DRM_I2C_CH7006) += ch7006.o -+obj-$(CONFIG_COMPAT_DRM_I2C_CH7006) += ch7006.o - - sil164-y := sil164_drv.o --obj-$(CONFIG_DRM_I2C_SIL164) += sil164.o -+obj-$(CONFIG_COMPAT_DRM_I2C_SIL164) += sil164.o ---- a/drivers/gpu/drm/i810/Makefile -+++ b/drivers/gpu/drm/i810/Makefile -@@ -5,4 +5,4 @@ - ccflags-y := -Iinclude/drm - i810-y := i810_drv.o i810_dma.o - --obj-$(CONFIG_DRM_I810) += i810.o -+obj-$(CONFIG_COMPAT_DRM_I810) += i810.o ---- a/drivers/gpu/drm/i915/Makefile -+++ b/drivers/gpu/drm/i915/Makefile -@@ -47,6 +47,6 @@ i915-$(CONFIG_COMPAT) += i915_ioc32.o - - i915-$(CONFIG_ACPI) += intel_acpi.o - --obj-$(CONFIG_DRM_I915) += i915.o -+obj-$(CONFIG_COMPAT_DRM_I915) += i915.o - - CFLAGS_i915_trace_points.o := -I$(src) ---- a/drivers/gpu/drm/mgag200/Makefile -+++ b/drivers/gpu/drm/mgag200/Makefile -@@ -2,4 +2,4 @@ ccflags-y := -Iinclude/drm - mgag200-y := mgag200_main.o mgag200_mode.o \ - mgag200_drv.o mgag200_fb.o mgag200_i2c.o mgag200_ttm.o - --obj-$(CONFIG_DRM_MGAG200) += mgag200.o -+obj-$(CONFIG_COMPAT_DRM_MGAG200) += mgag200.o ---- a/drivers/gpu/drm/nouveau/Makefile -+++ b/drivers/gpu/drm/nouveau/Makefile -@@ -187,6 +187,6 @@ nouveau-y += nouveau_mem.o - # other random bits - nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o - nouveau-$(CONFIG_ACPI) += nouveau_acpi.o --nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o -+nouveau-$(CONFIG_COMPAT_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o - --obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o -+obj-$(CONFIG_COMPAT_DRM_NOUVEAU)+= nouveau.o ---- a/drivers/gpu/drm/nouveau/nouveau_display.h -+++ b/drivers/gpu/drm/nouveau/nouveau_display.h -@@ -76,7 +76,7 @@ int nouveau_display_dumb_destroy(struct - - void nouveau_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *); - --#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT -+#ifdef CONFIG_COMPAT_DRM_NOUVEAU_BACKLIGHT - extern int nouveau_backlight_init(struct drm_device *); - extern void nouveau_backlight_exit(struct drm_device *); - #else ---- a/drivers/gpu/drm/radeon/Makefile -+++ b/drivers/gpu/drm/radeon/Makefile -@@ -78,6 +78,6 @@ radeon-$(CONFIG_COMPAT) += radeon_ioc32. - radeon-$(CONFIG_VGA_SWITCHEROO) += radeon_atpx_handler.o - radeon-$(CONFIG_ACPI) += radeon_acpi.o - --obj-$(CONFIG_DRM_RADEON)+= radeon.o -+obj-$(CONFIG_COMPAT_DRM_RADEON)+= radeon.o - - CFLAGS_radeon_trace_points.o := -I$(src) ---- a/drivers/gpu/drm/radeon/radeon_drv.c -+++ b/drivers/gpu/drm/radeon/radeon_drv.c -@@ -226,7 +226,7 @@ static struct pci_device_id pciidlist[] - radeon_PCI_IDS - }; - --#if defined(CONFIG_DRM_RADEON_KMS) -+#if defined(CONFIG_COMPAT_DRM_RADEON_KMS) - MODULE_DEVICE_TABLE(pci, pciidlist); - #endif - -@@ -440,7 +440,7 @@ static int __init radeon_init(void) - #endif - /* if enabled by default */ - if (radeon_modeset == -1) { --#ifdef CONFIG_DRM_RADEON_KMS -+#ifdef CONFIG_COMPAT_DRM_RADEON_KMS - DRM_INFO("radeon defaulting to kernel modesetting.\n"); - radeon_modeset = 1; - #else ---- a/drivers/gpu/drm/ttm/Makefile -+++ b/drivers/gpu/drm/ttm/Makefile -@@ -11,4 +11,4 @@ ifeq ($(CONFIG_SWIOTLB),y) - ttm-y += ttm_page_alloc_dma.o - endif - --obj-$(CONFIG_DRM_TTM) += ttm.o -+obj-$(CONFIG_COMPAT_DRM_TTM) += ttm.o ---- a/drivers/gpu/drm/via/Makefile -+++ b/drivers/gpu/drm/via/Makefile -@@ -5,4 +5,4 @@ - ccflags-y := -Iinclude/drm - via-y := via_irq.o via_drv.o via_map.o via_mm.o via_dma.o via_verifier.o via_video.o via_dmablit.o - --obj-$(CONFIG_DRM_VIA) +=via.o -+obj-$(CONFIG_COMPAT_DRM_VIA) +=via.o ---- a/drivers/gpu/drm/vmwgfx/Makefile -+++ b/drivers/gpu/drm/vmwgfx/Makefile -@@ -8,4 +8,4 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr. - vmwgfx_fence.o vmwgfx_dmabuf.o vmwgfx_scrn.o vmwgfx_context.o \ - vmwgfx_surface.o - --obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o -+obj-$(CONFIG_COMPAT_DRM_VMWGFX) := vmwgfx.o diff --git a/patches/drm/07-intel-gtt.patch b/patches/drm/07-intel-gtt.patch deleted file mode 100644 index ec026e04b4dd..000000000000 --- a/patches/drm/07-intel-gtt.patch +++ /dev/null @@ -1,42 +0,0 @@ -Kernels older than 3.6 don't have intel_enable_gtt() exported -and most Linux distributions have CONFIG_AGP_INTEL as built-in -(y) and as such we don't bother to make it available as -modular here. The change to export intel_enable_gtt() was -made through commit 8ecd1a66 but previous to this the driver -never called intel_enable_gtt() so we can safely assume we -can do the same for older kernels. - -There should be a way to export an intel_enable_gtt() for -kernels with CONFIG_AGP_INTEL as built-in but that itself -is a project. - -commit 8ecd1a6615f0d9de6759aafe229bc1cc4ee99c7b -Author: Daniel Vetter -Date: Thu Jun 7 15:56:03 2012 +0200 - - drm/i915: call intel_enable_gtt - - When drm/i915 is in control of the gtt, we need to call - the enable function at all the relevant places ourselves. - - Reviewed-by: Jani Nikula - Signed-off-by: Daniel Vetter - ---- a/drivers/gpu/drm/i915/i915_gem.c -+++ b/drivers/gpu/drm/i915/i915_gem.c -@@ -3911,9 +3911,14 @@ i915_gem_init_hw(struct drm_device *dev) - drm_i915_private_t *dev_priv = dev->dev_private; - int ret; - -- if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt()) -+ if (INTEL_INFO(dev)->gen < 6) - return -EIO; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) -+ if (!intel_enable_gtt()) -+ return -EIO; -+#endif -+ - if (IS_HASWELL(dev) && (I915_READ(0x120010) == 1)) - I915_WRITE(0x9008, I915_READ(0x9008) | 0xf0000); - diff --git a/patches/drm/08-shmem_truncate_range.patch b/patches/drm/08-shmem_truncate_range.patch deleted file mode 100644 index 1915593777ed..000000000000 --- a/patches/drm/08-shmem_truncate_range.patch +++ /dev/null @@ -1,44 +0,0 @@ -Backport e2377fe0b -- this could likely be implemented -on compat.git but I'd much prefer a better review of that. -For now this stays as a patch. - -commit e2377fe0b65e3c7577ff6df1701c56ef477d336f -Author: Hugh Dickins -Date: Mon Jun 27 16:18:19 2011 -0700 - - drm/i915: use shmem_truncate_range - - The interface to ->truncate_range is changing very slightly: once "tmpfs: - take control of its truncate_range" has been applied, this can be applied. - For now there is only a slight inefficiency while this remains unapplied, - but it will soon become essential for managing shmem's use of swap. - - Change i915_gem_object_truncate() to use shmem_truncate_range() directly: - which should also spare i915 later change if we switch from - inode_operations->truncate_range to file_operations->fallocate. - - Signed-off-by: Hugh Dickins - Cc: Christoph Hellwig - Cc: Chris Wilson - Cc: Keith Packard - Cc: Dave Airlie - Signed-off-by: Andrew Morton - Signed-off-by: Linus Torvalds - ---- a/drivers/gpu/drm/i915/i915_gem.c -+++ b/drivers/gpu/drm/i915/i915_gem.c -@@ -1650,7 +1650,14 @@ i915_gem_object_truncate(struct drm_i915 - * backing pages, *now*. - */ - inode = obj->base.filp->f_path.dentry->d_inode; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) - shmem_truncate_range(inode, 0, (loff_t)-1); -+#else -+ truncate_inode_pages(inode->i_mapping, 0); -+ if (inode->i_op->truncate_range) -+ inode->i_op->truncate_range(inode, 0, (loff_t)-1); -+#endif -+ - - obj->madv = __I915_MADV_PURGED; - } diff --git a/patches/drm/09-nouveau-compatify-kconfig-vars.patch b/patches/drm/09-nouveau-compatify-kconfig-vars.patch deleted file mode 100644 index ba463657f0fe..000000000000 --- a/patches/drm/09-nouveau-compatify-kconfig-vars.patch +++ /dev/null @@ -1,153 +0,0 @@ -Rename CONFIG_NOUVEAU_DEBUG and CONFIG_NOUVEAU_DEBUG_DEFAULT to -CONFIG_COMPAT_*. - ---- a/drivers/gpu/drm/nouveau/core/core/option.c -+++ b/drivers/gpu/drm/nouveau/core/core/option.c -@@ -86,7 +86,7 @@ nouveau_boolopt(const char *optstr, cons - int - nouveau_dbgopt(const char *optstr, const char *sub) - { -- int mode = 1, level = CONFIG_NOUVEAU_DEBUG_DEFAULT; -+ int mode = 1, level = CONFIG_COMPAT_NOUVEAU_DEBUG_DEFAULT; - - while (optstr) { - int len = strcspn(optstr, ",="); ---- a/drivers/gpu/drm/nouveau/core/include/core/client.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/client.h -@@ -15,7 +15,7 @@ struct nouveau_client { - static inline struct nouveau_client * - nv_client(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!nv_iclass(obj, NV_CLIENT_CLASS))) - nv_assert("BAD CAST -> NvClient, %08x", nv_hclass(obj)); - #endif ---- a/drivers/gpu/drm/nouveau/core/include/core/device.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/device.h -@@ -96,7 +96,7 @@ nv_device(void *obj) - if (device->parent) - device = device->parent; - --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!nv_iclass(device, NV_SUBDEV_CLASS) || - (nv_hclass(device) & 0xff) != NVDEV_SUBDEV_DEVICE)) { - nv_assert("BAD CAST -> NvDevice, 0x%08x 0x%08x", ---- a/drivers/gpu/drm/nouveau/core/include/core/engctx.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/engctx.h -@@ -20,7 +20,7 @@ struct nouveau_engctx { - static inline struct nouveau_engctx * - nv_engctx(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!nv_iclass(obj, NV_ENGCTX_CLASS))) - nv_assert("BAD CAST -> NvEngCtx, %08x", nv_hclass(obj)); - #endif ---- a/drivers/gpu/drm/nouveau/core/include/core/engine.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/engine.h -@@ -22,7 +22,7 @@ struct nouveau_engine { - static inline struct nouveau_engine * - nv_engine(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!nv_iclass(obj, NV_ENGINE_CLASS))) - nv_assert("BAD CAST -> NvEngine, %08x", nv_hclass(obj)); - #endif ---- a/drivers/gpu/drm/nouveau/core/include/core/gpuobj.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/gpuobj.h -@@ -27,7 +27,7 @@ struct nouveau_gpuobj { - static inline struct nouveau_gpuobj * - nv_gpuobj(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!nv_iclass(obj, NV_GPUOBJ_CLASS))) - nv_assert("BAD CAST -> NvGpuObj, %08x", nv_hclass(obj)); - #endif ---- a/drivers/gpu/drm/nouveau/core/include/core/namedb.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/namedb.h -@@ -14,7 +14,7 @@ struct nouveau_namedb { - static inline struct nouveau_namedb * - nv_namedb(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!nv_iclass(obj, NV_NAMEDB_CLASS))) - nv_assert("BAD CAST -> NvNameDB, %08x", nv_hclass(obj)); - #endif ---- a/drivers/gpu/drm/nouveau/core/include/core/object.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/object.h -@@ -20,7 +20,7 @@ struct nouveau_object { - struct nouveau_object *engine; - atomic_t refcount; - atomic_t usecount; --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - #define NOUVEAU_OBJECT_MAGIC 0x75ef0bad - struct list_head list; - u32 _magic; -@@ -30,7 +30,7 @@ struct nouveau_object { - static inline struct nouveau_object * - nv_object(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (likely(obj)) { - struct nouveau_object *object = obj; - if (unlikely(object->_magic != NOUVEAU_OBJECT_MAGIC)) ---- a/drivers/gpu/drm/nouveau/core/include/core/parent.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/parent.h -@@ -29,7 +29,7 @@ struct nouveau_parent { - static inline struct nouveau_parent * - nv_parent(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!(nv_iclass(obj, NV_PARENT_CLASS)))) - nv_assert("BAD CAST -> NvParent, %08x", nv_hclass(obj)); - #endif ---- a/drivers/gpu/drm/nouveau/core/include/core/printk.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/printk.h -@@ -18,7 +18,7 @@ struct nouveau_object; - void nv_printk_(struct nouveau_object *, const char *, int, const char *, ...); - - #define nv_printk(o,l,f,a...) do { \ -- if (NV_DBG_##l <= CONFIG_NOUVEAU_DEBUG) \ -+ if (NV_DBG_##l <= CONFIG_COMPAT_NOUVEAU_DEBUG) \ - nv_printk_(nv_object(o), NV_PRINTK_##l, NV_DBG_##l, f, ##a); \ - } while(0) - -@@ -31,7 +31,7 @@ void nv_printk_(struct nouveau_object *, - #define nv_spam(o,f,a...) nv_printk((o), SPAM, f, ##a) - - #define nv_assert(f,a...) do { \ -- if (NV_DBG_FATAL <= CONFIG_NOUVEAU_DEBUG) \ -+ if (NV_DBG_FATAL <= CONFIG_COMPAT_NOUVEAU_DEBUG) \ - nv_printk_(NULL, NV_PRINTK_FATAL, NV_DBG_FATAL, f "\n", ##a); \ - BUG_ON(1); \ - } while(0) ---- a/drivers/gpu/drm/nouveau/core/include/core/subdev.h -+++ b/drivers/gpu/drm/nouveau/core/include/core/subdev.h -@@ -20,7 +20,7 @@ struct nouveau_subdev { - static inline struct nouveau_subdev * - nv_subdev(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!nv_iclass(obj, NV_SUBDEV_CLASS))) - nv_assert("BAD CAST -> NvSubDev, %08x", nv_hclass(obj)); - #endif ---- a/drivers/gpu/drm/nouveau/core/include/subdev/instmem.h -+++ b/drivers/gpu/drm/nouveau/core/include/subdev/instmem.h -@@ -16,7 +16,7 @@ struct nouveau_instobj { - static inline struct nouveau_instobj * - nv_memobj(void *obj) - { --#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -+#if CONFIG_COMPAT_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - if (unlikely(!nv_iclass(obj, NV_MEMOBJ_CLASS))) - nv_assert("BAD CAST -> NvMemObj, %08x", nv_hclass(obj)); - #endif diff --git a/patches/drm/10-radeon-revert-acpi-table-size-check.patch b/patches/drm/10-radeon-revert-acpi-table-size-check.patch deleted file mode 100644 index 8adaeb3598b3..000000000000 --- a/patches/drm/10-radeon-revert-acpi-table-size-check.patch +++ /dev/null @@ -1,27 +0,0 @@ -acpi_get_table_with_size() was exported with kernels >= 3.6. Revert the -size checking for kernels < 3.6. - ---- a/drivers/gpu/drm/radeon/radeon_bios.c -+++ b/drivers/gpu/drm/radeon/radeon_bios.c -@@ -554,12 +554,21 @@ static bool radeon_acpi_vfct_bios(struct - { - bool ret = false; - struct acpi_table_header *hdr; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) - acpi_size tbl_size; -+#else -+ /* acpi_get_table_with_size() not exported on kernels < 3.6 */ -+ acpi_size tbl_size = 0x7fffffff; -+#endif - UEFI_ACPI_VFCT *vfct; - GOP_VBIOS_CONTENT *vbios; - VFCT_IMAGE_HEADER *vhdr; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) - if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size))) -+#else -+ if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr))) -+#endif - return false; - if (tbl_size < sizeof(UEFI_ACPI_VFCT)) { - DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n"); diff --git a/patches/drm/98-pr_fmt.patch b/patches/drm/98-pr_fmt.patch deleted file mode 100644 index 3c9224504f3d..000000000000 --- a/patches/drm/98-pr_fmt.patch +++ /dev/null @@ -1,189 +0,0 @@ - -Undef/define/include printk.h for fixing redefinition warnings -during build. - -Patch adapted from compat-wireless tree. - ---- a/drivers/gpu/drm/drm_fb_helper.c -+++ b/drivers/gpu/drm/drm_fb_helper.c -@@ -27,9 +27,11 @@ - * Dave Airlie - * Jesse Barnes - */ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/drivers/gpu/drm/ttm/ttm_agp_backend.c -+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c -@@ -29,8 +29,10 @@ - * Keith Packard. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "[TTM] " fmt - -+#include - #include - #include - #include ---- a/drivers/gpu/drm/ttm/ttm_bo.c -+++ b/drivers/gpu/drm/ttm/ttm_bo.c -@@ -28,11 +28,13 @@ - * Authors: Thomas Hellstrom - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "[TTM] " fmt - - #include - #include - #include -+#include - #include - #include - #include ---- a/drivers/gpu/drm/ttm/ttm_bo_vm.c -+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c -@@ -28,8 +28,10 @@ - * Authors: Thomas Hellstrom - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "[TTM] " fmt - -+#include - #include - #include - #include ---- a/drivers/gpu/drm/ttm/ttm_memory.c -+++ b/drivers/gpu/drm/ttm/ttm_memory.c -@@ -25,11 +25,13 @@ - * - **************************************************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) "[TTM] " fmt - - #include - #include - #include -+#include - #include - #include - #include ---- a/drivers/gpu/drm/ttm/ttm_object.c -+++ b/drivers/gpu/drm/ttm/ttm_object.c -@@ -49,10 +49,12 @@ - * for fast lookup of ref objects given a base object. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "[TTM] " fmt - - #include - #include -+#include - #include - #include - #include ---- a/drivers/gpu/drm/ttm/ttm_page_alloc.c -+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c -@@ -31,8 +31,10 @@ - * - doesn't track currently in use pages - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "[TTM] " fmt - -+#include - #include - #include - #include ---- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c -+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c -@@ -33,8 +33,10 @@ - * when freed). - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "[TTM] " fmt - -+#include - #include - #include - #include /* for seq_printf */ ---- a/drivers/gpu/drm/ttm/ttm_tt.c -+++ b/drivers/gpu/drm/ttm/ttm_tt.c -@@ -28,8 +28,10 @@ - * Authors: Thomas Hellstrom - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "[TTM] " fmt - -+#include - #include - #include - #include ---- a/drivers/gpu/drm/i915/i915_dma.c -+++ b/drivers/gpu/drm/i915/i915_dma.c -@@ -26,6 +26,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -@@ -35,6 +36,7 @@ - #include - #include "i915_drv.h" - #include "i915_trace.h" -+#include - #include - #include - #include ---- a/drivers/gpu/drm/i915/i915_irq.c -+++ b/drivers/gpu/drm/i915/i915_irq.c -@@ -26,8 +26,10 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/gpu/drm/i915/intel_opregion.c -+++ b/drivers/gpu/drm/i915/intel_opregion.c -@@ -25,8 +25,10 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/gpu/drm/i915/intel_panel.c -+++ b/drivers/gpu/drm/i915/intel_panel.c -@@ -28,8 +28,10 @@ - * Chris Wilson - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include "intel_drv.h" - diff --git a/patches/drm/99-change-makefile.patch b/patches/drm/99-change-makefile.patch deleted file mode 100644 index ae4280e6aff4..000000000000 --- a/patches/drm/99-change-makefile.patch +++ /dev/null @@ -1,28 +0,0 @@ -Remove drivers that we do not want to build from gpu/drm/Makefile - ---- a/drivers/gpu/drm/Makefile -+++ b/drivers/gpu/drm/Makefile -@@ -31,23 +31,14 @@ CFLAGS_drm_trace_points.o := -I$(src) - obj-$(CONFIG_COMPAT_DRM) += drm.o - obj-$(CONFIG_COMPAT_DRM_USB) += drm_usb.o - obj-$(CONFIG_COMPAT_DRM_TTM) += ttm/ --obj-$(CONFIG_COMPAT_DRM_TDFX) += tdfx/ --obj-$(CONFIG_COMPAT_DRM_R128) += r128/ - obj-$(CONFIG_COMPAT_DRM_RADEON)+= radeon/ --obj-$(CONFIG_COMPAT_DRM_MGA) += mga/ - obj-$(CONFIG_COMPAT_DRM_I810) += i810/ - obj-$(CONFIG_COMPAT_DRM_I915) += i915/ - obj-$(CONFIG_COMPAT_DRM_MGAG200) += mgag200/ - obj-$(CONFIG_COMPAT_DRM_CIRRUS_QEMU) += cirrus/ --obj-$(CONFIG_COMPAT_DRM_SIS) += sis/ --obj-$(CONFIG_COMPAT_DRM_SAVAGE)+= savage/ - obj-$(CONFIG_COMPAT_DRM_VMWGFX)+= vmwgfx/ - obj-$(CONFIG_COMPAT_DRM_VIA) +=via/ - obj-$(CONFIG_COMPAT_DRM_NOUVEAU) +=nouveau/ --obj-$(CONFIG_COMPAT_DRM_EXYNOS) +=exynos/ - obj-$(CONFIG_COMPAT_DRM_GMA500) += gma500/ --obj-$(CONFIG_COMPAT_DRM_UDL) += udl/ - obj-$(CONFIG_COMPAT_DRM_AST) += ast/ --obj-$(CONFIG_COMPAT_DRM_SHMOBILE) +=shmobile/ --obj-$(CONFIG_COMPAT_DRM_TEGRA) += tegra/ - obj-y += i2c/ diff --git a/patches/linux-next-cherry-picks/README b/patches/linux-next-cherry-picks/README new file mode 100644 index 000000000000..101a51ad1a3a --- /dev/null +++ b/patches/linux-next-cherry-picks/README @@ -0,0 +1,20 @@ +compat-drivers linux-next chery picked patches +============================================== + +We work hard to get patches in time onto the stable +tree but sometimes a few things slip out, and sometimes a +stable fix is simply too big in size to be merged into +stable. In such cases though we do believe some of these +patches are still relatively important to either enable new +hardware which escaped the late rc cycles or to correct some +behaviour which might be too late for stable. We apply +these patches by default as they will be supported on these +releases. + +The larger the number of patches you see in this directory +the more we should be ashamed. We should strive to reduce this +to 0 all the time. + +This directory will always be empty for bleeding edge +releases as bleeding edge releases are always based on +linux-next already. diff --git a/patches/linux-next-cherry-picks/network/.gitignore b/patches/linux-next-cherry-picks/network/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/patches/linux-next-pending/README b/patches/linux-next-pending/README new file mode 100644 index 000000000000..092fc5fe6fa2 --- /dev/null +++ b/patches/linux-next-pending/README @@ -0,0 +1,18 @@ + +compat-drivers linux-next-pending patches +========================================== + +You must have a really good reason to be adding files +in this directory. The requirement is your patches must have +been posted to a public mailing list for the subsystem you are +working on. Each patch you add here must have a really good +explanation on the top of the file which clarifies why the +patch has not yet been merged OR specify it on the commit log +when you add it on compat-drivers. + +We try to avoid having patch files because but we understand +if you might because you need to test code posted but not yet +merged into linux-next or a stable kernel release. This can happen +often during the merge window, when the maintainers are unavailable, +on vacation, suck at what they do, or for any other uncontrollable +reasons. diff --git a/patches/linux-next-pending/network/.gitignore b/patches/linux-next-pending/network/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/patches/network/0001-netdev_ops.patch b/patches/network/0001-netdev_ops.patch deleted file mode 100644 index eb0c5a4a6cdf..000000000000 --- a/patches/network/0001-netdev_ops.patch +++ /dev/null @@ -1,279 +0,0 @@ - -This patch backports the struct net_device_ops changes added on 2.6.29. - -If we add the compat.git netdev_attach_ops() implementation -for newer kernels upstream it means we do not have to use this -patch at all for older kernels. - -mcgrof@tux ~/linux-stable (git::master)$ git describe --contains d314774cf2cd5dfeb39a00d37deee65d4c627927 -v2.6.29-rc1~581^2~677 - -commit d314774cf2cd5dfeb39a00d37deee65d4c627927 -Author: Stephen Hemminger -Date: Wed Nov 19 21:32:24 2008 -0800 - - netdev: network device operations infrastructure - - This patch changes the network device internal API to move adminstrative - operations out of the network device structure and into a separate structure. - - This patch involves some hackery to maintain compatablity between the - new and old model, so all 300+ drivers don't have to be changed at once. - For drivers that aren't converted yet, the netdevice_ops virt function list - still resides in the net_device structure. For old protocols, the new - net_device_ops are copied out to the old net_device pointers. - - After the transistion is completed the nag message can be changed to - an WARN_ON, and the compatiablity code can be made configurable. - - Some function pointers aren't moved: - * destructor can't be in net_device_ops because - it may need to be referenced after the module is unloaded. - * neighbor setup is manipulated in a couple of places that need special - consideration - * hard_start_xmit is in the fast path for transmit. - - Signed-off-by: Stephen Hemminger - Signed-off-by: David S. Miller - ---- a/drivers/net/usb/rndis_host.c -+++ b/drivers/net/usb/rndis_host.c -@@ -358,7 +358,7 @@ generic_rndis_bind(struct usbnet *dev, s - dev->rx_urb_size &= ~(dev->maxpacket - 1); - u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); - -- net->netdev_ops = &rndis_netdev_ops; -+ netdev_attach_ops(net, &rndis_netdev_ops); - - retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); - if (unlikely(retval < 0)) { ---- a/drivers/net/usb/usbnet.c -+++ b/drivers/net/usb/usbnet.c -@@ -1422,7 +1422,7 @@ usbnet_probe (struct usb_interface *udev - net->features |= NETIF_F_HIGHDMA; - #endif - -- net->netdev_ops = &usbnet_netdev_ops; -+ netdev_attach_ops(net, &usbnet_netdev_ops); - net->watchdog_timeo = TX_TIMEOUT_JIFFIES; - net->ethtool_ops = &usbnet_ethtool_ops; - ---- a/drivers/net/wireless/ath/ath6kl/main.c -+++ b/drivers/net/wireless/ath/ath6kl/main.c -@@ -1322,7 +1322,7 @@ static const struct net_device_ops ath6k - - void init_netdev(struct net_device *dev) - { -- dev->netdev_ops = &ath6kl_netdev_ops; -+ netdev_attach_ops(dev, &ath6kl_netdev_ops); - dev->destructor = free_netdev; - dev->watchdog_timeo = ATH6KL_TX_TIMEOUT; - ---- a/drivers/net/wireless/rndis_wlan.c -+++ b/drivers/net/wireless/rndis_wlan.c -@@ -3442,7 +3442,7 @@ static int rndis_wlan_bind(struct usbnet - * rndis_host wants to avoid all OID as much as possible - * so do promisc/multicast handling in rndis_wlan. - */ -- usbdev->net->netdev_ops = &rndis_wlan_netdev_ops; -+ netdev_attach_ops(usbdev->net, &rndis_wlan_netdev_ops); - - tmp = cpu_to_le32(RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST); - retval = rndis_set_oid(usbdev, ---- a/drivers/net/ethernet/broadcom/b44.c -+++ b/drivers/net/ethernet/broadcom/b44.c -@@ -2175,7 +2175,7 @@ static int __devinit b44_init_one(struct - bp->rx_pending = B44_DEF_RX_RING_PENDING; - bp->tx_pending = B44_DEF_TX_RING_PENDING; - -- dev->netdev_ops = &b44_netdev_ops; -+ netdev_attach_ops(dev, &b44_netdev_ops); - netif_napi_add(dev, &bp->napi, b44_poll, 64); - dev->watchdog_timeo = B44_TX_TIMEOUT; - dev->irq = sdev->irq; ---- a/drivers/net/wireless/ipw2x00/ipw2100.c -+++ b/drivers/net/wireless/ipw2x00/ipw2100.c -@@ -6103,7 +6103,7 @@ static struct net_device *ipw2100_alloc_ - priv->ieee->perfect_rssi = -20; - priv->ieee->worst_rssi = -85; - -- dev->netdev_ops = &ipw2100_netdev_ops; -+ netdev_attach_ops(dev, &ipw2100_netdev_ops); - dev->ethtool_ops = &ipw2100_ethtool_ops; - dev->wireless_handlers = &ipw2100_wx_handler_def; - priv->wireless_data.libipw = priv->ieee; ---- a/drivers/net/wireless/ipw2x00/ipw2200.c -+++ b/drivers/net/wireless/ipw2x00/ipw2200.c -@@ -11690,7 +11690,7 @@ static int ipw_prom_alloc(struct ipw_pri - memcpy(priv->prom_net_dev->dev_addr, priv->mac_addr, ETH_ALEN); - - priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; -- priv->prom_net_dev->netdev_ops = &ipw_prom_netdev_ops; -+ netdev_attach_ops(priv->prom_net_dev, &ipw_prom_netdev_ops); - - priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR; - SET_NETDEV_DEV(priv->prom_net_dev, &priv->pci_dev->dev); -@@ -11828,7 +11828,7 @@ static int __devinit ipw_pci_probe(struc - priv->ieee->perfect_rssi = -20; - priv->ieee->worst_rssi = -85; - -- net_dev->netdev_ops = &ipw_netdev_ops; -+ netdev_attach_ops(net_dev, &ipw_netdev_ops); - priv->wireless_data.spy_data = &priv->ieee->spy_data; - net_dev->wireless_data = &priv->wireless_data; - net_dev->wireless_handlers = &ipw_wx_handler_def; ---- a/drivers/net/wireless/libertas/main.c -+++ b/drivers/net/wireless/libertas/main.c -@@ -993,7 +993,7 @@ struct lbs_private *lbs_add_card(void *c - wdev->netdev = dev; - priv->dev = dev; - -- dev->netdev_ops = &lbs_netdev_ops; -+ netdev_attach_ops(dev, &lbs_netdev_ops); - dev->watchdog_timeo = 5 * HZ; - dev->ethtool_ops = &lbs_ethtool_ops; - dev->flags |= IFF_BROADCAST | IFF_MULTICAST; ---- a/drivers/net/wireless/libertas/mesh.c -+++ b/drivers/net/wireless/libertas/mesh.c -@@ -1015,7 +1015,7 @@ static int lbs_add_mesh(struct lbs_priva - mesh_dev->ieee80211_ptr = mesh_wdev; - priv->mesh_dev = mesh_dev; - -- mesh_dev->netdev_ops = &mesh_netdev_ops; -+ netdev_attach_ops(mesh_dev, &mesh_netdev_ops); - mesh_dev->ethtool_ops = &lbs_ethtool_ops; - memcpy(mesh_dev->dev_addr, priv->dev->dev_addr, ETH_ALEN); - ---- a/drivers/net/wireless/mac80211_hwsim.c -+++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -1601,7 +1601,7 @@ static const struct net_device_ops hwsim - - static void hwsim_mon_setup(struct net_device *dev) - { -- dev->netdev_ops = &hwsim_netdev_ops; -+ netdev_attach_ops(dev, &hwsim_netdev_ops); - dev->destructor = free_netdev; - ether_setup(dev); - dev->tx_queue_len = 0; ---- a/drivers/net/wireless/mwifiex/main.c -+++ b/drivers/net/wireless/mwifiex/main.c -@@ -645,7 +645,7 @@ static const struct net_device_ops mwifi - void mwifiex_init_priv_params(struct mwifiex_private *priv, - struct net_device *dev) - { -- dev->netdev_ops = &mwifiex_netdev_ops; -+ netdev_attach_ops(dev, &mwifiex_netdev_ops); - /* Initialize private structure */ - priv->current_key_index = 0; - priv->media_connected = false; ---- a/net/bluetooth/bnep/netdev.c -+++ b/net/bluetooth/bnep/netdev.c -@@ -223,7 +223,7 @@ void bnep_net_setup(struct net_device *d - - ether_setup(dev); - dev->priv_flags &= ~IFF_TX_SKB_SHARING; -- dev->netdev_ops = &bnep_netdev_ops; -+ netdev_attach_ops(dev, &bnep_netdev_ops); - - dev->watchdog_timeo = HZ * 2; - } ---- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c -+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c -@@ -2211,7 +2211,7 @@ static int atl1e_init_netdev(struct net_ - SET_NETDEV_DEV(netdev, &pdev->dev); - pci_set_drvdata(pdev, netdev); - -- netdev->netdev_ops = &atl1e_netdev_ops; -+ netdev_attach_ops(netdev, &atl1e_netdev_ops); - - netdev->watchdog_timeo = AT_TX_WATCHDOG; - atl1e_set_ethtool_ops(netdev); ---- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -@@ -2416,7 +2416,7 @@ static int atl1c_init_netdev(struct net_ - SET_NETDEV_DEV(netdev, &pdev->dev); - pci_set_drvdata(pdev, netdev); - -- netdev->netdev_ops = &atl1c_netdev_ops; -+ netdev_attach_ops(netdev, &atl1c_netdev_ops); - netdev->watchdog_timeo = AT_TX_WATCHDOG; - atl1c_set_ethtool_ops(netdev); - ---- a/drivers/net/ethernet/atheros/atlx/atl1.c -+++ b/drivers/net/ethernet/atheros/atlx/atl1.c -@@ -3010,7 +3010,7 @@ static int __devinit atl1_probe(struct p - adapter->mii.phy_id_mask = 0x1f; - adapter->mii.reg_num_mask = 0x1f; - -- netdev->netdev_ops = &atl1_netdev_ops; -+ netdev_attach_ops(netdev, &atl1_netdev_ops); - netdev->watchdog_timeo = 5 * HZ; - netif_napi_add(netdev, &adapter->napi, atl1_rings_clean, 64); - ---- a/drivers/net/ethernet/atheros/atlx/atl2.c -+++ b/drivers/net/ethernet/atheros/atlx/atl2.c -@@ -1400,7 +1400,7 @@ static int __devinit atl2_probe(struct p - - atl2_setup_pcicmd(pdev); - -- netdev->netdev_ops = &atl2_netdev_ops; -+ netdev_attach_ops(netdev, &atl2_netdev_ops); - atl2_set_ethtool_ops(netdev); - netdev->watchdog_timeo = 5 * HZ; - strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1008,7 +1008,7 @@ static void ieee80211_if_setup(struct ne - { - ether_setup(dev); - dev->priv_flags &= ~IFF_TX_SKB_SHARING; -- dev->netdev_ops = &ieee80211_dataif_ops; -+ netdev_attach_ops(dev, &ieee80211_dataif_ops); - dev->destructor = free_netdev; - } - -@@ -1171,7 +1171,7 @@ static void ieee80211_setup_sdata(struct - - /* only monitor/p2p-device differ */ - if (sdata->dev) { -- sdata->dev->netdev_ops = &ieee80211_dataif_ops; -+ netdev_attach_ops(sdata->dev, &ieee80211_dataif_ops); - sdata->dev->type = ARPHRD_ETHER; - } - -@@ -1206,7 +1206,7 @@ static void ieee80211_setup_sdata(struct - break; - case NL80211_IFTYPE_MONITOR: - sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP; -- sdata->dev->netdev_ops = &ieee80211_monitorif_ops; -+ netdev_attach_ops(sdata->dev, &ieee80211_monitorif_ops); - sdata->u.mntr_flags = MONITOR_FLAG_CONTROL | - MONITOR_FLAG_OTHER_BSS; - break; ---- a/drivers/net/wireless/orinoco/main.c -+++ b/drivers/net/wireless/orinoco/main.c -@@ -2278,9 +2278,9 @@ int orinoco_if_add(struct orinoco_privat - #endif - /* Default to standard ops if not set */ - if (ops) -- dev->netdev_ops = ops; -+ netdev_attach_ops(dev, ops); - else -- dev->netdev_ops = &orinoco_netdev_ops; -+ netdev_attach_ops(dev, &orinoco_netdev_ops); - - /* we use the default eth_mac_addr for setting the MAC addr */ - ---- a/net/wireless/wext-core.c -+++ b/net/wireless/wext-core.c -@@ -925,9 +925,7 @@ static int wireless_process_ioctl(struct - return private(dev, iwr, cmd, info, handler); - } - /* Old driver API : call driver ioctl handler */ -- if (dev->netdev_ops->ndo_do_ioctl) -- return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd); -- return -EOPNOTSUPP; -+ return ndo_do_ioctl(dev, ifr, cmd); - } - - /* If command is `set a parameter', or `get the encoding parameters', diff --git a/patches/network/0002-net-misc.patch b/patches/network/0002-net-misc.patch deleted file mode 100644 index b103c01f6b65..000000000000 --- a/patches/network/0002-net-misc.patch +++ /dev/null @@ -1,68 +0,0 @@ -These are things that removed in later kernels but no good explanatin -was provided as to their removal. We should review if this is needed -and if not remove these hunks. - -Pretty sure we can remove the netdev_tx_t hunk change on -net/bluetooth/bnep/netdev.c, removing that hunk just needs to be -compile tested against older kernels. - ---- a/drivers/net/usb/rndis_host.c -+++ b/drivers/net/usb/rndis_host.c -@@ -332,6 +332,11 @@ generic_rndis_bind(struct usbnet *dev, s - u.init->major_version = cpu_to_le32(1); - u.init->minor_version = cpu_to_le32(0); - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) -+ /* can't we remove this? */ -+ net->change_mtu = NULL; -+#endif -+ - /* max transfer (in spec) is 0x4000 at full speed, but for - * TX we'll stick to one Ethernet packet plus RNDIS framing. - * For RX we handle drivers that zero-pad to end-of-packet. ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1009,6 +1009,11 @@ static void ieee80211_if_setup(struct ne - ether_setup(dev); - dev->priv_flags &= ~IFF_TX_SKB_SHARING; - netdev_attach_ops(dev, &ieee80211_dataif_ops); -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) -+ /* Do we need this ? */ -+ /* we will validate the address ourselves in ->open */ -+ dev->validate_addr = NULL; -+#endif - dev->destructor = free_netdev; - } - ---- a/net/bluetooth/bnep/netdev.c -+++ b/net/bluetooth/bnep/netdev.c -@@ -161,8 +161,12 @@ static int bnep_net_proto_filter(struct - } - #endif - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - static netdev_tx_t bnep_net_xmit(struct sk_buff *skb, - struct net_device *dev) -+#else -+static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev) -+#endif - { - struct bnep_session *s = netdev_priv(dev); - struct sock *sk = s->sock->sk; ---- a/drivers/net/wireless/libertas/defs.h -+++ b/drivers/net/wireless/libertas/defs.h -@@ -16,6 +16,14 @@ - #define DRV_NAME "libertas" - #endif - -+/* -+ * Really nasty hack to avoid stuffing compat.diff with tons of ifdefs, -+ * we could add this to a compat header file but too lazy to check ml_priv -+ * is not used anywhere else -+ */ -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) -+#define ml_priv priv -+#endif - - #define LBS_DEB_ENTER 0x00000001 - #define LBS_DEB_LEAVE 0x00000002 diff --git a/patches/network/0003-netdev-needed_headroom_tailroom.patch b/patches/network/0003-netdev-needed_headroom_tailroom.patch deleted file mode 100644 index be60b198f500..000000000000 --- a/patches/network/0003-netdev-needed_headroom_tailroom.patch +++ /dev/null @@ -1,36 +0,0 @@ -This is an optimization introduced on newer kernels, just ignore for -older kernels on mac80211. For others the netdev->hard_header_len -could be used. - ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1493,6 +1493,7 @@ int ieee80211_if_add(struct ieee80211_lo - return -ENOMEM; - dev_net_set(ndev, wiphy_net(local->hw.wiphy)); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) - ndev->needed_headroom = local->tx_headroom + - 4*6 /* four MAC addresses */ - + 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */ -@@ -1501,6 +1502,7 @@ int ieee80211_if_add(struct ieee80211_lo - - ETH_HLEN /* ethernet hard_header_len */ - + IEEE80211_ENCRYPT_HEADROOM; - ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM; -+#endif - - ret = dev_alloc_name(ndev, ndev->name); - if (ret < 0) { ---- a/drivers/net/wireless/orinoco/main.c -+++ b/drivers/net/wireless/orinoco/main.c -@@ -2285,7 +2285,11 @@ int orinoco_if_add(struct orinoco_privat - /* we use the default eth_mac_addr for setting the MAC addr */ - - /* Reserve space in skb for the SNAP header */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) - dev->needed_headroom = ENCAPS_OVERHEAD; -+#else -+ dev->hard_header_len += ENCAPS_OVERHEAD; -+#endif - - netif_carrier_off(dev); - diff --git a/patches/network/0004-wext-namespace.patch b/patches/network/0004-wext-namespace.patch deleted file mode 100644 index 606001b62110..000000000000 --- a/patches/network/0004-wext-namespace.patch +++ /dev/null @@ -1,58 +0,0 @@ - -This patch backports the namespace changes added -through net/wireless/wext.c. - ---- a/net/wireless/wext-core.c -+++ b/net/wireless/wext-core.c -@@ -342,6 +342,7 @@ static const int compat_event_type_size[ - - /* IW event code */ - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) - static int __net_init wext_pernet_init(struct net *net) - { - skb_queue_head_init(&net->wext_nlevents); -@@ -384,6 +385,29 @@ static void wireless_nlevent_process(str - - static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process); - -+#else -+/* Older kernels get the old way of doing stuff*/ -+static struct sk_buff_head wireless_nlevent_queue; -+ -+static int __init wireless_nlevent_init(void) -+{ -+ skb_queue_head_init(&wireless_nlevent_queue); -+ return 0; -+} -+ -+subsys_initcall(wireless_nlevent_init); -+ -+static void wireless_nlevent_process(unsigned long data) -+{ -+ struct sk_buff *skb; -+ while ((skb = skb_dequeue(&wireless_nlevent_queue))) -+ rtnl_notify(skb, &init_net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); -+} -+ -+static DECLARE_TASKLET(wireless_nlevent_tasklet, wireless_nlevent_process, 0); -+ -+#endif -+ - static struct nlmsghdr *rtnetlink_ifinfo_prep(struct net_device *dev, - struct sk_buff *skb) - { -@@ -597,8 +621,13 @@ void wireless_send_event(struct net_devi - - skb_shinfo(skb)->frag_list = compskb; - #endif -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) - skb_queue_tail(&dev_net(dev)->wext_nlevents, skb); - schedule_work(&wireless_nlevent_work); -+#else -+ skb_queue_tail(&wireless_nlevent_queue, skb); -+ tasklet_schedule(&wireless_nlevent_tasklet); -+#endif - } - EXPORT_SYMBOL(wireless_send_event); - diff --git a/patches/network/0005-netlink-portid.patch b/patches/network/0005-netlink-portid.patch deleted file mode 100644 index b7df3f112979..000000000000 --- a/patches/network/0005-netlink-portid.patch +++ /dev/null @@ -1,306 +0,0 @@ -The patch: - -commit 15e473046cb6e5d18a4d0057e61d76315230382b -Author: Eric W. Biederman -Date: Fri Sep 7 20:12:54 2012 +0000 - - netlink: Rename pid to portid to avoid confusion - - It is a frequent mistake to confuse the netlink port identifier with a - process identifier. Try to reduce this confusion by renaming fields - that hold port identifiers portid instead of pid. - - I have carefully avoided changing the structures exported to - userspace to avoid changing the userspace API. - - I have successfully built an allyesconfig kernel with this change. - - Signed-off-by: "Eric W. Biederman" - Acked-by: Stephen Hemminger - Signed-off-by: David S. Miller - -Changed the struct members: - -struct netlink_notify->pid to -struct netlink_notify->portid - -struct genl_info->snd_pid to -struct genl_info->snd_portid - -To help backport this and not have to #ifdef around it against -kernel versions compat has introduced two helpers for us to -simply do the backport with two macro helpers: - -genl_info_snd_portid() -netlink_notify_portid() - -This takes care of the work for us requiring only one -single line change. If we get another patch thrown into -this file then I suspect we can extract SMPL out of it -and use it to backport further collateral evolutions like -this one should other drivers / subsystem need this change. - ---- a/drivers/net/wireless/mac80211_hwsim.c -+++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -1925,10 +1925,10 @@ static int hwsim_register_received_nl(st - if (info == NULL) - goto out; - -- wmediumd_portid = info->snd_portid; -+ wmediumd_portid = genl_info_snd_portid(info); - - printk(KERN_DEBUG "mac80211_hwsim: received a REGISTER, " -- "switching to wmediumd mode with pid %d\n", info->snd_portid); -+ "switching to wmediumd mode with pid %d\n", genl_info_snd_portid(info)); - - return 0; - out: -@@ -1965,7 +1965,7 @@ static int mac80211_hwsim_netlink_notify - if (state != NETLINK_URELEASE) - return NOTIFY_DONE; - -- if (notify->portid == wmediumd_portid) { -+ if (netlink_notify_portid(notify) == wmediumd_portid) { - printk(KERN_INFO "mac80211_hwsim: wmediumd released netlink" - " socket, switching to perfect channel medium\n"); - wmediumd_portid = 0; ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -1282,7 +1282,7 @@ static int nl80211_dump_wiphy(struct sk_ - continue; - if (++idx <= start) - continue; -- if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).portid, -+ if (nl80211_send_wiphy(skb, NETLINK_CB_PORTID(skb), - cb->nlh->nlmsg_seq, NLM_F_MULTI, - dev) < 0) { - idx--; -@@ -1305,7 +1305,7 @@ static int nl80211_get_wiphy(struct sk_b - if (!msg) - return -ENOMEM; - -- if (nl80211_send_wiphy(msg, info->snd_portid, info->snd_seq, 0, dev) < 0) { -+ if (nl80211_send_wiphy(msg, genl_info_snd_portid(info), info->snd_seq, 0, dev) < 0) { - nlmsg_free(msg); - return -ENOBUFS; - } -@@ -1940,7 +1940,7 @@ static int nl80211_dump_interface(struct - if_idx++; - continue; - } -- if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).portid, -+ if (nl80211_send_iface(skb, NETLINK_CB_PORTID(cb->skb), - cb->nlh->nlmsg_seq, NLM_F_MULTI, - rdev, wdev) < 0) { - mutex_unlock(&rdev->devlist_mtx); -@@ -1971,7 +1971,7 @@ static int nl80211_get_interface(struct - if (!msg) - return -ENOMEM; - -- if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, -+ if (nl80211_send_iface(msg, genl_info_snd_portid(info), info->snd_seq, 0, - dev, wdev) < 0) { - nlmsg_free(msg); - return -ENOBUFS; -@@ -2189,7 +2189,7 @@ static int nl80211_new_interface(struct - break; - } - -- if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, -+ if (nl80211_send_iface(msg, genl_info_snd_portid(info), info->snd_seq, 0, - rdev, wdev) < 0) { - nlmsg_free(msg); - return -ENOBUFS; -@@ -2324,7 +2324,7 @@ static int nl80211_get_key(struct sk_buf - if (!msg) - return -ENOMEM; - -- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, -+ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, - NL80211_CMD_NEW_KEY); - if (IS_ERR(hdr)) - return PTR_ERR(hdr); -@@ -3100,7 +3100,7 @@ static int nl80211_dump_station(struct s - goto out_err; - - if (nl80211_send_station(skb, -- NETLINK_CB(cb->skb).portid, -+ NETLINK_CB_PORTID(cb->skb), - cb->nlh->nlmsg_seq, NLM_F_MULTI, - dev, netdev, mac_addr, - &sinfo) < 0) -@@ -3146,7 +3146,7 @@ static int nl80211_get_station(struct sk - if (!msg) - return -ENOMEM; - -- if (nl80211_send_station(msg, info->snd_portid, info->snd_seq, 0, -+ if (nl80211_send_station(msg, genl_info_snd_portid(info), info->snd_seq, 0, - rdev, dev, mac_addr, &sinfo) < 0) { - nlmsg_free(msg); - return -ENOBUFS; -@@ -3562,7 +3562,7 @@ static int nl80211_dump_mpath(struct sk_ - if (err) - goto out_err; - -- if (nl80211_send_mpath(skb, NETLINK_CB(cb->skb).portid, -+ if (nl80211_send_mpath(skb, NETLINK_CB_PORTID(cb->skb), - cb->nlh->nlmsg_seq, NLM_F_MULTI, - netdev, dst, next_hop, - &pinfo) < 0) -@@ -3611,7 +3611,7 @@ static int nl80211_get_mpath(struct sk_b - if (!msg) - return -ENOMEM; - -- if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0, -+ if (nl80211_send_mpath(msg, genl_info_snd_portid(info), info->snd_seq, 0, - dev, dst, next_hop, &pinfo) < 0) { - nlmsg_free(msg); - return -ENOBUFS; -@@ -3851,7 +3851,7 @@ static int nl80211_get_mesh_config(struc - msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); - if (!msg) - return -ENOMEM; -- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, -+ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, - NL80211_CMD_GET_MESH_CONFIG); - if (!hdr) - goto out; -@@ -4169,7 +4169,7 @@ static int nl80211_get_reg(struct sk_buf - goto out; - } - -- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, -+ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, - NL80211_CMD_GET_REG); - if (!hdr) - goto put_failure; -@@ -4813,7 +4813,7 @@ static int nl80211_send_bss(struct sk_bu - - ASSERT_WDEV_LOCK(wdev); - -- hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).portid, seq, flags, -+ hdr = nl80211hdr_put(msg, NETLINK_CB_PORTID(cb->skb), seq, flags, - NL80211_CMD_NEW_SCAN_RESULTS); - if (!hdr) - return -1; -@@ -5032,7 +5032,7 @@ static int nl80211_dump_survey(struct sk - } - - if (nl80211_send_survey(skb, -- NETLINK_CB(cb->skb).portid, -+ NETLINK_CB_PORTID(cb->skb), - cb->nlh->nlmsg_seq, NLM_F_MULTI, - netdev, - &survey) < 0) -@@ -5677,7 +5677,7 @@ static int nl80211_testmode_dump(struct - } - - while (1) { -- void *hdr = nl80211hdr_put(skb, NETLINK_CB(cb->skb).portid, -+ void *hdr = nl80211hdr_put(skb, NETLINK_CB_PORTID(cb->skb), - cb->nlh->nlmsg_seq, NLM_F_MULTI, - NL80211_CMD_TESTMODE); - struct nlattr *tmdata; -@@ -5756,7 +5756,7 @@ struct sk_buff *cfg80211_testmode_alloc_ - return NULL; - - return __cfg80211_testmode_alloc_skb(rdev, approxlen, -- rdev->testmode_info->snd_portid, -+ genl_info_snd_portid(rdev->testmode_info), - rdev->testmode_info->snd_seq, - GFP_KERNEL); - } -@@ -6089,7 +6089,7 @@ static int nl80211_remain_on_channel(str - if (!msg) - return -ENOMEM; - -- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, -+ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, - NL80211_CMD_REMAIN_ON_CHANNEL); - - if (IS_ERR(hdr)) { -@@ -6308,7 +6308,7 @@ static int nl80211_register_mgmt(struct - if (!rdev->ops->mgmt_tx) - return -EOPNOTSUPP; - -- return cfg80211_mlme_register_mgmt(wdev, info->snd_portid, frame_type, -+ return cfg80211_mlme_register_mgmt(wdev, genl_info_snd_portid(info), frame_type, - nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]), - nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH])); - } -@@ -6378,7 +6378,7 @@ static int nl80211_tx_mgmt(struct sk_buf - if (!msg) - return -ENOMEM; - -- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, -+ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, - NL80211_CMD_FRAME); - - if (IS_ERR(hdr)) { -@@ -6493,7 +6493,7 @@ static int nl80211_get_power_save(struct - if (!msg) - return -ENOMEM; - -- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, -+ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, - NL80211_CMD_GET_POWER_SAVE); - if (!hdr) { - err = -ENOBUFS; -@@ -6684,7 +6684,7 @@ static int nl80211_get_wowlan(struct sk_ - if (!msg) - return -ENOMEM; - -- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, -+ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, - NL80211_CMD_GET_WOWLAN); - if (!hdr) - goto nla_put_failure; -@@ -6961,7 +6961,7 @@ static int nl80211_register_unexpected_f - if (wdev->ap_unexpected_nlportid) - return -EBUSY; - -- wdev->ap_unexpected_nlportid = info->snd_portid; -+ wdev->ap_unexpected_nlportid = genl_info_snd_portid(info); - return 0; - } - -@@ -6991,7 +6991,7 @@ static int nl80211_probe_client(struct s - if (!msg) - return -ENOMEM; - -- hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, -+ hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0, - NL80211_CMD_PROBE_CLIENT); - - if (IS_ERR(hdr)) { -@@ -7035,13 +7035,13 @@ static int nl80211_register_beacons(stru - /* First, check if already registered. */ - spin_lock_bh(&rdev->beacon_registrations_lock); - list_for_each_entry(reg, &rdev->beacon_registrations, list) { -- if (reg->nlportid == info->snd_portid) { -+ if (reg->nlportid == genl_info_snd_portid(info)) { - rv = -EALREADY; - goto out_err; - } - } - /* Add it to the list */ -- nreg->nlportid = info->snd_portid; -+ nreg->nlportid = genl_info_snd_portid(info); - list_add(&nreg->list, &rdev->beacon_registrations); - - spin_unlock_bh(&rdev->beacon_registrations_lock); -@@ -9169,12 +9169,12 @@ static int nl80211_netlink_notify(struct - - list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) { - list_for_each_entry_rcu(wdev, &rdev->wdev_list, list) -- cfg80211_mlme_unregister_socket(wdev, notify->portid); -+ cfg80211_mlme_unregister_socket(wdev, netlink_notify_portid(notify)); - - spin_lock_bh(&rdev->beacon_registrations_lock); - list_for_each_entry_safe(reg, tmp, &rdev->beacon_registrations, - list) { -- if (reg->nlportid == notify->portid) { -+ if (reg->nlportid == netlink_notify_portid(notify)) { - list_del(®->list); - kfree(reg); - break; diff --git a/patches/network/02-ksize.patch b/patches/network/02-ksize.patch deleted file mode 100644 index b54cb234ac4f..000000000000 --- a/patches/network/02-ksize.patch +++ /dev/null @@ -1,69 +0,0 @@ -ksize() was added as of 2.6.29, it gives you the actual -size of the allocated data. Since we have no support for -this we simply do not optimize for it and deal with -large alloocations for the IEs. - -We technically could backport this as - -define ksize(bleh) SOME_LARGE_NUMBER - -but doing it this way emphasis careful review -of the situation. - ---- a/drivers/net/wireless/orinoco/wext.c -+++ b/drivers/net/wireless/orinoco/wext.c -@@ -31,8 +31,22 @@ static int orinoco_set_key(struct orinoc - enum orinoco_alg alg, const u8 *key, int key_len, - const u8 *seq, int seq_len) - { -+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) -+ int len; -+ if (!unlikely(ZERO_OR_NULL_PTR(priv->keys[index].key))) { -+ len = priv->keys[index].key_len; -+ memset(priv->keys[index].key, 0, len); -+ kfree(priv->keys[index].key); -+ } -+ if (!unlikely(ZERO_OR_NULL_PTR(priv->keys[index].seq))) { -+ len = priv->keys[index].seq_len; -+ memset(priv->keys[index].seq, 0, len); -+ kfree(priv->keys[index].seq); -+ } -+#else - kzfree(priv->keys[index].key); - kzfree(priv->keys[index].seq); -+#endif - - if (key_len) { - priv->keys[index].key = kzalloc(key_len, GFP_ATOMIC); ---- a/net/wireless/scan.c -+++ b/net/wireless/scan.c -@@ -673,9 +673,14 @@ cfg80211_bss_update(struct cfg80211_regi - size_t used = dev->wiphy.bss_priv_size + sizeof(*res); - size_t ielen = res->pub.len_proberesp_ies; - -+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) -+ if (0) { -+ used = 0; /* just to shut up the compiler */ -+#else - if (found->pub.proberesp_ies && - !found->proberesp_ies_allocated && - ksize(found) >= used + ielen) { -+#endif - memcpy(found->pub.proberesp_ies, - res->pub.proberesp_ies, ielen); - found->pub.len_proberesp_ies = ielen; -@@ -709,9 +714,14 @@ cfg80211_bss_update(struct cfg80211_regi - (found->pub.information_elements == - found->pub.beacon_ies); - -+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) -+ if (0) { -+ used = 0; /* just to shut up the compiler */ -+#else - if (found->pub.beacon_ies && - !found->beacon_ies_allocated && - ksize(found) >= used + ielen) { -+#endif - memcpy(found->pub.beacon_ies, - res->pub.beacon_ies, ielen); - found->pub.len_beacon_ies = ielen; diff --git a/patches/network/03-rfkill.patch b/patches/network/03-rfkill.patch deleted file mode 100644 index c19b42e70d47..000000000000 --- a/patches/network/03-rfkill.patch +++ /dev/null @@ -1,66 +0,0 @@ -rfkill was re-implemented on 2.6.31. We port it to -older kernels with a simple hack, just rename the -module as a new one rfkill_backport, and every -exported symbol gets redefined with a _backport -postfix through compat-2.6.31.h. The changes below -are the ones we could not do through compat-2.6.31.h - -Do older kernels have /dev/rfkill ? I not then we can -just keep /dev/rfkill and not /dev/rfkill_backport. - -Note that 2.6.31 added netdevice notifier upon interface -dev_open() which on cfg80211 will check if checks to see -if rfkill is enabled (or if the mode of operation is not -supported) on the cfg80211_netdev_notifier_call() and if -so deny bringing the interface up. This was added via -commit: - -3b8bcfd5d31ea0fec58681d035544ace707d2536 - -Since older kernels will not have the notifier call -on dev_open() if we *really want* to port this we could have -mac80211's subif_open() call : - - ret = call_netdevice_notifiers(NETDEV_PRE_UP, dev); - ret = notifier_to_errno(ret); - if (ret) - return ret; - -This would do the policing from within mac80211. - ---- a/net/rfkill/Makefile -+++ b/net/rfkill/Makefile -@@ -2,8 +2,8 @@ - # Makefile for the RF switch subsystem. - # - --rfkill-y += core.o --rfkill-$(CONFIG_RFKILL_INPUT) += input.o --obj-$(CONFIG_RFKILL) += rfkill.o -+rfkill_backport-y += core.o -+rfkill_backport-$(CONFIG_RFKILL_BACKPORT_INPUT) += input.o -+obj-$(CONFIG_RFKILL_BACKPORT) += rfkill_backport.o - obj-$(CONFIG_RFKILL_REGULATOR) += rfkill-regulator.o - obj-$(CONFIG_RFKILL_GPIO) += rfkill-gpio.o ---- a/net/rfkill/input.c -+++ b/net/rfkill/input.c -@@ -232,7 +232,7 @@ static int rfkill_connect(struct input_h - - handle->dev = dev; - handle->handler = handler; -- handle->name = "rfkill"; -+ handle->name = "rfkill_backport"; - - /* causes rfkill_start() to be called */ - error = input_register_handle(handle); ---- a/net/rfkill/core.c -+++ b/net/rfkill/core.c -@@ -826,7 +826,7 @@ static int rfkill_resume(struct device * - } - - static struct class rfkill_class = { -- .name = "rfkill", -+ .name = "rfkill_backport", - .dev_release = rfkill_release, - .dev_attrs = rfkill_dev_attrs, - .dev_uevent = rfkill_dev_uevent, diff --git a/patches/network/04-netns.patch b/patches/network/04-netns.patch deleted file mode 100644 index 1365b45f90cb..000000000000 --- a/patches/network/04-netns.patch +++ /dev/null @@ -1,149 +0,0 @@ -The only other namespace change. Note that pach 01-netdev.patch -also has some other namespace changes there, look at that file -for the other changes. It'd be nice to figure out a way to -bring thise here cleanly and seprately but they touch the same -files... - ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -5940,7 +5940,9 @@ static int nl80211_wiphy_netns(struct sk - if (!net_eq(wiphy_net(&rdev->wiphy), net)) - err = cfg80211_switch_netns(rdev, net); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - put_net(net); -+#endif - return err; - } - ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -168,6 +168,7 @@ int cfg80211_dev_rename(struct cfg80211_ - return 0; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - int cfg80211_switch_netns(struct cfg80211_registered_device *rdev, - struct net *net) - { -@@ -212,6 +213,7 @@ int cfg80211_switch_netns(struct cfg8021 - - return 0; - } -+#endif - - static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) - { -@@ -344,7 +346,9 @@ struct wiphy *wiphy_new(const struct cfg - rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; - #endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - wiphy_net_set(&rdev->wiphy, &init_net); -+#endif - - rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block; - rdev->rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev), -@@ -843,8 +847,10 @@ static int cfg80211_netdev_notifier_call - wdev->identifier = ++rdev->wdev_id; - list_add_rcu(&wdev->list, &rdev->wdev_list); - rdev->devlist_generation++; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - /* can only change netns with wiphy */ - dev->features |= NETIF_F_NETNS_LOCAL; -+#endif - - if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, - "phy80211")) { -@@ -1035,6 +1041,7 @@ static struct notifier_block cfg80211_ne - .notifier_call = cfg80211_netdev_notifier_call, - }; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - static void __net_exit cfg80211_pernet_exit(struct net *net) - { - struct cfg80211_registered_device *rdev; -@@ -1052,14 +1059,17 @@ static void __net_exit cfg80211_pernet_e - static struct pernet_operations cfg80211_pernet_ops = { - .exit = cfg80211_pernet_exit, - }; -+#endif - - static int __init cfg80211_init(void) - { - int err; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - err = register_pernet_device(&cfg80211_pernet_ops); - if (err) - goto out_fail_pernet; -+#endif - - err = wiphy_sysfs_init(); - if (err) -@@ -1094,8 +1104,10 @@ out_fail_nl80211: - out_fail_notifier: - wiphy_sysfs_exit(); - out_fail_sysfs: -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - unregister_pernet_device(&cfg80211_pernet_ops); - out_fail_pernet: -+#endif - return err; - } - subsys_initcall(cfg80211_init); -@@ -1107,7 +1119,9 @@ static void __exit cfg80211_exit(void) - unregister_netdevice_notifier(&cfg80211_netdev_notifier); - wiphy_sysfs_exit(); - regulatory_exit(); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - unregister_pernet_device(&cfg80211_pernet_ops); -+#endif - destroy_workqueue(cfg80211_wq); - } - module_exit(cfg80211_exit); ---- a/net/wireless/wext-core.c -+++ b/net/wireless/wext-core.c -@@ -367,6 +367,7 @@ static int __init wireless_nlevent_init( - subsys_initcall(wireless_nlevent_init); - - /* Process events generated by the wireless layer or the driver. */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - static void wireless_nlevent_process(struct work_struct *work) - { - struct sk_buff *skb; -@@ -382,6 +383,20 @@ static void wireless_nlevent_process(str - - rtnl_unlock(); - } -+#else -+static void wireless_nlevent_process(struct work_struct *work) -+{ -+ struct sk_buff *skb; -+ struct net *net; -+ -+ rtnl_lock(); -+ -+ while ((skb = skb_dequeue(&net->wext_nlevents))) -+ rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); -+ -+ rtnl_unlock(); -+} -+#endif - - static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process); - ---- a/net/wireless/wext-proc.c -+++ b/net/wireless/wext-proc.c -@@ -98,7 +98,11 @@ static void *wireless_dev_seq_start(stru - return SEQ_START_TOKEN; - - off = 1; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) - for_each_netdev(net, dev) -+#else -+ for_each_netdev(net) -+#endif - if (off++ == *pos) - return dev; - return NULL; diff --git a/patches/network/05-usb.patch b/patches/network/05-usb.patch deleted file mode 100644 index 57471cadecb6..000000000000 --- a/patches/network/05-usb.patch +++ /dev/null @@ -1,26 +0,0 @@ -USB opt soft_unbid was added as of 2.6.27. - ---- a/drivers/net/wireless/p54/p54usb.c -+++ b/drivers/net/wireless/p54/p54usb.c -@@ -1139,7 +1139,9 @@ static struct usb_driver p54u_driver = { - .resume = p54u_resume, - .reset_resume = p54u_resume, - #endif /* CONFIG_PM */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) - .soft_unbind = 1, -+#endif - .disable_hub_initiated_lpm = 1, - }; - ---- a/drivers/net/wireless/ath/ath9k/hif_usb.c -+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c -@@ -1370,7 +1370,9 @@ static struct usb_driver ath9k_hif_usb_d - .reset_resume = ath9k_hif_usb_resume, - #endif - .id_table = ath9k_hif_usb_ids, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) - .soft_unbind = 1, -+#endif - .disable_hub_initiated_lpm = 1, - }; - diff --git a/patches/network/06-header-changes.patch b/patches/network/06-header-changes.patch deleted file mode 100644 index 5da05c0da4d6..000000000000 --- a/patches/network/06-header-changes.patch +++ /dev/null @@ -1,137 +0,0 @@ - -Every kernel release there are a few changes to headers -made. Some code gets shifted around between headers or -new headers are defined. This patch deals with such -cases. - ---- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c -+++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c -@@ -18,6 +18,10 @@ - #include "debug.h" - #include "hif-ops.h" - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) -+#include -+#endif -+ - #define HTC_PACKET_CONTAINER_ALLOCATION 32 - #define HTC_CONTROL_BUFFER_SIZE (HTC_MAX_CTRL_MSG_LEN + HTC_HDR_LENGTH) - ---- a/drivers/net/wireless/b43/phy_common.h -+++ b/drivers/net/wireless/b43/phy_common.h -@@ -3,6 +3,9 @@ - - #include - #include -+#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,28)) -+#include -+#endif - - struct b43_wldev; - ---- a/drivers/net/wireless/rtlwifi/base.c -+++ b/drivers/net/wireless/rtlwifi/base.c -@@ -36,6 +36,7 @@ - #include "regd.h" - - #include -+#include - #include - - /* ---- a/drivers/net/wireless/ti/wl1251/main.c -+++ b/drivers/net/wireless/ti/wl1251/main.c -@@ -24,6 +24,9 @@ - #include - #include - #include -+#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,28)) -+#include -+#endif - #include - #include - #include ---- a/drivers/net/wireless/ti/wl1251/spi.c -+++ b/drivers/net/wireless/ti/wl1251/spi.c -@@ -24,6 +24,9 @@ - #include - #include - #include -+#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,28)) -+#include -+#endif - #include - #include - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -24,6 +24,9 @@ - #include "aes_ccm.h" - #include "aes_cmac.h" - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) -+#include -+#endif - - /** - * DOC: Key handling basics ---- a/net/bluetooth/bnep/sock.c -+++ b/net/bluetooth/bnep/sock.c -@@ -26,6 +26,7 @@ - - #include - #include -+#include - - #include "bnep.h" - ---- a/net/bluetooth/hci_sock.c -+++ b/net/bluetooth/hci_sock.c -@@ -25,6 +25,7 @@ - /* Bluetooth HCI sockets. */ - - #include -+#include - #include - - #include ---- a/net/bluetooth/hidp/sock.c -+++ b/net/bluetooth/hidp/sock.c -@@ -22,6 +22,7 @@ - - #include - #include -+#include - - #include "hidp.h" - ---- a/drivers/net/wireless/ath/ath6kl/cfg80211.c -+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - #include "core.h" - #include "cfg80211.h" ---- a/drivers/net/wireless/mwifiex/usb.c -+++ b/drivers/net/wireless/mwifiex/usb.c -@@ -19,6 +19,7 @@ - - #include "main.h" - #include "usb.h" -+#include - - #define USB_VERSION "1.0" - ---- a/net/wireless/util.c -+++ b/net/wireless/util.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - #include "core.h" - #include "rdev-ops.h" - diff --git a/patches/network/07-change-default-rate-alg.patch b/patches/network/07-change-default-rate-alg.patch deleted file mode 100644 index 0584f9d8df72..000000000000 --- a/patches/network/07-change-default-rate-alg.patch +++ /dev/null @@ -1,34 +0,0 @@ - -Your current kernels configuration (.config and linux/autoconf.h) -are always respected when compiling external modules. Because -of this if you are using an old kernel which preferred the -PID rate control algorithm we cannot force it to use minstrel -instead. Minstrel is now the default rate control algorithm -and we want you to use it. To let you use it we redefine here -the CONFIG_MAC80211_RC_DEFAULT to CONFIG_COMPAT_MAC80211_RC_DEFAULT -and define CONFIG_COMPAT_MAC80211_RC_DEFAULT on config.mk. -Through the compat autoconf we then get it also defined there -at compilation time. - ---- a/net/mac80211/rate.c -+++ b/net/mac80211/rate.c -@@ -24,7 +24,7 @@ struct rate_control_alg { - static LIST_HEAD(rate_ctrl_algs); - static DEFINE_MUTEX(rate_ctrl_mutex); - --static char *ieee80211_default_rc_algo = CONFIG_MAC80211_RC_DEFAULT; -+static char *ieee80211_default_rc_algo = CONFIG_COMPAT_MAC80211_RC_DEFAULT; - module_param(ieee80211_default_rc_algo, charp, 0644); - MODULE_PARM_DESC(ieee80211_default_rc_algo, - "Default rate control algorithm for mac80211 to use"); -@@ -120,8 +120,8 @@ ieee80211_rate_control_ops_get(const cha - ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo); - - /* try built-in one if specific alg requested but not found */ -- if (!ops && strlen(CONFIG_MAC80211_RC_DEFAULT)) -- ops = ieee80211_try_rate_control_ops_get(CONFIG_MAC80211_RC_DEFAULT); -+ if (!ops && strlen(CONFIG_COMPAT_MAC80211_RC_DEFAULT)) -+ ops = ieee80211_try_rate_control_ops_get(CONFIG_COMPAT_MAC80211_RC_DEFAULT); - kparam_unblock_sysfs_write(ieee80211_default_rc_algo); - - return ops; diff --git a/patches/network/08-rename-config-options.patch b/patches/network/08-rename-config-options.patch deleted file mode 100644 index 518d2338e8b8..000000000000 --- a/patches/network/08-rename-config-options.patch +++ /dev/null @@ -1,187 +0,0 @@ -This file renames CONFIG_ options that may be defined in older -kernels but that we know we can *safely* rename to other config -option names to ensure we disable building these options at -through this framework. An example here is ath9k's rate control -aglorithm is always selected by default via CONFIG_ATH9K_RATE_CONTROL. -By renaming this to CONFIG_COMPAT_ATH9K_RATE_CONTROL we have -the flexibility to disable it for a replacement driver. - -In kernel 2.6.26 and older CONFIG_IWL4965 was build as an extra -module, but now it is directly included in the iwlagn. - -CONFIG_IWL4965 has to be set to y, to build correctly. - -zd1211rw does not build with kernel < 2.6.28, but it is often activated -in the kernel config of older kernels. We rename the option to -deactivate it on older kernels. -CONFIG_BT_L2CAP and CONFIG_BT_SCO are boolean now, but often set to m -in the kernel config. - -CONFIG_BT_HIDP does not build with older kernel versions. - ---- a/drivers/net/wireless/Makefile -+++ b/drivers/net/wireless/Makefile -@@ -21,7 +21,7 @@ obj-$(CONFIG_PRISM54) += prism54/ - obj-$(CONFIG_HOSTAP) += hostap/ - obj-$(CONFIG_B43) += b43/ - obj-$(CONFIG_B43LEGACY) += b43legacy/ --obj-$(CONFIG_ZD1211RW) += zd1211rw/ -+obj-$(CONFIG_COMPAT_ZD1211RW) += zd1211rw/ - obj-$(CONFIG_RTL8180) += rtl818x/ - obj-$(CONFIG_RTL8187) += rtl818x/ - obj-$(CONFIG_RTLWIFI) += rtlwifi/ -@@ -53,7 +53,7 @@ obj-$(CONFIG_MAC80211_HWSIM) += mac80211 - - obj-$(CONFIG_WL_TI) += ti/ - --obj-$(CONFIG_MWIFIEX) += mwifiex/ -+obj-$(CONFIG_COMPAT_MWIFIEX) += mwifiex/ - - obj-$(CONFIG_BRCMFMAC) += brcm80211/ - obj-$(CONFIG_BRCMSMAC) += brcm80211/ ---- a/drivers/net/wireless/iwlegacy/Makefile -+++ b/drivers/net/wireless/iwlegacy/Makefile -@@ -5,7 +5,7 @@ iwlegacy-$(CONFIG_IWLEGACY_DEBUGFS) += d - iwlegacy-objs += $(iwlegacy-m) - - # 4965 --obj-$(CONFIG_IWL4965) += iwl4965.o -+obj-$(CONFIG_COMPAT_IWL4965) += iwl4965.o - iwl4965-objs := 4965.o 4965-mac.o 4965-rs.o 4965-calib.o - iwl4965-$(CONFIG_IWLEGACY_DEBUGFS) += 4965-debug.o - ---- a/drivers/net/wireless/iwlegacy/common.h -+++ b/drivers/net/wireless/iwlegacy/common.h -@@ -1352,7 +1352,7 @@ struct il_priv { - - } _3945; - #endif --#if defined(CONFIG_IWL4965) || defined(CONFIG_IWL4965_MODULE) -+#if defined(CONFIG_COMPAT_IWL4965) || defined(CONFIG_COMPAT_IWL4965_MODULE) - struct { - struct il_rx_phy_res last_phy_res; - bool last_phy_res_valid; ---- a/drivers/net/wireless/libertas/Makefile -+++ b/drivers/net/wireless/libertas/Makefile -@@ -17,5 +17,5 @@ libertas_spi-objs += if_spi.o - obj-$(CONFIG_LIBERTAS) += libertas.o - obj-$(CONFIG_LIBERTAS_USB) += usb8xxx.o - obj-$(CONFIG_LIBERTAS_CS) += libertas_cs.o --obj-$(CONFIG_LIBERTAS_SDIO) += libertas_sdio.o -+obj-$(CONFIG_COMPAT_LIBERTAS_SDIO) += libertas_sdio.o - obj-$(CONFIG_LIBERTAS_SPI) += libertas_spi.o ---- a/drivers/net/wireless/zd1211rw/Makefile -+++ b/drivers/net/wireless/zd1211rw/Makefile -@@ -1,4 +1,4 @@ --obj-$(CONFIG_ZD1211RW) += zd1211rw.o -+obj-$(CONFIG_COMPAT_ZD1211RW) += zd1211rw.o - - zd1211rw-objs := zd_chip.o zd_mac.o \ - zd_rf_al2230.o zd_rf_rf2959.o \ ---- a/net/bluetooth/Makefile -+++ b/net/bluetooth/Makefile -@@ -6,7 +6,7 @@ obj-$(CONFIG_BT) += bluetooth.o - obj-$(CONFIG_BT_RFCOMM) += rfcomm/ - obj-$(CONFIG_BT_BNEP) += bnep/ - obj-$(CONFIG_BT_CMTP) += cmtp/ --obj-$(CONFIG_BT_HIDP) += hidp/ -+obj-$(CONFIG_COMPAT_BT_HIDP) += hidp/ - - bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ - hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ ---- a/net/bluetooth/hidp/Makefile -+++ b/net/bluetooth/hidp/Makefile -@@ -2,6 +2,6 @@ - # Makefile for the Linux Bluetooth HIDP layer - # - --obj-$(CONFIG_BT_HIDP) += hidp.o -+obj-$(CONFIG_COMPAT_BT_HIDP) += hidp.o - - hidp-objs := core.o sock.o ---- a/drivers/net/wireless/ti/wl1251/Makefile -+++ b/drivers/net/wireless/ti/wl1251/Makefile -@@ -4,7 +4,7 @@ wl1251_spi-objs += spi.o - wl1251_sdio-objs += sdio.o - - obj-$(CONFIG_WL1251) += wl1251.o --obj-$(CONFIG_WL1251_SPI) += wl1251_spi.o --obj-$(CONFIG_WL1251_SDIO) += wl1251_sdio.o -+obj-$(CONFIG_COMPAT_WL1251_SPI)+= wl1251_spi.o -+obj-$(CONFIG_COMPAT_WL1251_SDIO)+= wl1251_sdio.o - - ccflags-y += -D__CHECK_ENDIAN__ ---- a/drivers/net/wireless/ath/ath9k/Makefile -+++ b/drivers/net/wireless/ath/ath9k/Makefile -@@ -8,7 +8,7 @@ ath9k-y += beacon.o \ - antenna.o - - ath9k-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += mci.o --ath9k-$(CONFIG_ATH9K_RATE_CONTROL) += rc.o -+ath9k-$(CONFIG_COMPAT_ATH9K_RATE_CONTROL) += rc.o - ath9k-$(CONFIG_ATH9K_PCI) += pci.o - ath9k-$(CONFIG_ATH9K_AHB) += ahb.o - ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -760,7 +760,7 @@ void ath9k_set_hw_capab(struct ath_softc - sc->ant_rx = hw->wiphy->available_antennas_rx; - sc->ant_tx = hw->wiphy->available_antennas_tx; - --#ifdef CONFIG_ATH9K_RATE_CONTROL -+#ifdef CONFIG_COMPAT_ATH9K_RATE_CONTROL - hw->rate_control_algorithm = "ath9k_rate_control"; - #endif - ---- a/drivers/net/wireless/ath/ath9k/rc.h -+++ b/drivers/net/wireless/ath/ath9k/rc.h -@@ -231,7 +231,7 @@ static inline void ath_debug_stat_retrie - } - #endif - --#ifdef CONFIG_ATH9K_RATE_CONTROL -+#ifdef CONFIG_COMPAT_ATH9K_RATE_CONTROL - int ath_rate_control_register(void); - void ath_rate_control_unregister(void); - #else ---- a/net/bluetooth/rfcomm/Makefile -+++ b/net/bluetooth/rfcomm/Makefile -@@ -5,4 +5,4 @@ - obj-$(CONFIG_BT_RFCOMM) += rfcomm.o - - rfcomm-y := core.o sock.o --rfcomm-$(CONFIG_BT_RFCOMM_TTY) += tty.o -+rfcomm-$(CONFIG_COMPAT_BT_RFCOMM_TTY) += tty.o ---- a/include/net/bluetooth/rfcomm.h -+++ b/include/net/bluetooth/rfcomm.h -@@ -357,7 +357,7 @@ struct rfcomm_dev_list_req { - - int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); - --#ifdef CONFIG_BT_RFCOMM_TTY -+#ifdef CONFIG_COMPAT_BT_RFCOMM_TTY - int rfcomm_init_ttys(void); - void rfcomm_cleanup_ttys(void); - #else ---- a/net/bluetooth/rfcomm/sock.c -+++ b/net/bluetooth/rfcomm/sock.c -@@ -862,7 +862,7 @@ static int rfcomm_sock_ioctl(struct sock - err = bt_sock_ioctl(sock, cmd, arg); - - if (err == -ENOIOCTLCMD) { --#ifdef CONFIG_BT_RFCOMM_TTY -+#ifdef CONFIG_COMPAT_BT_RFCOMM_TTY - lock_sock(sk); - err = rfcomm_dev_ioctl(sk, cmd, (void __user *) arg); - release_sock(sk); ---- a/drivers/net/wireless/mwifiex/Makefile -+++ b/drivers/net/wireless/mwifiex/Makefile -@@ -39,7 +39,7 @@ mwifiex-y += sta_rx.o - mwifiex-y += uap_txrx.o - mwifiex-y += cfg80211.o - mwifiex-$(CONFIG_DEBUG_FS) += debugfs.o --obj-$(CONFIG_MWIFIEX) += mwifiex.o -+obj-$(CONFIG_COMPAT_MWIFIEX) += mwifiex.o - - mwifiex_sdio-y += sdio.o - obj-$(CONFIG_MWIFIEX_SDIO) += mwifiex_sdio.o diff --git a/patches/network/09-cfg80211-wext-padding.patch b/patches/network/09-cfg80211-wext-padding.patch deleted file mode 100644 index 5942caed53b2..000000000000 --- a/patches/network/09-cfg80211-wext-padding.patch +++ /dev/null @@ -1,62 +0,0 @@ -This is a tricky one. - -Consider a kernel that has this code in net/wireless/wext-core.c: - -#ifdef CONFIG_CFG80211_WEXT - if (dev->ieee80211_ptr && dev->ieee80211_ptr->wiphy) - handlers = dev->ieee80211_ptr->wiphy->wext; -#endif -#ifdef CONFIG_WIRELESS_EXT - if (dev->wireless_handlers) - handlers = dev->wireless_handlers; -#endif - -If a kernel is compiled without CONFIG_WIRELESS_EXT then -compat-drivers can't do wireless extensions against it. -However, if the kernel is compiled with CONFIG_CFG80211_WEXT -then it will try to get the wext handlers from struct wiphy. - -Now, struct wiphy in the base kernel and struct wiphy in -compat-drivers don't match, so the kernel crashes!! - -To fix this, add lots of padding to compat-drivers's -struct wiphy so that the "wext" pointer is guaranteed -to be NULL. - -Make sure the padding is larger than the struct so we -don't ever run into this again because the wext pointer -moved due to struct enlargements. - - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -2259,6 +2259,9 @@ struct wiphy_wowlan_support { - struct wiphy { - /* assign these fields before you register the wiphy */ - -+#define WIPHY_COMPAT_PAD_SIZE 2048 -+ u8 padding[WIPHY_COMPAT_PAD_SIZE]; -+ - /* permanent MAC address(es) */ - u8 perm_addr[ETH_ALEN]; - u8 addr_mask[ETH_ALEN]; ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -290,6 +290,17 @@ struct wiphy *wiphy_new(const struct cfg - struct cfg80211_registered_device *rdev; - int alloc_size; - -+ /* -+ * Make sure the padding is >= the rest of the struct so that we -+ * always keep it large enough to pad out the entire original -+ * kernel's struct. We really only need to make sure it's larger -+ * than the kernel compat is compiled against, but since it'll -+ * only increase in size make sure it's larger than the current -+ * version of it. Subtract since it's included. -+ */ -+ BUILD_BUG_ON(WIPHY_COMPAT_PAD_SIZE < -+ sizeof(struct wiphy) - WIPHY_COMPAT_PAD_SIZE); -+ - WARN_ON(ops->add_key && (!ops->del_key || !ops->set_default_key)); - WARN_ON(ops->auth && (!ops->assoc || !ops->deauth || !ops->disassoc)); - WARN_ON(ops->connect && !ops->disconnect); diff --git a/patches/network/09-threaded-irq.patch b/patches/network/09-threaded-irq.patch deleted file mode 100644 index a7d2fe616a6b..000000000000 --- a/patches/network/09-threaded-irq.patch +++ /dev/null @@ -1,129 +0,0 @@ -The 2.6.31 kernel has threaded IRQ support and b43 is the first -wireless driver that makes use of it. To support threaded IRSs -on older kernels we built our own struct compat_threaded_irq -to queue_work() onto it as the kernel thread be running the -thread in process context as well. - ---- a/drivers/net/wireless/b43/main.c -+++ b/drivers/net/wireless/b43/main.c -@@ -4212,8 +4212,13 @@ redo: - if (b43_bus_host_is_sdio(dev->dev)) { - b43_sdio_free_irq(dev); - } else { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) -+ compat_synchronize_threaded_irq(&dev->irq_compat); -+ compat_free_threaded_irq(&dev->irq_compat); -+#else - synchronize_irq(dev->dev->irq); - free_irq(dev->dev->irq, dev); -+#endif - } - mutex_lock(&wl->mutex); - dev = wl->current_dev; -@@ -4255,9 +4260,17 @@ static int b43_wireless_core_start(struc - goto out; - } - } else { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) -+ err = compat_request_threaded_irq(&dev->irq_compat, -+ dev->dev->irq, -+ b43_interrupt_handler, -+ b43_interrupt_thread_handler, -+ IRQF_SHARED, KBUILD_MODNAME, dev); -+#else - err = request_threaded_irq(dev->dev->irq, b43_interrupt_handler, - b43_interrupt_thread_handler, - IRQF_SHARED, KBUILD_MODNAME, dev); -+#endif - if (err) { - b43err(dev->wl, "Cannot request IRQ-%d\n", - dev->dev->irq); -@@ -5080,6 +5093,10 @@ static int b43_setup_bands(struct b43_wl - - static void b43_wireless_core_detach(struct b43_wldev *dev) - { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) -+ if (dev->dev->sdev->bus->bustype != SSB_BUSTYPE_SDIO) -+ compat_destroy_threaded_irq(&dev->irq_compat); -+#endif - /* We release firmware that late to not be required to re-request - * is all the time when we reinit the core. */ - b43_release_firmware(dev); ---- a/drivers/net/wireless/b43/b43.h -+++ b/drivers/net/wireless/b43/b43.h -@@ -859,6 +859,9 @@ struct b43_wldev { - unsigned int tx_count; - unsigned int rx_count; - #endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) -+ struct compat_threaded_irq irq_compat; -+#endif - }; - - /* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */ ---- a/drivers/net/wireless/ti/wlcore/main.c -+++ b/drivers/net/wireless/ti/wlcore/main.c -@@ -5568,14 +5568,25 @@ static void wlcore_nvs_cb(const struct f - wl->set_power = pdata->set_power; - wl->if_ops = pdata->ops; - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) -+ irqflags = IRQF_TRIGGER_RISING; -+#else - if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) - irqflags = IRQF_TRIGGER_RISING; - else - irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT; -+#endif - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) -+ ret = compat_request_threaded_irq(&wl->irq_compat, wl->irq, -+ wl12xx_hardirq, wlcore_irq, -+ irqflags, -+ pdev->name, wl); -+#else - ret = request_threaded_irq(wl->irq, wl12xx_hardirq, wlcore_irq, - irqflags, - pdev->name, wl); -+#endif - if (ret < 0) { - wl1271_error("request_irq() failed: %d", ret); - goto out_free_nvs; -@@ -5650,7 +5661,11 @@ out_unreg: - wl1271_unregister_hw(wl); - - out_irq: -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) -+ compat_free_threaded_irq(&wl->irq_compat); -+#else - free_irq(wl->irq, wl); -+#endif - - out_free_nvs: - kfree(wl->nvs); -@@ -5696,7 +5711,12 @@ int __devexit wlcore_remove(struct platf - disable_irq_wake(wl->irq); - } - wl1271_unregister_hw(wl); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) -+ compat_free_threaded_irq(&wl->irq_compat); -+ compat_destroy_threaded_irq(&wl->irq_compat); -+#else - free_irq(wl->irq, wl); -+#endif - wlcore_free_hw(wl); - - return 0; ---- a/drivers/net/wireless/ti/wlcore/wlcore.h -+++ b/drivers/net/wireless/ti/wlcore/wlcore.h -@@ -149,7 +149,9 @@ struct wl1271 { - bool initialized; - struct ieee80211_hw *hw; - bool mac80211_registered; -- -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) -+ struct compat_threaded_irq irq_compat; -+#endif - struct device *dev; - struct platform_device *pdev; - diff --git a/patches/network/10-add-wext-handlers-to-netdev.patch b/patches/network/10-add-wext-handlers-to-netdev.patch deleted file mode 100644 index d9977d7e1251..000000000000 --- a/patches/network/10-add-wext-handlers-to-netdev.patch +++ /dev/null @@ -1,47 +0,0 @@ -The patch "wext: refactor" by Johannes Berg refactored -wext code so that new kernels no longer get the wext -handlers through struct netdevice, instead they get -it through the struct wiphy which is cfg80211 specific. - -For old kernels this means you get not wext handlers -anymore when backporting code, this adds the wext handler -back to the netdevice wireless_handlers to let compat -users use wext again. - -We do this for every kernel version because the struct wiphy -is changing from kernel version to version. At least the -struct from kernel 2.6.33 and 2.6.34 are incompatible and -the kernel would dereference some wrong type in the struct -and oops. The old interface is not affected by this. This -will cause that CONFIG_CFG80211_WEXT still depends on -CONFIG_WIRELESS_EXT in compat-drivers. - ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -345,10 +345,6 @@ struct wiphy *wiphy_new(const struct cfg - INIT_LIST_HEAD(&rdev->bss_list); - INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); - INIT_WORK(&rdev->sched_scan_results_wk, __cfg80211_sched_scan_results); --#ifdef CONFIG_CFG80211_WEXT -- rdev->wiphy.wext = &cfg80211_wext_handler; --#endif -- - device_initialize(&rdev->wiphy.dev); - rdev->wiphy.dev.class = &ieee80211_class; - rdev->wiphy.dev.platform_data = rdev; -@@ -871,6 +867,15 @@ static int cfg80211_netdev_notifier_call - wdev->sme_state = CFG80211_SME_IDLE; - mutex_unlock(&rdev->devlist_mtx); - #ifdef CONFIG_CFG80211_WEXT -+#ifdef CONFIG_WIRELESS_EXT -+ if (!dev->wireless_handlers) -+ dev->wireless_handlers = &cfg80211_wext_handler; -+#else -+ printk_once(KERN_WARNING "cfg80211: wext will not work because " -+ "kernel was compiled with CONFIG_WIRELESS_EXT=n. " -+ "Tools using wext interface, like iwconfig will " -+ "not work.\n"); -+#endif - wdev->wext.default_key = -1; - wdev->wext.default_mgmt_key = -1; - wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; diff --git a/patches/network/11-dev-pm-ops.patch b/patches/network/11-dev-pm-ops.patch deleted file mode 100644 index 9001b52bfe24..000000000000 --- a/patches/network/11-dev-pm-ops.patch +++ /dev/null @@ -1,429 +0,0 @@ -The 2.6.29 kernel has new struct dev_pm_ops [1] which are used -on the pci device to distinguish power management hooks for suspend -to RAM and hibernation. Older kernels don't have these so we need -to resort back to the good ol' suspend/resume. Fortunately the calls -are not so different so it should be possible to resuse the same -calls on compat code with only slight modifications. - -[1] http://lxr.linux.no/#linux+v2.6.29/include/linux/pm.h#L170 - ---- a/drivers/bcma/host_pci.c -+++ b/drivers/bcma/host_pci.c -@@ -257,6 +257,9 @@ static int bcma_host_pci_resume(struct d - return bcma_bus_resume(bus); - } - -+compat_pci_suspend(bcma_host_pci_suspend) -+compat_pci_resume(bcma_host_pci_resume) -+ - static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend, - bcma_host_pci_resume); - #define BCMA_PM_OPS (&bcma_pm_ops) -@@ -285,7 +288,12 @@ static struct pci_driver bcma_pci_bridge - .id_table = bcma_pci_bridge_tbl, - .probe = bcma_host_pci_probe, - .remove = __devexit_p(bcma_host_pci_remove), -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = BCMA_PM_OPS, -+#elif defined(CONFIG_PM) -+ .suspend = bcma_host_pci_suspend_compat, -+ .resume = bcma_host_pci_resume_compat, -+#endif - }; - - int __init bcma_host_pci_init(void) ---- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -@@ -2691,6 +2691,9 @@ static const struct pci_error_handlers a - .resume = atl1c_io_resume, - }; - -+compat_pci_suspend(atl1c_suspend) -+compat_pci_resume(atl1c_resume) -+ - static SIMPLE_DEV_PM_OPS(atl1c_pm_ops, atl1c_suspend, atl1c_resume); - - static struct pci_driver atl1c_driver = { -@@ -2700,7 +2703,12 @@ static struct pci_driver atl1c_driver = - .remove = __devexit_p(atl1c_remove), - .shutdown = atl1c_shutdown, - .err_handler = &atl1c_err_handler, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = &atl1c_pm_ops, -+#elif defined(CONFIG_PM_SLEEP) -+ .suspend = atl1c_suspend_compat, -+ .resume = atl1c_resume_compat, -+#endif - }; - - /** ---- a/drivers/net/ethernet/atheros/atlx/atl1.c -+++ b/drivers/net/ethernet/atheros/atlx/atl1.c -@@ -2877,6 +2877,9 @@ static int atl1_resume(struct device *de - return 0; - } - -+compat_pci_suspend(atl1_suspend) -+compat_pci_resume(atl1_resume) -+ - static SIMPLE_DEV_PM_OPS(atl1_pm_ops, atl1_suspend, atl1_resume); - #define ATL1_PM_OPS (&atl1_pm_ops) - -@@ -3148,7 +3151,12 @@ static struct pci_driver atl1_driver = { - .probe = atl1_probe, - .remove = __devexit_p(atl1_remove), - .shutdown = atl1_shutdown, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = ATL1_PM_OPS, -+#elif defined(CONFIG_PM_SLEEP) -+ .suspend = atl1_suspend_compat, -+ .resume = atl1_resume_compat, -+#endif - }; - - /** ---- a/drivers/net/wireless/ath/ath5k/pci.c -+++ b/drivers/net/wireless/ath/ath5k/pci.c -@@ -326,6 +326,9 @@ static int ath5k_pci_resume(struct devic - return 0; - } - -+compat_pci_suspend(ath5k_pci_suspend) -+compat_pci_resume(ath5k_pci_resume) -+ - static SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume); - #define ATH5K_PM_OPS (&ath5k_pm_ops) - #else -@@ -337,7 +340,12 @@ static struct pci_driver ath5k_pci_drive - .id_table = ath5k_pci_id_table, - .probe = ath5k_pci_probe, - .remove = __devexit_p(ath5k_pci_remove), -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = ATH5K_PM_OPS, -+#elif defined(CONFIG_PM_SLEEP) -+ .suspend = ath5k_pci_suspend_compat, -+ .resume = ath5k_pci_resume_compat, -+#endif - }; - - module_pci_driver(ath5k_pci_driver); ---- a/drivers/net/wireless/ath/ath9k/pci.c -+++ b/drivers/net/wireless/ath/ath9k/pci.c -@@ -333,14 +333,10 @@ static int ath_pci_resume(struct device - return 0; - } - --static const struct dev_pm_ops ath9k_pm_ops = { -- .suspend = ath_pci_suspend, -- .resume = ath_pci_resume, -- .freeze = ath_pci_suspend, -- .thaw = ath_pci_resume, -- .poweroff = ath_pci_suspend, -- .restore = ath_pci_resume, --}; -+compat_pci_suspend(ath_pci_suspend) -+compat_pci_resume(ath_pci_resume) -+ -+static SIMPLE_DEV_PM_OPS(ath9k_pm_ops, ath_pci_suspend, ath_pci_resume); - - #define ATH9K_PM_OPS (&ath9k_pm_ops) - -@@ -358,7 +354,12 @@ static struct pci_driver ath_pci_driver - .id_table = ath_pci_id_table, - .probe = ath_pci_probe, - .remove = ath_pci_remove, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = ATH9K_PM_OPS, -+#elif defined(CONFIG_PM) -+ .suspend = ath_pci_suspend_compat, -+ .resume = ath_pci_resume_compat, -+#endif - }; - - int ath_pci_init(void) ---- a/drivers/net/wireless/iwlegacy/3945-mac.c -+++ b/drivers/net/wireless/iwlegacy/3945-mac.c -@@ -3885,7 +3885,12 @@ static struct pci_driver il3945_driver = - .id_table = il3945_hw_card_ids, - .probe = il3945_pci_probe, - .remove = __devexit_p(il3945_pci_remove), -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = IL_LEGACY_PM_OPS, -+#elif defined(CONFIG_PM) -+ .suspend = il_pci_suspend_compat, -+ .resume = il_pci_resume_compat, -+#endif - }; - - static int __init ---- a/drivers/net/wireless/iwlegacy/4965-mac.c -+++ b/drivers/net/wireless/iwlegacy/4965-mac.c -@@ -6773,7 +6773,12 @@ static struct pci_driver il4965_driver = - .id_table = il4965_hw_card_ids, - .probe = il4965_pci_probe, - .remove = __devexit_p(il4965_pci_remove), -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = IL_LEGACY_PM_OPS, -+#elif defined(CONFIG_PM) -+ .suspend = il_pci_suspend_compat, -+ .resume = il_pci_resume_compat, -+#endif - }; - - static int __init ---- a/drivers/net/wireless/iwlegacy/common.c -+++ b/drivers/net/wireless/iwlegacy/common.c -@@ -4906,8 +4906,17 @@ il_pci_resume(struct device *device) - return 0; - } - -+compat_pci_suspend(il_pci_suspend) -+compat_pci_resume(il_pci_resume) -+ - SIMPLE_DEV_PM_OPS(il_pm_ops, il_pci_suspend, il_pci_resume); -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - EXPORT_SYMBOL(il_pm_ops); -+#else -+EXPORT_SYMBOL(il_pci_suspend_compat); -+EXPORT_SYMBOL(il_pci_resume_compat); -+#endif - - #endif /* CONFIG_PM */ - ---- a/drivers/net/wireless/iwlegacy/common.h -+++ b/drivers/net/wireless/iwlegacy/common.h -@@ -1843,7 +1843,14 @@ __le32 il_add_beacon_time(struct il_priv - u32 beacon_interval); - - #ifdef CONFIG_PM -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) -+int il_pci_suspend_compat(struct pci_dev *pdev, pm_message_t state); -+int il_pci_resume_compat(struct pci_dev *pdev); -+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) -+extern struct dev_pm_ops il_pm_ops; -+#else - extern const struct dev_pm_ops il_pm_ops; -+#endif - - #define IL_LEGACY_PM_OPS (&il_pm_ops) - ---- a/drivers/net/wireless/iwlwifi/pcie/drv.c -+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c -@@ -338,6 +338,9 @@ static int iwl_pci_resume(struct device - return iwl_trans_resume(iwl_trans); - } - -+compat_pci_suspend(iwl_pci_suspend) -+compat_pci_resume(iwl_pci_resume) -+ - static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume); - - #define IWL_PM_OPS (&iwl_dev_pm_ops) -@@ -353,7 +356,12 @@ static struct pci_driver iwl_pci_driver - .id_table = iwl_hw_card_ids, - .probe = iwl_pci_probe, - .remove = __devexit_p(iwl_pci_remove), -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = IWL_PM_OPS, -+#elif defined(CONFIG_PM) -+ .suspend = iwl_pci_suspend_compat, -+ .resume = iwl_pci_resume_compat, -+#endif - }; - - int __must_check iwl_pci_register_driver(void) ---- a/drivers/net/wireless/libertas/if_spi.c -+++ b/drivers/net/wireless/libertas/if_spi.c -@@ -1249,6 +1249,7 @@ static int __devexit libertas_spi_remove - return 0; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - static int if_spi_suspend(struct device *dev) - { - struct spi_device *spi = to_spi_device(dev); -@@ -1282,6 +1283,7 @@ static const struct dev_pm_ops if_spi_pm - .suspend = if_spi_suspend, - .resume = if_spi_resume, - }; -+#endif - - static struct spi_driver libertas_spi_driver = { - .probe = if_spi_probe, -@@ -1289,7 +1291,9 @@ static struct spi_driver libertas_spi_dr - .driver = { - .name = "libertas_spi", - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .pm = &if_spi_pm_ops, -+#endif - }, - }; - ---- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c -+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c -@@ -372,21 +372,22 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use - MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); - MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); - --static const struct dev_pm_ops rtlwifi_pm_ops = { -- .suspend = rtl_pci_suspend, -- .resume = rtl_pci_resume, -- .freeze = rtl_pci_suspend, -- .thaw = rtl_pci_resume, -- .poweroff = rtl_pci_suspend, -- .restore = rtl_pci_resume, --}; -+compat_pci_suspend(rtl_pci_suspend) -+compat_pci_resume(rtl_pci_resume) -+ -+static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); - - static struct pci_driver rtl92ce_driver = { - .name = KBUILD_MODNAME, - .id_table = rtl92ce_pci_ids, - .probe = rtl_pci_probe, - .remove = rtl_pci_disconnect, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = &rtlwifi_pm_ops, -+#elif defined(CONFIG_PM) -+ .suspend = rtl_pci_suspend_compat, -+ .resume = rtl_pci_resume_compat, -+#endif - }; - - module_pci_driver(rtl92ce_driver); ---- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c -+++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c -@@ -378,21 +378,22 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use - MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); - MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); - --static const struct dev_pm_ops rtlwifi_pm_ops = { -- .suspend = rtl_pci_suspend, -- .resume = rtl_pci_resume, -- .freeze = rtl_pci_suspend, -- .thaw = rtl_pci_resume, -- .poweroff = rtl_pci_suspend, -- .restore = rtl_pci_resume, --}; -+compat_pci_suspend(rtl_pci_suspend) -+compat_pci_resume(rtl_pci_resume) -+ -+static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); - - static struct pci_driver rtl92de_driver = { - .name = KBUILD_MODNAME, - .id_table = rtl92de_pci_ids, - .probe = rtl_pci_probe, - .remove = rtl_pci_disconnect, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = &rtlwifi_pm_ops, -+#elif defined(CONFIG_PM) -+ .suspend = rtl_pci_suspend_compat, -+ .resume = rtl_pci_resume_compat, -+#endif - }; - - /* add global spin lock to solve the problem that ---- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c -+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c -@@ -432,21 +432,22 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use - MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); - MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); - --static const struct dev_pm_ops rtlwifi_pm_ops = { -- .suspend = rtl_pci_suspend, -- .resume = rtl_pci_resume, -- .freeze = rtl_pci_suspend, -- .thaw = rtl_pci_resume, -- .poweroff = rtl_pci_suspend, -- .restore = rtl_pci_resume, --}; -+compat_pci_suspend(rtl_pci_suspend) -+compat_pci_resume(rtl_pci_resume) -+ -+static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); - - static struct pci_driver rtl92se_driver = { - .name = KBUILD_MODNAME, - .id_table = rtl92se_pci_ids, - .probe = rtl_pci_probe, - .remove = rtl_pci_disconnect, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = &rtlwifi_pm_ops, -+#elif defined(CONFIG_PM) -+ .suspend = rtl_pci_suspend_compat, -+ .resume = rtl_pci_resume_compat, -+#endif - }; - - module_pci_driver(rtl92se_driver); ---- a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c -+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c -@@ -367,21 +367,22 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use - MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); - MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); - --static const struct dev_pm_ops rtlwifi_pm_ops = { -- .suspend = rtl_pci_suspend, -- .resume = rtl_pci_resume, -- .freeze = rtl_pci_suspend, -- .thaw = rtl_pci_resume, -- .poweroff = rtl_pci_suspend, -- .restore = rtl_pci_resume, --}; -+compat_pci_suspend(rtl_pci_suspend) -+compat_pci_resume(rtl_pci_resume) -+ -+static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); - - static struct pci_driver rtl8723ae_driver = { - .name = KBUILD_MODNAME, - .id_table = rtl8723ae_pci_ids, - .probe = rtl_pci_probe, - .remove = rtl_pci_disconnect, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = &rtlwifi_pm_ops, -+#elif defined(CONFIG_PM) -+ .suspend = rtl_pci_suspend_compat, -+ .resume = rtl_pci_resume_compat, -+#endif - }; - - module_pci_driver(rtl8723ae_driver); ---- a/drivers/net/wireless/p54/p54pci.c -+++ b/drivers/net/wireless/p54/p54pci.c -@@ -681,14 +681,10 @@ static int p54p_resume(struct device *de - return pci_set_power_state(pdev, PCI_D0); - } - --static const struct dev_pm_ops p54pci_pm_ops = { -- .suspend = p54p_suspend, -- .resume = p54p_resume, -- .freeze = p54p_suspend, -- .thaw = p54p_resume, -- .poweroff = p54p_suspend, -- .restore = p54p_resume, --}; -+compat_pci_suspend(p54p_suspend) -+compat_pci_resume(p54p_resume) -+ -+static SIMPLE_DEV_PM_OPS(p54pci_pm_ops, p54p_suspend, p54p_resume); - - #define P54P_PM_OPS (&p54pci_pm_ops) - #else -@@ -700,7 +696,12 @@ static struct pci_driver p54p_driver = { - .id_table = p54p_table, - .probe = p54p_probe, - .remove = __devexit_p(p54p_remove), -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) - .driver.pm = P54P_PM_OPS, -+#elif defined(CONFIG_PM) -+ .suspend = p54p_suspend_compat, -+ .resume = p54p_resume_compat, -+#endif - }; - - module_pci_driver(p54p_driver); diff --git a/patches/network/12-iw_handler-changes.patch b/patches/network/12-iw_handler-changes.patch deleted file mode 100644 index 5b22ef80d662..000000000000 --- a/patches/network/12-iw_handler-changes.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/drivers/net/wireless/ipw2x00/ipw2100.c -+++ b/drivers/net/wireless/ipw2x00/ipw2100.c -@@ -6106,7 +6106,11 @@ static struct net_device *ipw2100_alloc_ - netdev_attach_ops(dev, &ipw2100_netdev_ops); - dev->ethtool_ops = &ipw2100_ethtool_ops; - dev->wireless_handlers = &ipw2100_wx_handler_def; -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - priv->wireless_data.libipw = priv->ieee; -+#else -+ priv->wireless_data.ieee80211 = (struct ieee80211_device *) priv->ieee; -+#endif - dev->wireless_data = &priv->wireless_data; - dev->watchdog_timeo = 3 * HZ; - dev->irq = 0; diff --git a/patches/network/12-mac80211-disable-tx-status.patch b/patches/network/12-mac80211-disable-tx-status.patch deleted file mode 100644 index de530519d8d8..000000000000 --- a/patches/network/12-mac80211-disable-tx-status.patch +++ /dev/null @@ -1,24 +0,0 @@ -We can't possibly backport the wifi TX status since -skb_shinfo()->tx_flags used to be a union and there -is no way to make the & work properly in that case. -So we need to just ifdef this part out. - - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -1989,6 +1989,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s - goto fail_rcu; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - if (unlikely(!multicast && skb->sk && - skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) { - struct sk_buff *orig_skb = skb; -@@ -2027,6 +2028,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s - skb = orig_skb; - } - } -+#endif - - /* - * If the skb is shared we need to obtain our own copy. diff --git a/patches/network/14-device-type.patch b/patches/network/14-device-type.patch deleted file mode 100644 index 765a783cb227..000000000000 --- a/patches/network/14-device-type.patch +++ /dev/null @@ -1,56 +0,0 @@ -Kernels >= 2.6.32 can identify the type of device netdevice -so that sysfs can be used to get this. We never really had a -systematic way of doing this -- now we do through the -SET_NETDEV_DEVTYPE() macro. For older kernels we make the -SET_NETDEV_DEVTYPE() be a no-op this means the wireless type -we define is unused so we ucomment it simply to avoid a -compile warning. - ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -803,9 +803,11 @@ void cfg80211_unregister_wdev(struct wir - } - EXPORT_SYMBOL(cfg80211_unregister_wdev); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) - static struct device_type wiphy_type = { - .name = "wlan", - }; -+#endif - - void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, - enum nl80211_iftype iftype, int num) ---- a/net/bluetooth/bnep/core.c -+++ b/net/bluetooth/bnep/core.c -@@ -527,9 +527,11 @@ static struct device *bnep_get_device(st - return conn ? &conn->dev : NULL; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) - static struct device_type bnep_type = { - .name = "bluetooth", - }; -+#endif - - int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) - { ---- a/drivers/net/usb/usbnet.c -+++ b/drivers/net/usb/usbnet.c -@@ -1339,13 +1339,17 @@ static const struct net_device_ops usbne - - // precondition: never called in_interrupt - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) - static struct device_type wlan_type = { - .name = "wlan", - }; -+#endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) - static struct device_type wwan_type = { - .name = "wwan", - }; -+#endif - - int - usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) diff --git a/patches/network/15-symbol-export-conflicts.patch b/patches/network/15-symbol-export-conflicts.patch deleted file mode 100644 index a836b9457125..000000000000 --- a/patches/network/15-symbol-export-conflicts.patch +++ /dev/null @@ -1,18 +0,0 @@ -In kernel < 2.6.32 libipw also exports ieee80211_rx. -To avoid conflicts with the other export we rename our. - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -3203,7 +3203,12 @@ void ieee80211_rx(struct ieee80211_hw *h - drop: - kfree_skb(skb); - } -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) - EXPORT_SYMBOL(ieee80211_rx); -+#else -+EXPORT_SYMBOL(mac80211_ieee80211_rx); -+#endif -+ - - /* This is a version of the rx handler that can be called from hard irq - * context. Post the skb on the queue and schedule the tasklet */ diff --git a/patches/network/16-bluetooth.patch b/patches/network/16-bluetooth.patch deleted file mode 100644 index 8c690ae76a71..000000000000 --- a/patches/network/16-bluetooth.patch +++ /dev/null @@ -1,575 +0,0 @@ -These changes are required to backport blueooth. A lot can be optimized -here still, but for now we keep this here. - ---- a/drivers/bluetooth/hci_ldisc.c -+++ b/drivers/bluetooth/hci_ldisc.c -@@ -297,8 +297,13 @@ static int hci_uart_tty_open(struct tty_ - /* FIXME: why is this needed. Note don't use ldisc_ref here as the - open path is before the ldisc is referencable */ - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) - if (tty->ldisc->ops->flush_buffer) - tty->ldisc->ops->flush_buffer(tty); -+#else -+ if (tty->ldisc.ops->flush_buffer) -+ tty->ldisc.ops->flush_buffer(tty); -+#endif - tty_driver_flush_buffer(tty); - - return 0; -@@ -524,7 +529,11 @@ static int hci_uart_tty_ioctl(struct tty - return hu->hdev_flags; - - default: -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - err = n_tty_ioctl_helper(tty, file, cmd, arg); -+#else -+ err = n_tty_ioctl(tty, file, cmd, arg); -+#endif - break; - } - ---- a/net/bluetooth/af_bluetooth.c -+++ b/net/bluetooth/af_bluetooth.c -@@ -112,8 +112,12 @@ int bt_sock_unregister(int proto) - } - EXPORT_SYMBOL(bt_sock_unregister); - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int bt_sock_create(struct net *net, struct socket *sock, int proto, - int kern) -+#else -+static int bt_sock_create(struct net *net, struct socket *sock, int proto) -+#endif - { - int err; - -@@ -131,7 +135,11 @@ static int bt_sock_create(struct net *ne - read_lock(&bt_proto_lock); - - if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - err = bt_proto[proto]->create(net, sock, proto, kern); -+#else -+ err = bt_proto[proto]->create(net, sock, proto); -+#endif - if (!err) - bt_sock_reclassify_lock(sock->sk, proto); - module_put(bt_proto[proto]->owner); -@@ -464,7 +472,11 @@ int bt_sock_ioctl(struct socket *sock, u - if (sk->sk_state == BT_LISTEN) - return -EINVAL; - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); -+#else -+ amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); -+#endif - if (amount < 0) - amount = 0; - err = put_user(amount, (int __user *) arg); ---- a/net/bluetooth/cmtp/capi.c -+++ b/net/bluetooth/cmtp/capi.c -@@ -384,7 +384,11 @@ static void cmtp_reset_ctr(struct capi_c - - BT_DBG("ctrl %p", ctrl); - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) - capi_ctr_down(ctrl); -+#else -+ capi_ctr_reseted(ctrl); -+#endif - - atomic_inc(&session->terminate); - wake_up_process(session->task); ---- a/net/bluetooth/hci_sock.c -+++ b/net/bluetooth/hci_sock.c -@@ -884,8 +884,13 @@ drop: - goto done; - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - static int hci_sock_setsockopt(struct socket *sock, int level, int optname, - char __user *optval, unsigned int len) -+#else -+static int hci_sock_setsockopt(struct socket *sock, int level, int optname, -+ char __user *optval, int len) -+#endif - { - struct hci_ufilter uf = { .opcode = 0 }; - struct sock *sk = sock->sk; -@@ -1059,8 +1064,12 @@ static struct proto hci_sk_proto = { - .obj_size = sizeof(struct hci_pinfo) - }; - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int hci_sock_create(struct net *net, struct socket *sock, int protocol, - int kern) -+#else -+static int hci_sock_create(struct net *net, struct socket *sock, int protocol) -+#endif - { - struct sock *sk; - ---- a/net/bluetooth/hci_sysfs.c -+++ b/net/bluetooth/hci_sysfs.c -@@ -71,7 +71,11 @@ static struct attribute_group bt_link_gr - .attrs = bt_link_attrs, - }; - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - static const struct attribute_group *bt_link_groups[] = { -+#else -+static struct attribute_group *bt_link_groups[] = { -+#endif - &bt_link_group, - NULL - }; -@@ -140,7 +144,11 @@ void hci_conn_del_sysfs(struct hci_conn - dev = device_find_child(&conn->dev, NULL, __match_tty); - if (!dev) - break; -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) - device_move(dev, NULL, DPM_ORDER_DEV_LAST); -+#else -+ device_move(dev, NULL); -+#endif - put_device(dev); - } - -@@ -378,7 +386,11 @@ static struct attribute_group bt_host_gr - .attrs = bt_host_attrs, - }; - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - static const struct attribute_group *bt_host_groups[] = { -+#else -+static struct attribute_group *bt_host_groups[] = { -+#endif - &bt_host_group, - NULL - }; ---- a/net/bluetooth/hidp/core.c -+++ b/net/bluetooth/hidp/core.c -@@ -380,6 +380,7 @@ err: - return ret; - } - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count, - unsigned char report_type) - { -@@ -438,6 +439,16 @@ err: - mutex_unlock(&session->report_mutex); - return ret; - } -+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) -+static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count) -+{ -+ if (hidp_send_ctrl_message(hid->driver_data, -+ HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE, -+ data, count)) -+ return -ENOMEM; -+ return count; -+} -+#endif - - static void hidp_idle_timeout(unsigned long arg) - { -@@ -739,8 +750,14 @@ static int hidp_session(void *arg) - } - - if (session->hid) { -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - hid_destroy_device(session->hid); - session->hid = NULL; -+#else -+ if (session->hid->claimed & HID_CLAIMED_INPUT) -+ hidinput_disconnect(session->hid); -+ hid_free_device(session->hid); -+#endif - } - - /* Wakeup user-space polling for socket errors */ -@@ -851,6 +868,70 @@ static void hidp_close(struct hid_device - { - } - -+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)) -+static const struct { -+ __u16 idVendor; -+ __u16 idProduct; -+ unsigned quirks; -+} hidp_blacklist[] = { -+ /* Apple wireless Mighty Mouse */ -+ { 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, -+ -+ { } /* Terminating entry */ -+}; -+static void hidp_setup_quirks(struct hid_device *hid) -+{ -+ unsigned int n; -+ -+ for (n = 0; hidp_blacklist[n].idVendor; n++) -+ if (hidp_blacklist[n].idVendor == le16_to_cpu(hid->vendor) && -+ hidp_blacklist[n].idProduct == le16_to_cpu(hid->product)) -+ hid->quirks = hidp_blacklist[n].quirks; -+} -+ -+static void hidp_setup_hid(struct hidp_session *session, -+ struct hidp_connadd_req *req) -+{ -+ struct hid_device *hid = session->hid; -+ struct hid_report *report; -+ bdaddr_t src, dst; -+ -+ session->hid = hid; -+ -+ hid->driver_data = session; -+ -+ baswap(&src, &bt_sk(session->ctrl_sock->sk)->src); -+ baswap(&dst, &bt_sk(session->ctrl_sock->sk)->dst); -+ -+ hid->bus = BUS_BLUETOOTH; -+ hid->vendor = req->vendor; -+ hid->product = req->product; -+ hid->version = req->version; -+ hid->country = req->country; -+ -+ strncpy(hid->name, req->name, 128); -+ strncpy(hid->phys, batostr(&src), 64); -+ strncpy(hid->uniq, batostr(&dst), 64); -+ -+ hid->dev = hidp_get_device(session); -+ hid->hid_open = hidp_open; -+ hid->hid_close = hidp_close; -+ -+ hid->hidinput_input_event = hidp_hidinput_event; -+ -+ hidp_setup_quirks(hid); -+ -+ list_for_each_entry(report, &hid->report_enum[HID_INPUT_REPORT].report_list, list) -+ hidp_send_report(session, report); -+ -+ list_for_each_entry(report, &hid->report_enum[HID_FEATURE_REPORT].report_list, list) -+ hidp_send_report(session, report); -+ -+ if (hidinput_connect(hid) == 0) -+ hid->claimed |= HID_CLAIMED_INPUT; -+} -+#else -+ - static int hidp_parse(struct hid_device *hid) - { - struct hidp_session *session = hid->driver_data; -@@ -942,7 +1023,9 @@ static int hidp_setup_hid(struct hidp_se - hid->dev.parent = &session->conn->dev; - hid->ll_driver = &hidp_hid_driver; - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) - hid->hid_get_raw_report = hidp_get_raw_report; -+#endif - hid->hid_output_raw_report = hidp_output_raw_report; - - return 0; -@@ -953,6 +1036,7 @@ fault: - - return err; - } -+#endif - - int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock) - { -@@ -968,6 +1052,39 @@ int hidp_add_connection(struct hidp_conn - - BT_DBG("rd_data %p rd_size %d", req->rd_data, req->rd_size); - -+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)) -+ if (req->rd_size > 0) { -+ unsigned char *buf = kmalloc(req->rd_size, GFP_KERNEL); -+ -+ if (!buf) { -+ kfree(session); -+ return -ENOMEM; -+ } -+ -+ if (copy_from_user(buf, req->rd_data, req->rd_size)) { -+ kfree(buf); -+ kfree(session); -+ return -EFAULT; -+ } -+ -+ session->hid = hid_parse_report(buf, req->rd_size); -+ -+ kfree(buf); -+ -+ if (!session->hid) { -+ kfree(session); -+ return -EINVAL; -+ } -+ } -+ -+ if (!session->hid) { -+ session->input = input_allocate_device(); -+ if (!session->input) { -+ kfree(session); -+ return -ENOMEM; -+ } -+ } -+#endif - down_write(&hidp_session_sem); - - s = __hidp_get_session(&bt_sk(ctrl_sock->sk)->dst); -@@ -1015,6 +1132,7 @@ int hidp_add_connection(struct hidp_conn - - __hidp_link_session(session); - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - if (req->rd_size > 0) { - err = hidp_setup_hid(session, req); - if (err) -@@ -1026,6 +1144,16 @@ int hidp_add_connection(struct hidp_conn - if (err < 0) - goto purge; - } -+#else -+ if (session->input) { -+ err = hidp_setup_input(session, req); -+ if (err < 0) -+ goto failed; -+ } -+ -+ if (session->hid) -+ hidp_setup_hid(session, req); -+#endif - - hidp_set_timer(session); - -@@ -1084,6 +1212,7 @@ unlink: - session->input = NULL; - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - if (session->hid) { - hid_destroy_device(session->hid); - session->hid = NULL; -@@ -1097,10 +1226,15 @@ purge: - - skb_queue_purge(&session->ctrl_transmit); - skb_queue_purge(&session->intr_transmit); -+#endif - - failed: - up_write(&hidp_session_sem); - -+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)) -+ if (session->hid) -+ hid_free_device(session->hid); -+#endif - kfree(session); - return err; - } ---- a/net/bluetooth/rfcomm/sock.c -+++ b/net/bluetooth/rfcomm/sock.c -@@ -306,8 +306,13 @@ static struct sock *rfcomm_sock_alloc(st - return sk; - } - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int rfcomm_sock_create(struct net *net, struct socket *sock, - int protocol, int kern) -+#else -+static int rfcomm_sock_create(struct net *net, struct socket *sock, -+ int protocol) -+#endif - { - struct sock *sk; - -@@ -662,7 +667,11 @@ static int rfcomm_sock_setsockopt_old(st - return err; - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) -+#else -+static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) -+#endif - { - struct sock *sk = sock->sk; - struct bt_security sec; ---- a/net/bluetooth/rfcomm/tty.c -+++ b/net/bluetooth/rfcomm/tty.c -@@ -713,8 +713,12 @@ static int rfcomm_tty_open(struct tty_st - remove_wait_queue(&dev->wait, &wait); - - if (err == 0) -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) - device_move(dev->tty_dev, rfcomm_get_device(dev), - DPM_ORDER_DEV_AFTER_PARENT); -+#else -+ device_move(dev->tty_dev, rfcomm_get_device(dev)); -+#endif - - rfcomm_tty_copy_pending(dev); - -@@ -738,7 +742,11 @@ static void rfcomm_tty_close(struct tty_ - if (!--dev->port.count) { - spin_unlock_irqrestore(&dev->port.lock, flags); - if (dev->tty_dev->parent) -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) - device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST); -+#else -+ device_move(dev->tty_dev, NULL); -+#endif - - /* Close DLC and dettach TTY */ - rfcomm_dlc_close(dev->dlc, 0); -@@ -814,7 +822,11 @@ static int rfcomm_tty_write_room(struct - return room; - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) - static int rfcomm_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) -+#else -+static int rfcomm_tty_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, unsigned long arg) -+#endif - { - BT_DBG("tty %p cmd 0x%02x", tty, cmd); - -@@ -1073,7 +1085,11 @@ static void rfcomm_tty_hangup(struct tty - } - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) - static int rfcomm_tty_tiocmget(struct tty_struct *tty) -+#else -+static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp) -+#endif - { - struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; - -@@ -1082,7 +1098,11 @@ static int rfcomm_tty_tiocmget(struct tt - return dev->modem_status; - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) - static int rfcomm_tty_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) -+#else -+static int rfcomm_tty_tiocmset(struct tty_struct *tty, struct file *filp, unsigned int set, unsigned int clear) -+#endif - { - struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; - struct rfcomm_dlc *dlc = dev->dlc; ---- a/net/bluetooth/sco.c -+++ b/net/bluetooth/sco.c -@@ -433,8 +433,12 @@ static struct sock *sco_sock_alloc(struc - return sk; - } - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int sco_sock_create(struct net *net, struct socket *sock, int protocol, - int kern) -+#else -+static int sco_sock_create(struct net *net, struct socket *sock, int protocol) -+#endif - { - struct sock *sk; - -@@ -685,7 +689,11 @@ static int sco_sock_recvmsg(struct kiocb - return bt_sock_recvmsg(iocb, sock, msg, len, flags); - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) -+#else -+static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) -+#endif - { - struct sock *sk = sock->sk; - int err = 0; ---- a/net/bluetooth/bnep/sock.c -+++ b/net/bluetooth/bnep/sock.c -@@ -186,8 +186,12 @@ static struct proto bnep_proto = { - .obj_size = sizeof(struct bt_sock) - }; - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int bnep_sock_create(struct net *net, struct socket *sock, int protocol, - int kern) -+#else -+static int bnep_sock_create(struct net *net, struct socket *sock, int protocol) -+#endif - { - struct sock *sk; - ---- a/net/bluetooth/cmtp/sock.c -+++ b/net/bluetooth/cmtp/sock.c -@@ -195,8 +195,12 @@ static struct proto cmtp_proto = { - .obj_size = sizeof(struct bt_sock) - }; - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol, - int kern) -+#else -+static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol) -+#endif - { - struct sock *sk; - ---- a/net/bluetooth/hidp/sock.c -+++ b/net/bluetooth/hidp/sock.c -@@ -235,8 +235,12 @@ static struct proto hidp_proto = { - .obj_size = sizeof(struct bt_sock) - }; - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int hidp_sock_create(struct net *net, struct socket *sock, int protocol, - int kern) -+#else -+static int hidp_sock_create(struct net *net, struct socket *sock, int protocol) -+#endif - { - struct sock *sk; - ---- a/net/bluetooth/l2cap_sock.c -+++ b/net/bluetooth/l2cap_sock.c -@@ -573,8 +573,13 @@ static int l2cap_sock_setsockopt_old(str - return err; - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) - static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, - char __user *optval, unsigned int optlen) -+#else -+static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, -+ char __user *optval, int optlen) -+#endif - { - struct sock *sk = sock->sk; - struct l2cap_chan *chan = l2cap_pi(sk)->chan; -@@ -1225,8 +1230,12 @@ static struct sock *l2cap_sock_alloc(str - return sk; - } - -+#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) - static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol, - int kern) -+#else -+static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol) -+#endif - { - struct sock *sk; - -@@ -1238,7 +1247,11 @@ static int l2cap_sock_create(struct net - sock->type != SOCK_DGRAM && sock->type != SOCK_RAW) - return -ESOCKTNOSUPPORT; - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) - if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW)) -+#else -+ if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW)) -+#endif - return -EPERM; - - sock->ops = &l2cap_sock_ops; diff --git a/patches/network/17-netdev-queue.patch b/patches/network/17-netdev-queue.patch deleted file mode 100644 index af10e5a739bd..000000000000 --- a/patches/network/17-netdev-queue.patch +++ /dev/null @@ -1,47 +0,0 @@ -This patch addresses changes made by usage of new symbols -like unregister_netdevice_queue() which are not possible to backport -due to their reliance on internal symbols on net/core/dev.c - -The patch that introduced this on mac80211 was: - - mac80211: Speedup ieee80211_remove_interfaces() - - Speedup ieee80211_remove_interfaces() by factorizing synchronize_rcu() calls - - Signed-off-by: Eric Dumazet - Reviewed-by: Johannes Berg - Signed-off-by: John W. Linville - ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1613,6 +1613,7 @@ void ieee80211_sdata_stop(struct ieee802 - * Remove all interfaces, may only be called at hardware unregistration - * time because it doesn't do RCU-safe list removals. - */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) - void ieee80211_remove_interfaces(struct ieee80211_local *local) - { - struct ieee80211_sub_if_data *sdata, *tmp; -@@ -1640,6 +1641,22 @@ void ieee80211_remove_interfaces(struct - kfree(sdata); - } - } -+#else -+void ieee80211_remove_interfaces(struct ieee80211_local *local) -+{ -+ struct ieee80211_sub_if_data *sdata, *tmp; -+ -+ ASSERT_RTNL(); -+ -+ list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { -+ mutex_lock(&local->iflist_mtx); -+ list_del(&sdata->list); -+ mutex_unlock(&local->iflist_mtx); -+ -+ unregister_netdevice(sdata->dev); -+ } -+} -+#endif - - static int netdev_notify(struct notifier_block *nb, - unsigned long state, diff --git a/patches/network/18-rename-usb-net-symbols.patch b/patches/network/18-rename-usb-net-symbols.patch deleted file mode 100644 index ada786f0b23f..000000000000 --- a/patches/network/18-rename-usb-net-symbols.patch +++ /dev/null @@ -1,53 +0,0 @@ -Rename config names for usbnet to deactivate them also if activated in -the main kernel configuration. This is needed because -usb_autopm_put_interface_async and usb_autopm_get_interface_async are -not backported to kernel 2.6.28 and earlier. -Remove this patch if these symbols are backported. - ---- a/drivers/net/usb/Makefile -+++ b/drivers/net/usb/Makefile -@@ -9,7 +9,7 @@ obj-$(CONFIG_USB_RTL8150) += rtl8150.o - obj-$(CONFIG_USB_HSO) += hso.o - obj-$(CONFIG_USB_NET_AX8817X) += asix.o - asix-y := asix_devices.o asix_common.o ax88172a.o --obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o -+obj-$(CONFIG_USB_NET_COMPAT_CDCETHER) += cdc_ether.o - obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o - obj-$(CONFIG_USB_NET_DM9601) += dm9601.o - obj-$(CONFIG_USB_NET_SMSC75XX) += smsc75xx.o -@@ -17,11 +17,11 @@ obj-$(CONFIG_USB_NET_SMSC95XX) += smsc95 - obj-$(CONFIG_USB_NET_GL620A) += gl620a.o - obj-$(CONFIG_USB_NET_NET1080) += net1080.o - obj-$(CONFIG_USB_NET_PLUSB) += plusb.o --obj-$(CONFIG_USB_NET_RNDIS_HOST) += rndis_host.o -+obj-$(CONFIG_USB_NET_COMPAT_RNDIS_HOST) += rndis_host.o - obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o - obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o - obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o --obj-$(CONFIG_USB_USBNET) += usbnet.o -+obj-$(CONFIG_USB_COMPAT_USBNET) += usbnet.o - obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o - obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o - obj-$(CONFIG_USB_NET_KALMIA) += kalmia.o ---- a/drivers/net/usb/cdc_ether.c -+++ b/drivers/net/usb/cdc_ether.c -@@ -33,7 +33,7 @@ - #include - - --#if defined(CONFIG_USB_NET_RNDIS_HOST) || defined(CONFIG_USB_NET_RNDIS_HOST_MODULE) -+#if defined(CONFIG_USB_NET_COMPAT_RNDIS_HOST) || defined(CONFIG_USB_NET_COMPAT_RNDIS_HOST_MODULE) - - static int is_rndis(struct usb_interface_descriptor *desc) - { ---- a/drivers/net/wireless/Makefile -+++ b/drivers/net/wireless/Makefile -@@ -30,7 +30,7 @@ obj-$(CONFIG_RTLWIFI) += rtlwifi/ - obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o - obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o - --obj-$(CONFIG_USB_NET_RNDIS_WLAN) += rndis_wlan.o -+obj-$(CONFIG_USB_NET_COMPAT_RNDIS_WLAN) += rndis_wlan.o - - obj-$(CONFIG_USB_ZD1201) += zd1201.o - obj-$(CONFIG_LIBERTAS) += libertas/ diff --git a/patches/network/21-capi-proc_fops.patch b/patches/network/21-capi-proc_fops.patch deleted file mode 100644 index 7dc92f401c98..000000000000 --- a/patches/network/21-capi-proc_fops.patch +++ /dev/null @@ -1,73 +0,0 @@ -Backport kernel patch 9a58a80a701bdb2d220cdab4914218df5b48d781 -proc_fops: convert drivers/isdn/ to seq_file - ---- a/net/bluetooth/cmtp/capi.c -+++ b/net/bluetooth/cmtp/capi.c -@@ -21,8 +21,10 @@ - */ - - #include -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - #include - #include -+#endif - #include - #include - #include -@@ -522,6 +524,7 @@ static char *cmtp_procinfo(struct capi_c - return "CAPI Message Transport Protocol"; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - static int cmtp_proc_show(struct seq_file *m, void *v) - { - struct capi_ctr *ctrl = m->private; -@@ -554,6 +557,36 @@ static const struct file_operations cmtp - .release = single_release, - }; - -+#else -+ -+static int cmtp_ctr_read_proc(char *page, char **start, off_t off, int count, int *eof, struct capi_ctr *ctrl) -+{ -+ struct cmtp_session *session = ctrl->driverdata; -+ struct cmtp_application *app; -+ struct list_head *p, *n; -+ int len = 0; -+ -+ len += sprintf(page + len, "%s\n\n", cmtp_procinfo(ctrl)); -+ len += sprintf(page + len, "addr %s\n", session->name); -+ len += sprintf(page + len, "ctrl %d\n", session->num); -+ -+ list_for_each_safe(p, n, &session->applications) { -+ app = list_entry(p, struct cmtp_application, list); -+ len += sprintf(page + len, "appl %d -> %d\n", app->appl, app->mapping); -+ } -+ -+ if (off + count >= len) -+ *eof = 1; -+ -+ if (len < off) -+ return 0; -+ -+ *start = page + off; -+ -+ return ((count < len - off) ? count : len - off); -+} -+#endif -+ - int cmtp_attach_device(struct cmtp_session *session) - { - unsigned char buf[4]; -@@ -592,7 +625,11 @@ int cmtp_attach_device(struct cmtp_sessi - session->ctrl.send_message = cmtp_send_message; - - session->ctrl.procinfo = cmtp_procinfo; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - session->ctrl.proc_fops = &cmtp_proc_fops; -+#else -+ session->ctrl.ctr_read_proc = cmtp_ctr_read_proc; -+#endif - - if (attach_capi_ctr(&session->ctrl) < 0) { - BT_ERR("Can't attach new controller"); diff --git a/patches/network/22-multiqueue.patch b/patches/network/22-multiqueue.patch deleted file mode 100644 index 34c297815ffd..000000000000 --- a/patches/network/22-multiqueue.patch +++ /dev/null @@ -1,43 +0,0 @@ -Backport multiqueue support for kernels 2.6.23-27 - -The 2.6.23 kernel added some initial multiqueue support. -That release relied on the on the notion of struct -net_device_subqueue attached to the netdevice struct -as an array. The 2.6.27 renamed these to struct netdev_queue, -and enhanced MQ support by providing locks separately onto -each queue. MQ support on 2.6.27 also extended each netdev -to be able to assign a select_queue callback to be used by -core networking for prior to pushing the skb out to the device -driver so that queue selection can be dealt with and -customized internally on the driver. - -For kernels 2.6.23..2.6.26 then we backport MQ support by -using the equivalent calls on the struct netdev_queue to -the struct net_device_subqueue. The performance penalty -here is just that all these queues share a common lock -so stateful operations on one queue would imply a delay -on other queues. - -The select_queue callback was only added as of 2.6.27 via -commit eae792b7 so for kernels 2.6.23 up to 2.6.27 we must -ensure we do the selection of the queue once the core -networking calls mac80211's dev_hard_start_xmit() -(ndo_start_xmit() callback on newer kernels). - -This patch thus only addresses the lack of select_queue on -kernels older than 2.6.27, naming differences are handled -in compat. - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -1480,6 +1480,10 @@ void ieee80211_xmit(struct ieee80211_sub - return; - } - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) -+ /* Older kernels do not have the select_queue callback */ -+ skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb)); -+#endif - ieee80211_set_qos_hdr(sdata, skb); - ieee80211_tx(sdata, skb, false, band); - } diff --git a/patches/network/24-pcmcia.patch b/patches/network/24-pcmcia.patch deleted file mode 100644 index 634c44764d22..000000000000 --- a/patches/network/24-pcmcia.patch +++ /dev/null @@ -1,1414 +0,0 @@ ---- a/drivers/bluetooth/bluecard_cs.c -+++ b/drivers/bluetooth/bluecard_cs.c -@@ -158,7 +158,12 @@ static void bluecard_detach(struct pcmci - static void bluecard_activity_led_timeout(u_long arg) - { - bluecard_info_t *info = (bluecard_info_t *)arg; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif -+ - - if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) - return; -@@ -175,7 +180,11 @@ static void bluecard_activity_led_timeou - - static void bluecard_enable_activity_led(bluecard_info_t *info) - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - - if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) - return; -@@ -231,7 +240,11 @@ static void bluecard_write_wakeup(blueca - } - - do { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - unsigned int offset; - unsigned char command; - unsigned long ready_bit; -@@ -378,7 +391,11 @@ static void bluecard_receive(bluecard_in - return; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - if (test_bit(XMIT_SENDING_READY, &(info->tx_state))) - bluecard_enable_activity_led(info); -@@ -507,7 +524,11 @@ static irqreturn_t bluecard_interrupt(in - if (!test_bit(CARD_READY, &(info->hw_state))) - return IRQ_HANDLED; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - spin_lock(&(info->lock)); - -@@ -629,7 +650,11 @@ static int bluecard_hci_open(struct hci_ - return 0; - - if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - - /* Enable LED */ - outb(0x08 | 0x20, iobase + 0x30); -@@ -649,7 +674,11 @@ static int bluecard_hci_close(struct hci - bluecard_hci_flush(hdev); - - if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - - /* Disable LED */ - outb(0x00, iobase + 0x30); -@@ -705,7 +734,11 @@ static int bluecard_hci_ioctl(struct hci - - static int bluecard_open(bluecard_info_t *info) - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - struct hci_dev *hdev; - unsigned char id; - -@@ -821,7 +854,11 @@ static int bluecard_open(bluecard_info_t - - static int bluecard_close(bluecard_info_t *info) - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - struct hci_dev *hdev = info->hdev; - - if (!hdev) -@@ -856,7 +893,18 @@ static int bluecard_probe(struct pcmcia_ - info->p_dev = link; - link->priv = info; - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; -+ -+ link->irq.Handler = bluecard_interrupt; -+#endif -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - link->config_flags |= CONF_ENABLE_IRQ; -+#else -+ link->conf.Attributes = CONF_ENABLE_IRQ; -+ link->conf.IntType = INT_MEMORY_AND_IO; -+#endif - - return bluecard_config(link); - } -@@ -873,15 +921,30 @@ static int bluecard_config(struct pcmcia - bluecard_info_t *info = link->priv; - int i, n; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - link->config_index = 0x20; -+#else -+ link->conf.ConfigIndex = 0x20; -+#endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; - link->resource[0]->end = 64; - link->io_lines = 6; -+#else -+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; -+ link->io.NumPorts1 = 64; -+ link->io.IOAddrLines = 6; -+#endif - - for (n = 0; n < 0x400; n += 0x40) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - link->resource[0]->start = n ^ 0x300; - i = pcmcia_request_io(link); -+#else -+ link->io.BasePort1 = n ^ 0x300; -+ i = pcmcia_request_io(link, &link->io); -+#endif - if (i == 0) - break; - } -@@ -889,9 +952,15 @@ static int bluecard_config(struct pcmcia - if (i != 0) - goto failed; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - i = pcmcia_request_irq(link, bluecard_interrupt); - if (i != 0) - goto failed; -+#else -+ i = pcmcia_request_irq(link, &link->irq); -+ if (i != 0) -+ link->irq.AssignedIRQ = 0; -+#endif - - i = pcmcia_enable_device(link); - if (i != 0) -@@ -929,7 +998,13 @@ MODULE_DEVICE_TABLE(pcmcia, bluecard_ids - - static struct pcmcia_driver bluecard_driver = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - .name = "bluecard_cs", -+#else -+ .drv = { -+ .name = "bluecard_cs", -+ }, -+#endif - .probe = bluecard_probe, - .remove = bluecard_detach, - .id_table = bluecard_ids, ---- a/drivers/bluetooth/bt3c_cs.c -+++ b/drivers/bluetooth/bt3c_cs.c -@@ -186,7 +186,11 @@ static void bt3c_write_wakeup(bt3c_info_ - return; - - do { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - register struct sk_buff *skb; - int len; - -@@ -224,7 +228,11 @@ static void bt3c_receive(bt3c_info_t *in - return; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - avail = bt3c_read(iobase, 0x7006); - //printk("bt3c_cs: receiving %d bytes\n", avail); -@@ -345,7 +353,11 @@ static irqreturn_t bt3c_interrupt(int ir - /* our irq handler is shared */ - return IRQ_NONE; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - spin_lock(&(info->lock)); - -@@ -473,7 +485,11 @@ static int bt3c_load_firmware(bt3c_info_ - unsigned int iobase, size, addr, fcs, tmp; - int i, err = 0; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - /* Reset */ - bt3c_io_write(iobase, 0x8040, 0x0404); -@@ -645,8 +661,27 @@ static int bt3c_probe(struct pcmcia_devi - info->p_dev = link; - link->priv = info; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | - CONF_AUTO_SET_IO; -+#else -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; -+ link->resource[0]->end = 8; -+#else -+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; -+ link->io.NumPorts1= 8; -+#endif -+ -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; -+ -+ link->irq.Handler = bt3c_interrupt; -+#endif -+ -+ link->conf.Attributes = CONF_ENABLE_IRQ; -+ link->conf.IntType = INT_MEMORY_AND_IO; -+#endif - - return bt3c_config(link); - } -@@ -657,6 +692,7 @@ static void bt3c_detach(struct pcmcia_de - bt3c_release(link); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data) - { - int *try = priv_data; -@@ -695,6 +731,63 @@ static int bt3c_check_config_notpicky(st - } - return -ENODEV; - } -+#else -+static int bt3c_check_config(struct pcmcia_device *p_dev, -+ cistpl_cftable_entry_t *cf, -+ cistpl_cftable_entry_t *dflt, -+ unsigned int vcc, -+ void *priv_data) -+{ -+ unsigned long try = (unsigned long) priv_data; -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; -+#endif -+ -+ if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) -+ p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; -+ if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && -+ (cf->io.win[0].base != 0)) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ p_dev->resource[0]->start = cf->io.win[0].base; -+ if (!pcmcia_request_io(p_dev)) -+#else -+ p_dev->io.BasePort1 = cf->io.win[0].base; -+ p_dev->io.IOAddrLines = (try == 0) ? 16 : -+ cf->io.flags & CISTPL_IO_LINES_MASK; -+ if (!pcmcia_request_io(p_dev, &p_dev->io)) -+#endif -+ return 0; -+ } -+ return -ENODEV; -+} -+ -+static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev, -+ cistpl_cftable_entry_t *cf, -+ cistpl_cftable_entry_t *dflt, -+ unsigned int vcc, -+ void *priv_data) -+{ -+ static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; -+ int j; -+ -+ if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { -+ for (j = 0; j < 5; j++) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ p_dev->resource[0]->start = base[j]; -+ p_dev->io_lines = base[j] ? 16 : 3; -+ if (!pcmcia_request_io(p_dev)) -+#else -+ p_dev->io.BasePort1 = base[j]; -+ p_dev->io.IOAddrLines = base[j] ? 16 : 3; -+ if (!pcmcia_request_io(p_dev, &p_dev->io)) -+#endif -+ return 0; -+ } -+ } -+ return -ENODEV; -+} -+#endif - - static int bt3c_config(struct pcmcia_device *link) - { -@@ -718,9 +811,15 @@ static int bt3c_config(struct pcmcia_dev - goto failed; - - found_port: -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - i = pcmcia_request_irq(link, &bt3c_interrupt); - if (i != 0) - goto failed; -+#else -+ i = pcmcia_request_irq(link, &link->irq); -+ if (i != 0) -+ link->irq.AssignedIRQ = 0; -+#endif - - i = pcmcia_enable_device(link); - if (i != 0) -@@ -755,7 +854,13 @@ MODULE_DEVICE_TABLE(pcmcia, bt3c_ids); - - static struct pcmcia_driver bt3c_driver = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - .name = "bt3c_cs", -+#else -+ .drv = { -+ .name = "bt3c_cs", -+ }, -+#endif - .probe = bt3c_probe, - .remove = bt3c_detach, - .id_table = bt3c_ids, ---- a/drivers/bluetooth/btuart_cs.c -+++ b/drivers/bluetooth/btuart_cs.c -@@ -140,7 +140,11 @@ static void btuart_write_wakeup(btuart_i - } - - do { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - register struct sk_buff *skb; - int len; - -@@ -181,7 +185,11 @@ static void btuart_receive(btuart_info_t - return; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - do { - info->hdev->stat.byte_rx++; -@@ -295,7 +303,11 @@ static irqreturn_t btuart_interrupt(int - /* our irq handler is shared */ - return IRQ_NONE; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - spin_lock(&(info->lock)); - -@@ -352,7 +364,11 @@ static void btuart_change_speed(btuart_i - return; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - spin_lock_irqsave(&(info->lock), flags); - -@@ -471,7 +487,11 @@ static int btuart_hci_ioctl(struct hci_d - static int btuart_open(btuart_info_t *info) - { - unsigned long flags; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - struct hci_dev *hdev; - - spin_lock_init(&(info->lock)); -@@ -538,7 +558,11 @@ static int btuart_open(btuart_info_t *in - static int btuart_close(btuart_info_t *info) - { - unsigned long flags; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - struct hci_dev *hdev = info->hdev; - - if (!hdev) -@@ -574,8 +598,27 @@ static int btuart_probe(struct pcmcia_de - info->p_dev = link; - link->priv = info; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | - CONF_AUTO_SET_IO; -+#else -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; -+ link->resource[0]->end = 8; -+#else -+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; -+ link->io.NumPorts1= 8; -+#endif -+ -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; -+ -+ link->irq.Handler = btuart_interrupt; -+#endif -+ -+ link->conf.Attributes = CONF_ENABLE_IRQ; -+ link->conf.IntType = INT_MEMORY_AND_IO; -+#endif - - return btuart_config(link); - } -@@ -586,6 +629,7 @@ static void btuart_detach(struct pcmcia_ - btuart_release(link); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data) - { - int *try = priv_data; -@@ -624,6 +668,63 @@ static int btuart_check_config_notpicky( - } - return -ENODEV; - } -+#else -+static int btuart_check_config(struct pcmcia_device *p_dev, -+ cistpl_cftable_entry_t *cf, -+ cistpl_cftable_entry_t *dflt, -+ unsigned int vcc, -+ void *priv_data) -+{ -+ int *try = priv_data; -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; -+#endif -+ -+ if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) -+ p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; -+ if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && -+ (cf->io.win[0].base != 0)) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ p_dev->resource[0]->start = cf->io.win[0].base; -+ if (!pcmcia_request_io(p_dev)) -+#else -+ p_dev->io.BasePort1 = cf->io.win[0].base; -+ p_dev->io.IOAddrLines = (*try == 0) ? 16 : -+ cf->io.flags & CISTPL_IO_LINES_MASK; -+ if (!pcmcia_request_io(p_dev, &p_dev->io)) -+#endif -+ return 0; -+ } -+ return -ENODEV; -+} -+ -+static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, -+ cistpl_cftable_entry_t *cf, -+ cistpl_cftable_entry_t *dflt, -+ unsigned int vcc, -+ void *priv_data) -+{ -+ static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; -+ int j; -+ -+ if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { -+ for (j = 0; j < 5; j++) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ p_dev->resource[0]->start = base[j]; -+ p_dev->io_lines = base[j] ? 16 : 3; -+ if (!pcmcia_request_io(p_dev)) -+#else -+ p_dev->io.BasePort1 = base[j]; -+ p_dev->io.IOAddrLines = base[j] ? 16 : 3; -+ if (!pcmcia_request_io(p_dev, &p_dev->io)) -+#endif -+ return 0; -+ } -+ } -+ return -ENODEV; -+} -+#endif - - static int btuart_config(struct pcmcia_device *link) - { -@@ -647,9 +748,15 @@ static int btuart_config(struct pcmcia_d - goto failed; - - found_port: -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - i = pcmcia_request_irq(link, btuart_interrupt); - if (i != 0) - goto failed; -+#else -+ i = pcmcia_request_irq(link, &link->irq); -+ if (i != 0) -+ link->irq.AssignedIRQ = 0; -+#endif - - i = pcmcia_enable_device(link); - if (i != 0) -@@ -683,7 +790,13 @@ MODULE_DEVICE_TABLE(pcmcia, btuart_ids); - - static struct pcmcia_driver btuart_driver = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - .name = "btuart_cs", -+#else -+ .drv = { -+ .name = "btuart_cs", -+ }, -+#endif - .probe = btuart_probe, - .remove = btuart_detach, - .id_table = btuart_ids, ---- a/drivers/bluetooth/dtl1_cs.c -+++ b/drivers/bluetooth/dtl1_cs.c -@@ -144,7 +144,11 @@ static void dtl1_write_wakeup(dtl1_info_ - } - - do { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - register struct sk_buff *skb; - int len; - -@@ -209,7 +213,11 @@ static void dtl1_receive(dtl1_info_t *in - return; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - do { - info->hdev->stat.byte_rx++; -@@ -296,7 +304,11 @@ static irqreturn_t dtl1_interrupt(int ir - /* our irq handler is shared */ - return IRQ_NONE; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - iobase = info->p_dev->resource[0]->start; -+#else -+ iobase = info->p_dev->io.BasePort1; -+#endif - - spin_lock(&(info->lock)); - -@@ -451,7 +463,11 @@ static int dtl1_hci_ioctl(struct hci_dev - static int dtl1_open(dtl1_info_t *info) - { - unsigned long flags; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - struct hci_dev *hdev; - - spin_lock_init(&(info->lock)); -@@ -495,8 +511,13 @@ static int dtl1_open(dtl1_info_t *info) - outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */ - outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - info->ri_latch = inb(info->p_dev->resource[0]->start + UART_MSR) - & UART_MSR_RI; -+#else -+ info->ri_latch = inb(info->p_dev->io.BasePort1 + UART_MSR) -+ & UART_MSR_RI; -+#endif - - /* Turn on interrupts */ - outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER); -@@ -521,7 +542,11 @@ static int dtl1_open(dtl1_info_t *info) - static int dtl1_close(dtl1_info_t *info) - { - unsigned long flags; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - unsigned int iobase = info->p_dev->resource[0]->start; -+#else -+ unsigned int iobase = info->p_dev->io.BasePort1; -+#endif - struct hci_dev *hdev = info->hdev; - - if (!hdev) -@@ -557,7 +582,24 @@ static int dtl1_probe(struct pcmcia_devi - info->p_dev = link; - link->priv = info; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; -+#else -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; -+ link->resource[0]->end = 8; -+#else -+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; -+ link->io.NumPorts1= 8; -+#endif -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; -+ link->irq.Handler = dtl1_interrupt; -+#endif -+ -+ link->conf.Attributes = CONF_ENABLE_IRQ; -+ link->conf.IntType = INT_MEMORY_AND_IO; -+#endif - - return dtl1_config(link); - } -@@ -571,6 +613,7 @@ static void dtl1_detach(struct pcmcia_de - pcmcia_disable_device(link); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) - { - if ((p_dev->resource[1]->end) || (p_dev->resource[1]->end < 8)) -@@ -581,6 +624,29 @@ static int dtl1_confcheck(struct pcmcia_ - - return pcmcia_request_io(p_dev); - } -+#else -+static int dtl1_confcheck(struct pcmcia_device *p_dev, -+ cistpl_cftable_entry_t *cf, -+ cistpl_cftable_entry_t *dflt, -+ unsigned int vcc, -+ void *priv_data) -+{ -+ if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8)) -+ return -ENODEV; -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ p_dev->resource[0]->start = cf->io.win[0].base; -+ p_dev->resource[0]->end = cf->io.win[0].len; /*yo */ -+ p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK; -+ return pcmcia_request_io(p_dev); -+#else -+ p_dev->io.BasePort1 = cf->io.win[0].base; -+ p_dev->io.NumPorts1 = cf->io.win[0].len; /*yo */ -+ p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; -+ return pcmcia_request_io(p_dev, &p_dev->io); -+#endif -+} -+#endif - - static int dtl1_config(struct pcmcia_device *link) - { -@@ -588,14 +654,24 @@ static int dtl1_config(struct pcmcia_dev - int ret; - - /* Look for a generic full-sized window */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - link->resource[0]->end = 8; -+#else -+ link->io.NumPorts1 = 8; -+#endif - ret = pcmcia_loop_config(link, dtl1_confcheck, NULL); - if (ret) - goto failed; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ret = pcmcia_request_irq(link, dtl1_interrupt); - if (ret) - goto failed; -+#else -+ ret = pcmcia_request_irq(link, &link->irq); -+ if (ret != 0) -+ link->irq.AssignedIRQ = 0; -+#endif - - ret = pcmcia_enable_device(link); - if (ret) -@@ -623,7 +699,13 @@ MODULE_DEVICE_TABLE(pcmcia, dtl1_ids); - - static struct pcmcia_driver dtl1_driver = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - .name = "dtl1_cs", -+#else -+ .drv = { -+ .name = "dtl1_cs", -+ }, -+#endif - .probe = dtl1_probe, - .remove = dtl1_detach, - .id_table = dtl1_ids, ---- a/drivers/net/wireless/b43/pcmcia.c -+++ b/drivers/net/wireless/b43/pcmcia.c -@@ -63,6 +63,9 @@ static int b43_pcmcia_resume(struct pcmc - static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) - { - struct ssb_bus *ssb; -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) -+ win_req_t win; -+#endif - int err = -ENOMEM; - int res = 0; - -@@ -72,6 +75,7 @@ static int __devinit b43_pcmcia_probe(st - - err = -ENODEV; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - dev->config_flags |= CONF_ENABLE_IRQ; - - dev->resource[2]->flags |= WIN_ENABLE | WIN_DATA_WIDTH_16 | -@@ -79,21 +83,46 @@ static int __devinit b43_pcmcia_probe(st - dev->resource[2]->start = 0; - dev->resource[2]->end = SSB_CORE_SIZE; - res = pcmcia_request_window(dev, dev->resource[2], 250); -+#else -+ dev->conf.Attributes = CONF_ENABLE_IRQ; -+ dev->conf.IntType = INT_MEMORY_AND_IO; -+ -+ win.Attributes = WIN_ENABLE | WIN_DATA_WIDTH_16 | -+ WIN_USE_WAIT; -+ win.Base = 0; -+ win.Size = SSB_CORE_SIZE; -+ win.AccessSpeed = 250; -+ res = pcmcia_request_window(dev, &win, &dev->win); -+#endif - if (res != 0) - goto err_kfree_ssb; -- -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - res = pcmcia_map_mem_page(dev, dev->resource[2], 0); -+#else -+ res = pcmcia_map_mem_page(dev, dev->win, 0); -+#endif - if (res != 0) - goto err_disable; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - if (!dev->irq) -+#else -+ dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; -+ dev->irq.Handler = NULL; /* The handler is registered later. */ -+ res = pcmcia_request_irq(dev, &dev->irq); -+ if (res != 0) -+#endif - goto err_disable; - - res = pcmcia_enable_device(dev); - if (res != 0) - goto err_disable; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - err = ssb_bus_pcmciabus_register(ssb, dev, dev->resource[2]->start); -+#else -+ err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); -+#endif - if (err) - goto err_disable; - dev->priv = ssb; -@@ -122,7 +151,13 @@ static void __devexit b43_pcmcia_remove( - - static struct pcmcia_driver b43_pcmcia_driver = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - .name = "b43-pcmcia", -+#else -+ .drv = { -+ .name = "b43-pcmcia", -+ }, -+#endif - .id_table = b43_pcmcia_tbl, - .probe = b43_pcmcia_probe, - .remove = __devexit_p(b43_pcmcia_remove), ---- a/drivers/net/wireless/libertas/if_cs.c -+++ b/drivers/net/wireless/libertas/if_cs.c -@@ -757,7 +757,11 @@ static void if_cs_prog_firmware(struct l - goto out; - - /* Now actually get the IRQ */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ret = request_irq(card->p_dev->irq, if_cs_interrupt, -+#else -+ ret = request_irq(card->p_dev->irq.AssignedIRQ, if_cs_interrupt, -+#endif - IRQF_SHARED, DRV_NAME, card); - if (ret) { - pr_err("error in request_irq\n"); -@@ -775,7 +779,11 @@ static void if_cs_prog_firmware(struct l - priv->fw_ready = 1; - if (lbs_start_card(priv) != 0) { - pr_err("could not activate card\n"); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - free_irq(card->p_dev->irq, card); -+#else -+ free_irq(card->p_dev->irq.AssignedIRQ, card); -+#endif - } - - out: -@@ -824,7 +832,11 @@ static void if_cs_release(struct pcmcia_ - - lbs_deb_enter(LBS_DEB_CS); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - free_irq(p_dev->irq, card); -+#else -+ free_irq(p_dev->irq.AssignedIRQ, card); -+#endif - pcmcia_disable_device(p_dev); - if (card->iobase) - ioport_unmap(card->iobase); -@@ -832,7 +844,7 @@ static void if_cs_release(struct pcmcia_ - lbs_deb_leave(LBS_DEB_CS); - } - -- -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - static int if_cs_ioprobe(struct pcmcia_device *p_dev, void *priv_data) - { - p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; -@@ -842,9 +854,39 @@ static int if_cs_ioprobe(struct pcmcia_d - pr_err("wrong CIS (check number of IO windows)\n"); - return -ENODEV; - } -+#else -+static int if_cs_ioprobe(struct pcmcia_device *p_dev, -+ cistpl_cftable_entry_t *cfg, -+ cistpl_cftable_entry_t *dflt, -+ unsigned int vcc, -+ void *priv_data) -+{ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) -+ p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; -+ p_dev->resource[0]->start = cfg->io.win[0].base; -+ p_dev->resource[0]->end = cfg->io.win[0].len; -+#else -+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; -+ p_dev->io.BasePort1 = cfg->io.win[0].base; -+ p_dev->io.NumPorts1 = cfg->io.win[0].len; -+#endif -+ -+ /* Do we need to allocate an interrupt? */ -+ p_dev->conf.Attributes |= CONF_ENABLE_IRQ; -+ -+ /* IO window settings */ -+ if (cfg->io.nwin != 1) { -+ pr_err("wrong CIS (check number of IO windows)\n"); -+ return -ENODEV; -+ } -+#endif - - /* This reserves IO space but doesn't actually enable it */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - return pcmcia_request_io(p_dev); -+#else -+ return pcmcia_request_io(p_dev, &p_dev->io); -+#endif - } - - static int if_cs_probe(struct pcmcia_device *p_dev) -@@ -863,7 +905,16 @@ static int if_cs_probe(struct pcmcia_dev - card->p_dev = p_dev; - p_dev->priv = card; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; -+#else -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; -+ p_dev->irq.Handler = NULL; -+#endif -+ p_dev->conf.Attributes = 0; -+ p_dev->conf.IntType = INT_MEMORY_AND_IO; -+#endif - - if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) { - pr_err("error in pcmcia_loop_config\n"); -@@ -875,12 +926,26 @@ static int if_cs_probe(struct pcmcia_dev - * a handler to the interrupt, unless the 'Handler' member of - * the irq structure is initialized. - */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - if (!p_dev->irq) - goto out1; -+#else -+ if (p_dev->conf.Attributes & CONF_ENABLE_IRQ) { -+ ret = pcmcia_request_irq(p_dev, &p_dev->irq); -+ if (ret) { -+ pr_err("error in pcmcia_request_irq\n"); -+ goto out1; -+ } -+ } -+#endif - - /* Initialize io access */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - card->iobase = ioport_map(p_dev->resource[0]->start, - resource_size(p_dev->resource[0])); -+#else -+ card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1); -+#endif - if (!card->iobase) { - pr_err("error in ioport_map\n"); - ret = -EIO; -@@ -894,7 +959,17 @@ static int if_cs_probe(struct pcmcia_dev - } - - /* Finally, report what we've done */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - lbs_deb_cs("irq %d, io %pR", p_dev->irq, p_dev->resource[0]); -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) -+ lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n", -+ p_dev->irq, p_dev->io.BasePort1, -+ p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); -+#else -+ lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n", -+ p_dev->irq.AssignedIRQ, p_dev->io.BasePort1, -+ p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); -+#endif - - /* - * Most of the libertas cards can do unaligned register access, but some -@@ -1002,7 +1077,13 @@ MODULE_DEVICE_TABLE(pcmcia, if_cs_ids); - - static struct pcmcia_driver lbs_driver = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - .name = DRV_NAME, -+#else -+ .drv = { -+ .name = DRV_NAME, -+ }, -+#endif - .probe = if_cs_probe, - .remove = if_cs_detach, - .id_table = if_cs_ids, ---- a/drivers/net/wireless/orinoco/orinoco_cs.c -+++ b/drivers/net/wireless/orinoco/orinoco_cs.c -@@ -78,7 +78,11 @@ orinoco_cs_hard_reset(struct orinoco_pri - /* We need atomic ops here, because we're not holding the lock */ - set_bit(0, &card->hard_reset_in_progress); - -+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27) -+ err = pcmcia_reset_card(link, NULL); -+#else - err = pcmcia_reset_card(link->socket); -+#endif - if (err) - return err; - -@@ -108,6 +112,16 @@ orinoco_cs_probe(struct pcmcia_device *l - card->p_dev = link; - link->priv = priv; - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ /* Interrupt setup */ -+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; -+ link->irq.Handler = orinoco_interrupt; -+#endif -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) -+ link->conf.Attributes = 0; -+ link->conf.IntType = INT_MEMORY_AND_IO; -+#endif -+ - return orinoco_cs_config(link); - } /* orinoco_cs_attach */ - -@@ -122,6 +136,7 @@ static void orinoco_cs_detach(struct pcm - free_orinocodev(priv); - } /* orinoco_cs_detach */ - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - static int orinoco_cs_config_check(struct pcmcia_device *p_dev, void *priv_data) - { - if (p_dev->config_index == 0) -@@ -129,6 +144,98 @@ static int orinoco_cs_config_check(struc - - return pcmcia_request_io(p_dev); - }; -+#else -+static int orinoco_cs_config_check(struct pcmcia_device *p_dev, -+ cistpl_cftable_entry_t *cfg, -+ cistpl_cftable_entry_t *dflt, -+ unsigned int vcc, -+ void *priv_data) -+{ -+ if (cfg->index == 0) -+ goto next_entry; -+ -+ /* Use power settings for Vcc and Vpp if present */ -+ /* Note that the CIS values need to be rescaled */ -+ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { -+ if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { -+ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", -+ __func__, vcc, -+ cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); -+ if (!ignore_cis_vcc) -+ goto next_entry; -+ } -+ } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { -+ if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { -+ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", -+ __func__, vcc, -+ dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); -+ if (!ignore_cis_vcc) -+ goto next_entry; -+ } -+ } -+ -+ if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) -+ p_dev->conf.Vpp = -+ cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; -+ else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) -+ p_dev->conf.Vpp = -+ dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; -+ -+ /* Do we need to allocate an interrupt? */ -+ p_dev->conf.Attributes |= CONF_ENABLE_IRQ; -+ -+ /* IO window settings */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ p_dev->resource[0]->end = p_dev->resource[1]->end = 0; -+#else -+ p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; -+#endif -+ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { -+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; -+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; -+ p_dev->resource[0]->flags |= -+ pcmcia_io_cfg_data_width(io->flags); -+ p_dev->resource[0]->start = io->win[0].base; -+ p_dev->resource[0]->end = io->win[0].len; -+#else -+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; -+ if (!(io->flags & CISTPL_IO_8BIT)) -+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; -+ if (!(io->flags & CISTPL_IO_16BIT)) -+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; -+ p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; -+ p_dev->io.BasePort1 = io->win[0].base; -+ p_dev->io.NumPorts1 = io->win[0].len; -+#endif -+ if (io->nwin > 1) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ p_dev->resource[1]->flags = p_dev->resource[0]->flags; -+ p_dev->resource[1]->start = io->win[1].base; -+ p_dev->resource[1]->end = io->win[1].len; -+#else -+ p_dev->io.Attributes2 = p_dev->io.Attributes1; -+ p_dev->io.BasePort2 = io->win[1].base; -+ p_dev->io.NumPorts2 = io->win[1].len; -+#endif -+ } -+ -+ /* This reserves IO space but doesn't actually enable it */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ if (pcmcia_request_io(p_dev) != 0) -+#else -+ if (pcmcia_request_io(p_dev, &p_dev->io) != 0) -+#endif -+ goto next_entry; -+ } -+ return 0; -+ -+next_entry: -+ pcmcia_disable_device(p_dev); -+ return -ENODEV; -+}; -+#endif - - static int - orinoco_cs_config(struct pcmcia_device *link) -@@ -138,10 +245,12 @@ orinoco_cs_config(struct pcmcia_device * - int ret; - void __iomem *mem; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC | - CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; - if (ignore_cis_vcc) - link->config_flags &= ~CONF_AUTO_CHECK_VCC; -+#endif - ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL); - if (ret) { - if (!ignore_cis_vcc) -@@ -151,8 +260,12 @@ orinoco_cs_config(struct pcmcia_device * - goto failed; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) - mem = ioport_map(link->resource[0]->start, - resource_size(link->resource[0])); -+#else -+ mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); -+#endif - if (!mem) - goto failed; - -@@ -161,7 +274,11 @@ orinoco_cs_config(struct pcmcia_device * - * called. */ - hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ret = pcmcia_request_irq(link, orinoco_interrupt); -+#else -+ ret = pcmcia_request_irq(link, &link->irq); -+#endif - if (ret) - goto failed; - -@@ -176,8 +293,16 @@ orinoco_cs_config(struct pcmcia_device * - } - - /* Register an interface with the stack */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - if (orinoco_if_add(priv, link->resource[0]->start, - link->irq, NULL) != 0) { -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) -+ if (orinoco_if_add(priv, link->io.BasePort1, -+ link->irq, NULL) != 0) { -+#else -+ if (orinoco_if_add(priv, link->io.BasePort1, -+ link->irq.AssignedIRQ, NULL) != 0) { -+#endif - printk(KERN_ERR PFX "orinoco_if_add() failed\n"); - goto failed; - } -@@ -331,7 +456,13 @@ MODULE_DEVICE_TABLE(pcmcia, orinoco_cs_i - - static struct pcmcia_driver orinoco_driver = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - .name = DRIVER_NAME, -+#else -+ .drv = { -+ .name = DRIVER_NAME, -+ }, -+#endif - .probe = orinoco_cs_probe, - .remove = orinoco_cs_detach, - .id_table = orinoco_cs_ids, ---- a/drivers/net/wireless/orinoco/spectrum_cs.c -+++ b/drivers/net/wireless/orinoco/spectrum_cs.c -@@ -170,6 +170,16 @@ spectrum_cs_probe(struct pcmcia_device * - card->p_dev = link; - link->priv = priv; - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ /* Interrupt setup */ -+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; -+ link->irq.Handler = orinoco_interrupt; -+#endif -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) -+ link->conf.Attributes = 0; -+ link->conf.IntType = INT_MEMORY_AND_IO; -+#endif -+ - return spectrum_cs_config(link); - } /* spectrum_cs_attach */ - -@@ -184,6 +194,7 @@ static void spectrum_cs_detach(struct pc - free_orinocodev(priv); - } /* spectrum_cs_detach */ - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - static int spectrum_cs_config_check(struct pcmcia_device *p_dev, - void *priv_data) - { -@@ -192,6 +203,98 @@ static int spectrum_cs_config_check(stru - - return pcmcia_request_io(p_dev); - }; -+#else -+static int spectrum_cs_config_check(struct pcmcia_device *p_dev, -+ cistpl_cftable_entry_t *cfg, -+ cistpl_cftable_entry_t *dflt, -+ unsigned int vcc, -+ void *priv_data) -+{ -+ if (cfg->index == 0) -+ goto next_entry; -+ -+ /* Use power settings for Vcc and Vpp if present */ -+ /* Note that the CIS values need to be rescaled */ -+ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { -+ if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { -+ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", -+ __func__, vcc, -+ cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); -+ if (!ignore_cis_vcc) -+ goto next_entry; -+ } -+ } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { -+ if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { -+ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", -+ __func__, vcc, -+ dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); -+ if (!ignore_cis_vcc) -+ goto next_entry; -+ } -+ } -+ -+ if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) -+ p_dev->conf.Vpp = -+ cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; -+ else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) -+ p_dev->conf.Vpp = -+ dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; -+ -+ /* Do we need to allocate an interrupt? */ -+ p_dev->conf.Attributes |= CONF_ENABLE_IRQ; -+ -+ /* IO window settings */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ p_dev->resource[0]->end = p_dev->resource[1]->end = 0; -+#else -+ p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; -+#endif -+ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { -+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; -+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; -+ p_dev->resource[0]->flags |= -+ pcmcia_io_cfg_data_width(io->flags); -+ p_dev->resource[0]->start = io->win[0].base; -+ p_dev->resource[0]->end = io->win[0].len; -+#else -+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; -+ if (!(io->flags & CISTPL_IO_8BIT)) -+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; -+ if (!(io->flags & CISTPL_IO_16BIT)) -+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; -+ p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; -+ p_dev->io.BasePort1 = io->win[0].base; -+ p_dev->io.NumPorts1 = io->win[0].len; -+#endif -+ if (io->nwin > 1) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ p_dev->resource[1]->flags = p_dev->resource[0]->flags; -+ p_dev->resource[1]->start = io->win[1].base; -+ p_dev->resource[1]->end = io->win[1].len; -+#else -+ p_dev->io.Attributes2 = p_dev->io.Attributes1; -+ p_dev->io.BasePort2 = io->win[1].base; -+ p_dev->io.NumPorts2 = io->win[1].len; -+#endif -+ } -+ -+ /* This reserves IO space but doesn't actually enable it */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ if (pcmcia_request_io(p_dev) != 0) -+#else -+ if (pcmcia_request_io(p_dev, &p_dev->io) != 0) -+#endif -+ goto next_entry; -+ } -+ return 0; -+ -+next_entry: -+ pcmcia_disable_device(p_dev); -+ return -ENODEV; -+}; -+#endif - - static int - spectrum_cs_config(struct pcmcia_device *link) -@@ -201,10 +304,12 @@ spectrum_cs_config(struct pcmcia_device - int ret; - void __iomem *mem; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC | - CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; - if (ignore_cis_vcc) - link->config_flags &= ~CONF_AUTO_CHECK_VCC; -+#endif - ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL); - if (ret) { - if (!ignore_cis_vcc) -@@ -214,8 +319,12 @@ spectrum_cs_config(struct pcmcia_device - goto failed; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) - mem = ioport_map(link->resource[0]->start, - resource_size(link->resource[0])); -+#else -+ mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); -+#endif - if (!mem) - goto failed; - -@@ -225,7 +334,11 @@ spectrum_cs_config(struct pcmcia_device - hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); - hw->eeprom_pda = true; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ret = pcmcia_request_irq(link, orinoco_interrupt); -+#else -+ ret = pcmcia_request_irq(link, &link->irq); -+#endif - if (ret) - goto failed; - -@@ -244,8 +357,16 @@ spectrum_cs_config(struct pcmcia_device - } - - /* Register an interface with the stack */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - if (orinoco_if_add(priv, link->resource[0]->start, - link->irq, NULL) != 0) { -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) -+ if (orinoco_if_add(priv, link->io.BasePort1, -+ link->irq, NULL) != 0) { -+#else -+ if (orinoco_if_add(priv, link->io.BasePort1, -+ link->irq.AssignedIRQ, NULL) != 0) { -+#endif - printk(KERN_ERR PFX "orinoco_if_add() failed\n"); - goto failed; - } -@@ -311,7 +432,13 @@ MODULE_DEVICE_TABLE(pcmcia, spectrum_cs_ - - static struct pcmcia_driver orinoco_driver = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - .name = DRIVER_NAME, -+#else -+ .drv = { -+ .name = DRIVER_NAME, -+ }, -+#endif - .probe = spectrum_cs_probe, - .remove = spectrum_cs_detach, - .suspend = spectrum_cs_suspend, ---- a/drivers/ssb/main.c -+++ b/drivers/ssb/main.c -@@ -504,7 +504,11 @@ static int ssb_devices_register(struct s - break; - case SSB_BUSTYPE_PCMCIA: - #ifdef CONFIG_SSB_PCMCIAHOST -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - sdev->irq = bus->host_pcmcia->irq; -+#else -+ sdev->irq = bus->host_pcmcia->irq.AssignedIRQ; -+#endif - dev->parent = &bus->host_pcmcia->dev; - #endif - break; diff --git a/patches/network/25-multicast-list_head.patch b/patches/network/25-multicast-list_head.patch deleted file mode 100644 index 3efa9e2c1525..000000000000 --- a/patches/network/25-multicast-list_head.patch +++ /dev/null @@ -1,820 +0,0 @@ -Backport commit 22bedad3ce112d5ca1eaf043d4990fa2ed698c87: - net: convert multicast list to list_head - - Converts the list and the core manipulating with it to be the same as uc_list. - - +uses two functions for adding/removing mc address (normal and "global" - variant) instead of a function parameter. - +removes dev_mcast.c completely. - +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for - manipulation with lists on a sandbox (used in bonding and 80211 drivers) - -This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856 - ---- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -@@ -410,7 +410,11 @@ static void atl1c_set_multi(struct net_d - - /* comoute mc addresses' hash value ,and put it into hash table */ - netdev_for_each_mc_addr(ha, netdev) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - hash_value = atl1c_hash_mc_addr(hw, ha->addr); -+#else -+ hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr); -+#endif - atl1c_hash_set(hw, hash_value); - } - } ---- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c -+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c -@@ -308,7 +308,11 @@ static void atl1e_set_multi(struct net_d - - /* comoute mc addresses' hash value ,and put it into hash table */ - netdev_for_each_mc_addr(ha, netdev) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - hash_value = atl1e_hash_mc_addr(hw, ha->addr); -+#else -+ hash_value = atl1e_hash_mc_addr(hw, ha->dmi_addr); -+#endif - atl1e_hash_set(hw, hash_value); - } - } ---- a/drivers/net/ethernet/atheros/atlx/atl2.c -+++ b/drivers/net/ethernet/atheros/atlx/atl2.c -@@ -159,7 +159,11 @@ static void atl2_set_multi(struct net_de - - /* comoute mc addresses' hash value ,and put it into hash table */ - netdev_for_each_mc_addr(ha, netdev) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - hash_value = atl2_hash_mc_addr(hw, ha->addr); -+#else -+ hash_value = atl2_hash_mc_addr(hw, ha->dmi_addr); -+#endif - atl2_hash_set(hw, hash_value); - } - } ---- a/drivers/net/ethernet/atheros/atlx/atlx.c -+++ b/drivers/net/ethernet/atheros/atlx/atlx.c -@@ -150,7 +150,11 @@ static void atlx_set_multi(struct net_de - - /* compute mc addresses' hash value ,and put it into hash table */ - netdev_for_each_mc_addr(ha, netdev) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - hash_value = atlx_hash_mc_addr(hw, ha->addr); -+#else -+ hash_value = atlx_hash_mc_addr(hw, ha->dmi_addr); -+#endif - atlx_hash_set(hw, hash_value); - } - } ---- a/drivers/net/ethernet/broadcom/b44.c -+++ b/drivers/net/ethernet/broadcom/b44.c -@@ -1696,7 +1696,11 @@ static int __b44_load_mcast(struct b44 * - netdev_for_each_mc_addr(ha, dev) { - if (i == num_ents) - break; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - __b44_cam_write(bp, ha->addr, i++ + 1); -+#else -+ __b44_cam_write(bp, ha->dmi_addr, i++ + 1); -+#endif - } - return i+1; - } ---- a/drivers/net/wireless/adm8211.c -+++ b/drivers/net/wireless/adm8211.c -@@ -1320,19 +1320,37 @@ static void adm8211_bss_info_changed(str - } - - static u64 adm8211_prepare_multicast(struct ieee80211_hw *hw, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list) -+#else -+ int mc_count, struct dev_addr_list *ha) -+#endif - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - unsigned int bit_nr; -- u32 mc_filter[2]; - struct netdev_hw_addr *ha; -+#else -+ unsigned int bit_nr, i; -+#endif -+ u32 mc_filter[2]; - - mc_filter[1] = mc_filter[0] = 0; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - netdev_hw_addr_list_for_each(ha, mc_list) { - bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26; -+#else -+ for (i = 0; i < mc_count; i++) { -+ if (!ha) -+ break; -+ bit_nr = ether_crc(ETH_ALEN, ha->dmi_addr) >> 26; -+#endif - - bit_nr &= 0x3F; - mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ ha = ha->next; -+#endif - } - - return mc_filter[0] | ((u64)(mc_filter[1]) << 32); ---- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c -+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c -@@ -318,20 +318,42 @@ ath5k_bss_info_changed(struct ieee80211_ - - static u64 - ath5k_prepare_multicast(struct ieee80211_hw *hw, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list) -+#else -+ int mc_count, struct dev_addr_list *ha) -+#endif - { - u32 mfilt[2], val; - u8 pos; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr *ha; -+#else -+ int i; -+#endif - - mfilt[0] = 0; - mfilt[1] = 1; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - netdev_hw_addr_list_for_each(ha, mc_list) { -+#else -+ for (i = 0; i < mc_count; i++) { -+ if (!ha) -+ break; -+#endif - /* calculate XOR of eight 6-bit values */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - val = get_unaligned_le32(ha->addr + 0); -+#else -+ val = get_unaligned_le32(ha->dmi_addr + 0); -+#endif - pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - val = get_unaligned_le32(ha->addr + 3); -+#else -+ val = get_unaligned_le32(ha->dmi_addr + 3); -+#endif - pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; - pos &= 0x3f; - mfilt[pos / 32] |= (1 << (pos % 32)); -@@ -340,6 +362,9 @@ ath5k_prepare_multicast(struct ieee80211 - * need to inform below not to reset the mcast */ - /* ath5k_hw_set_mcast_filterindex(ah, - * ha->addr[5]); */ -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ ha = ha->next; -+#endif - } - - return ((u64)(mfilt[1]) << 32) | mfilt[0]; ---- a/drivers/net/wireless/ath/carl9170/main.c -+++ b/drivers/net/wireless/ath/carl9170/main.c -@@ -898,17 +898,35 @@ out: - return err; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw, - struct netdev_hw_addr_list *mc_list) -+#else -+static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count, -+ struct dev_addr_list *ha) -+#endif - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr *ha; -+#else -+ int i; -+#endif - u64 mchash; - - /* always get broadcast frames */ - mchash = 1ULL << (0xff >> 2); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - netdev_hw_addr_list_for_each(ha, mc_list) - mchash |= 1ULL << (ha->addr[5] >> 2); -+#else -+ for (i = 0; i < mc_count; i++) { -+ if (WARN_ON(!ha)) -+ break; -+ mchash |= 1ULL << (ha->dmi_addr[5] >> 2); -+ ha = ha->next; -+ } -+#endif - - return mchash; - } ---- a/drivers/net/wireless/libertas/main.c -+++ b/drivers/net/wireless/libertas/main.c -@@ -349,18 +349,34 @@ static int lbs_add_mcast_addrs(struct cm - netif_addr_lock_bh(dev); - cnt = netdev_mc_count(dev); - netdev_for_each_mc_addr(ha, dev) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - if (mac_in_list(cmd->maclist, nr_addrs, ha->addr)) { -+#else -+ if (mac_in_list(cmd->maclist, nr_addrs, ha->dmi_addr)) { -+#endif - lbs_deb_net("mcast address %s:%pM skipped\n", dev->name, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ha->addr); -+#else -+ ha->dmi_addr); -+#endif - cnt--; - continue; - } - - if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE) - break; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - memcpy(&cmd->maclist[6*i], ha->addr, ETH_ALEN); -+#else -+ memcpy(&cmd->maclist[6*i], ha->dmi_addr, ETH_ALEN); -+#endif - lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ha->addr); -+#else -+ ha->dmi_addr); -+#endif - i++; - cnt--; - } ---- a/drivers/net/wireless/libertas_tf/main.c -+++ b/drivers/net/wireless/libertas_tf/main.c -@@ -421,20 +421,36 @@ static int lbtf_op_config(struct ieee802 - } - - static u64 lbtf_op_prepare_multicast(struct ieee80211_hw *hw, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list) -+#else -+ int mc_count, struct dev_addr_list *ha) -+#endif - { - struct lbtf_private *priv = hw->priv; - int i; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr *ha; - int mc_count = netdev_hw_addr_list_count(mc_list); -+#endif - - if (!mc_count || mc_count > MRVDRV_MAX_MULTICAST_LIST_SIZE) - return mc_count; - - priv->nr_of_multicastmacaddr = mc_count; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - i = 0; - netdev_hw_addr_list_for_each(ha, mc_list) - memcpy(&priv->multicastlist[i++], ha->addr, ETH_ALEN); -+#else -+ for (i = 0; i < mc_count; i++) { -+ if (!ha) -+ break; -+ memcpy(&priv->multicastlist[i], ha->da_addr, -+ ETH_ALEN); -+ ha = ha->next; -+ } -+#endif - - return mc_count; - } ---- a/drivers/net/wireless/mwifiex/sta_ioctl.c -+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c -@@ -43,7 +43,11 @@ int mwifiex_copy_mcast_addr(struct mwifi - struct netdev_hw_addr *ha; - - netdev_for_each_mc_addr(ha, dev) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - memcpy(&mlist->mac_list[i++], ha->addr, ETH_ALEN); -+#else -+ memcpy(&mlist->mac_list[i++], ha->dmi_addr, ETH_ALEN); -+#endif - - return i; - } ---- a/drivers/net/wireless/mwifiex/debugfs.c -+++ b/drivers/net/wireless/mwifiex/debugfs.c -@@ -217,7 +217,11 @@ mwifiex_info_read(struct file *file, cha - - netdev_for_each_mc_addr(ha, netdev) - p += sprintf(p, "multicast_address[%d]=\"%pM\"\n", -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - i++, ha->addr); -+#else -+ i++, ha->dmi_addr); -+#endif - } - - p += sprintf(p, "num_tx_bytes = %lu\n", priv->stats.tx_bytes); ---- a/drivers/net/wireless/mwl8k.c -+++ b/drivers/net/wireless/mwl8k.c -@@ -2574,15 +2574,21 @@ struct mwl8k_cmd_mac_multicast_adr { - - static struct mwl8k_cmd_pkt * - __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list) -+#else -+ int mc_count, struct dev_addr_list *ha) -+#endif - { - struct mwl8k_priv *priv = hw->priv; - struct mwl8k_cmd_mac_multicast_adr *cmd; - int size; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - int mc_count = 0; - - if (mc_list) - mc_count = netdev_hw_addr_list_count(mc_list); -+#endif - - if (allmulti || mc_count > priv->num_mcaddrs) { - allmulti = 1; -@@ -2603,13 +2609,27 @@ __mwl8k_cmd_mac_multicast_adr(struct iee - if (allmulti) { - cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_ALL_MULTICAST); - } else if (mc_count) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr *ha; - int i = 0; -+#else -+ int i; -+#endif - - cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST); - cmd->numaddr = cpu_to_le16(mc_count); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - netdev_hw_addr_list_for_each(ha, mc_list) { - memcpy(cmd->addr[i], ha->addr, ETH_ALEN); -+#else -+ for (i = 0; i < mc_count && ha; i++) { -+ if (ha->da_addrlen != ETH_ALEN) { -+ kfree(cmd); -+ return NULL; -+ } -+ memcpy(cmd->addr[i], ha->da_addr, ETH_ALEN); -+ ha = ha->next; -+#endif - } - } - -@@ -4836,7 +4856,11 @@ mwl8k_bss_info_changed(struct ieee80211_ - } - - static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list) -+#else -+ int mc_count, struct dev_addr_list *ha) -+#endif - { - struct mwl8k_cmd_pkt *cmd; - -@@ -4847,7 +4871,11 @@ static u64 mwl8k_prepare_multicast(struc - * we'll end up throwing this packet away and creating a new - * one in mwl8k_configure_filter(). - */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_list); -+#else -+ cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_count, ha); -+#endif - - return (unsigned long)cmd; - } -@@ -4969,7 +4997,11 @@ static void mwl8k_configure_filter(struc - */ - if (*total_flags & FIF_ALLMULTI) { - kfree(cmd); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, NULL); -+#else -+ cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, 0, NULL); -+#endif - } - - if (cmd != NULL) { ---- a/drivers/net/wireless/orinoco/hw.c -+++ b/drivers/net/wireless/orinoco/hw.c -@@ -1093,7 +1093,11 @@ int __orinoco_hw_set_multicast_list(stru - netdev_for_each_mc_addr(ha, dev) { - if (i == mc_count) - break; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - memcpy(mclist.addr[i++], ha->addr, ETH_ALEN); -+#else -+ memcpy(mclist.addr[i++], ha->dmi_addr, ETH_ALEN); -+#endif - } - - err = hw->ops->write_ltv(hw, USER_BAP, ---- a/drivers/net/wireless/orinoco/hw.h -+++ b/drivers/net/wireless/orinoco/hw.h -@@ -22,6 +22,9 @@ - - /* Forward declarations */ - struct orinoco_private; -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+struct dev_addr_list; -+#endif - - int determine_fw_capabilities(struct orinoco_private *priv, char *fw_name, - size_t fw_name_len, u32 *hw_ver); ---- a/drivers/net/wireless/p54/main.c -+++ b/drivers/net/wireless/p54/main.c -@@ -364,11 +364,18 @@ out: - return ret; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - static u64 p54_prepare_multicast(struct ieee80211_hw *dev, - struct netdev_hw_addr_list *mc_list) -+#else -+static u64 p54_prepare_multicast(struct ieee80211_hw *dev, int mc_count, -+ struct dev_addr_list *ha) -+#endif - { - struct p54_common *priv = dev->priv; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr *ha; -+#endif - int i; - - BUILD_BUG_ON(ARRAY_SIZE(priv->mc_maclist) != -@@ -378,12 +385,23 @@ static u64 p54_prepare_multicast(struct - * Otherwise the firmware will drop it and ARP will no longer work. - */ - i = 1; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - priv->mc_maclist_num = netdev_hw_addr_list_count(mc_list) + i; - netdev_hw_addr_list_for_each(ha, mc_list) { - memcpy(&priv->mc_maclist[i], ha->addr, ETH_ALEN); -+#else -+ priv->mc_maclist_num = mc_count + i; -+ while (i <= mc_count) { -+ if (!ha) -+ break; -+ memcpy(&priv->mc_maclist[i], ha->dmi_addr, ETH_ALEN); -+#endif - i++; - if (i >= ARRAY_SIZE(priv->mc_maclist)) - break; -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ ha = ha->next; -+#endif - } - - return 1; /* update */ ---- a/drivers/net/wireless/rndis_wlan.c -+++ b/drivers/net/wireless/rndis_wlan.c -@@ -1632,7 +1632,11 @@ static void set_multicast_list(struct us - - netdev_for_each_mc_addr(ha, usbdev->net) - memcpy(mc_addrs + i++ * ETH_ALEN, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ha->addr, ETH_ALEN); -+#else -+ ha->dmi_addr, ETH_ALEN); -+#endif - } - netif_addr_unlock_bh(usbdev->net); - ---- a/drivers/net/wireless/rtl818x/rtl8180/dev.c -+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c -@@ -818,10 +818,19 @@ static void rtl8180_bss_info_changed(str - } - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, - struct netdev_hw_addr_list *mc_list) -+#else -+static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, int mc_count, -+ struct dev_addr_list *mc_list) -+#endif - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - return netdev_hw_addr_list_count(mc_list); -+#else -+ return mc_count; -+#endif - } - - static void rtl8180_configure_filter(struct ieee80211_hw *dev, ---- a/drivers/net/wireless/rtl818x/rtl8187/dev.c -+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c -@@ -1290,9 +1290,17 @@ static void rtl8187_bss_info_changed(str - } - - static u64 rtl8187_prepare_multicast(struct ieee80211_hw *dev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list) -+#else -+ int mc_count, struct dev_addr_list *mc_list) -+#endif - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - return netdev_hw_addr_list_count(mc_list); -+#else -+ return mc_count; -+#endif - } - - static void rtl8187_configure_filter(struct ieee80211_hw *dev, ---- a/drivers/net/wireless/ti/wlcore/main.c -+++ b/drivers/net/wireless/ti/wlcore/main.c -@@ -2786,11 +2786,20 @@ struct wl1271_filter_params { - u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN]; - }; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, - struct netdev_hw_addr_list *mc_list) -+#else -+static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count, -+ struct dev_addr_list *mc_list) -+#endif - { - struct wl1271_filter_params *fp; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr *ha; -+#else -+ int i; -+#endif - - fp = kzalloc(sizeof(*fp), GFP_ATOMIC); - if (!fp) { -@@ -2799,16 +2808,40 @@ static u64 wl1271_op_prepare_multicast(s - } - - /* update multicast filtering parameters */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - fp->mc_list_length = 0; - if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) { -+#else -+ fp->enabled = true; -+ if (mc_count > ACX_MC_ADDRESS_GROUP_MAX) { -+ mc_count = 0; -+#endif - fp->enabled = false; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - } else { - fp->enabled = true; - netdev_hw_addr_list_for_each(ha, mc_list) { -+#else -+ } -+ -+ fp->mc_list_length = 0; -+ for (i = 0; i < mc_count; i++) { -+ if (mc_list->da_addrlen == ETH_ALEN) { -+#endif - memcpy(fp->mc_list[fp->mc_list_length], -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ha->addr, ETH_ALEN); -+#else -+ mc_list->da_addr, ETH_ALEN); -+#endif - fp->mc_list_length++; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - } -+#else -+ } else -+ wl1271_warning("Unknown mc address length."); -+ mc_list = mc_list->next; -+#endif - } - - return (u64)(unsigned long)fp; ---- a/drivers/net/wireless/zd1211rw/zd_mac.c -+++ b/drivers/net/wireless/zd1211rw/zd_mac.c -@@ -1215,17 +1215,34 @@ static void zd_process_intr(struct work_ - - - static u64 zd_op_prepare_multicast(struct ieee80211_hw *hw, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list) -+#else -+ int mc_count, struct dev_addr_list *ha) -+#endif - { - struct zd_mac *mac = zd_hw_mac(hw); - struct zd_mc_hash hash; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr *ha; -+#else -+ int i; -+#endif - - zd_mc_clear(&hash); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - netdev_hw_addr_list_for_each(ha, mc_list) { - dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->addr); - zd_mc_add_addr(&hash, ha->addr); -+#else -+ for (i = 0; i < mc_count; i++) { -+ if (!ha) -+ break; -+ dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->dmi_addr); -+ zd_mc_add_addr(&hash, ha->dmi_addr); -+ ha = ha->next; -+#endif - } - - return hash.low | ((u64)hash.high << 32); ---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c -@@ -95,7 +95,11 @@ static void _brcmf_set_multicast_list(st - netdev_for_each_mc_addr(ha, ndev) { - if (!cnt) - break; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - memcpy(bufp, ha->addr, ETH_ALEN); -+#else -+ memcpy(bufp, ha->dmi_addr, ETH_ALEN); -+#endif - bufp += ETH_ALEN; - cnt--; - } ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -2494,7 +2494,11 @@ struct ieee80211_ops { - void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); - - u64 (*prepare_multicast)(struct ieee80211_hw *hw, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list); -+#else -+ int mc_count, struct dev_addr_list *mc_list); -+#endif - void (*configure_filter)(struct ieee80211_hw *hw, - unsigned int changed_flags, - unsigned int *total_flags, ---- a/net/bluetooth/bnep/netdev.c -+++ b/net/bluetooth/bnep/netdev.c -@@ -93,8 +93,13 @@ static void bnep_net_set_mc_list(struct - netdev_for_each_mc_addr(ha, dev) { - if (i == BNEP_MAX_MULTICAST_FILTERS) - break; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN); - memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN); -+#else -+ memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN); -+ memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN); -+#endif - - i++; - } ---- a/net/mac80211/driver-ops.h -+++ b/net/mac80211/driver-ops.h -@@ -216,14 +216,28 @@ static inline void drv_bss_info_changed( - } - - static inline u64 drv_prepare_multicast(struct ieee80211_local *local, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list *mc_list) -+#else -+ int mc_count, -+ struct dev_addr_list *mc_list) -+#endif - { - u64 ret = 0; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - trace_drv_prepare_multicast(local, mc_list->count); -+#else -+ trace_drv_prepare_multicast(local, mc_count); -+#endif - - if (local->ops->prepare_multicast) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ret = local->ops->prepare_multicast(&local->hw, mc_list); -+#else -+ ret = local->ops->prepare_multicast(&local->hw, mc_count, -+ mc_list); -+#endif - - trace_drv_return_u64(local, ret); - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -925,7 +925,12 @@ struct ieee80211_local { - struct work_struct reconfig_filter; - - /* aggregated multicast list */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct netdev_hw_addr_list mc_list; -+#else -+ struct dev_addr_list *mc_list; -+ int mc_count; -+#endif - - bool tim_in_locked_section; /* see ieee80211_beacon_get() */ - ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -762,8 +762,13 @@ static void ieee80211_do_stop(struct iee - if (sdata->dev) { - netif_addr_lock_bh(sdata->dev); - spin_lock_bh(&local->filter_lock); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - __hw_addr_unsync(&local->mc_list, &sdata->dev->mc, - sdata->dev->addr_len); -+#else -+ __dev_addr_unsync(&local->mc_list, &local->mc_count, -+ &sdata->dev->mc_list, &sdata->dev->mc_count); -+#endif - spin_unlock_bh(&local->filter_lock); - netif_addr_unlock_bh(sdata->dev); - -@@ -920,7 +925,12 @@ static void ieee80211_set_multicast_list - sdata->flags ^= IEEE80211_SDATA_PROMISC; - } - spin_lock_bh(&local->filter_lock); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len); -+#else -+ __dev_addr_sync(&local->mc_list, &local->mc_count, -+ &dev->mc_list, &dev->mc_count); -+#endif - spin_unlock_bh(&local->filter_lock); - ieee80211_queue_work(&local->hw, &local->reconfig_filter); - } ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -72,7 +72,11 @@ void ieee80211_configure_filter(struct i - spin_lock_bh(&local->filter_lock); - changed_flags = local->filter_flags ^ new_flags; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - mc = drv_prepare_multicast(local, &local->mc_list); -+#else -+ mc = drv_prepare_multicast(local, local->mc_count, local->mc_list); -+#endif - spin_unlock_bh(&local->filter_lock); - - /* be a bit nasty */ -@@ -642,9 +646,11 @@ struct ieee80211_hw *ieee80211_alloc_hw( - wiphy->ht_capa_mod_mask = &mac80211_ht_capa_mod_mask; - - INIT_LIST_HEAD(&local->interfaces); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - - __hw_addr_init(&local->mc_list); - -+#endif - mutex_init(&local->iflist_mtx); - mutex_init(&local->mtx); - ---- a/drivers/net/wireless/ath/ath6kl/main.c -+++ b/drivers/net/wireless/ath/ath6kl/main.c -@@ -1238,7 +1238,11 @@ static void ath6kl_set_multicast_list(st - list_for_each_entry_safe(mc_filter, tmp, &vif->mc_filter, list) { - found = false; - netdev_for_each_mc_addr(ha, ndev) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - if (memcmp(ha->addr, mc_filter->hw_addr, -+#else -+ if (memcmp(ha->dmi_addr, mc_filter->hw_addr, -+#endif - ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE) == 0) { - found = true; - break; -@@ -1272,7 +1276,11 @@ static void ath6kl_set_multicast_list(st - netdev_for_each_mc_addr(ha, ndev) { - found = false; - list_for_each_entry(mc_filter, &vif->mc_filter, list) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - if (memcmp(ha->addr, mc_filter->hw_addr, -+#else -+ if (memcmp(ha->dmi_addr, mc_filter->hw_addr, -+#endif - ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE) == 0) { - found = true; - break; -@@ -1287,7 +1295,11 @@ static void ath6kl_set_multicast_list(st - goto out; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - memcpy(mc_filter->hw_addr, ha->addr, -+#else -+ memcpy(mc_filter->hw_addr, ha->dmi_addr, -+#endif - ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE); - /* Set the multicast filter */ - ath6kl_dbg(ATH6KL_DBG_TRC, diff --git a/patches/network/26-sdio-quirks.patch b/patches/network/26-sdio-quirks.patch deleted file mode 100644 index 0281c6bacc0a..000000000000 --- a/patches/network/26-sdio-quirks.patch +++ /dev/null @@ -1,32 +0,0 @@ -The quirks attribute is not available on older kernels. - ---- a/drivers/net/wireless/libertas/if_sdio.c -+++ b/drivers/net/wireless/libertas/if_sdio.c -@@ -873,6 +873,7 @@ static int if_sdio_power_on(struct if_sd - if (ret) - goto release; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) - /* For 1-bit transfers to the 8686 model, we need to enable the - * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 - * bit to allow access to non-vendor registers. */ -@@ -891,6 +892,7 @@ static int if_sdio_power_on(struct if_sd - if (ret) - goto disable; - } -+#endif - - card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret); - if (ret) ---- a/drivers/net/wireless/mwifiex/sdio.c -+++ b/drivers/net/wireless/mwifiex/sdio.c -@@ -75,7 +75,9 @@ mwifiex_sdio_probe(struct sdio_func *fun - - card->func = func; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; -+#endif - - sdio_claim_host(func); - ret = sdio_enable_func(func); diff --git a/patches/network/27-hermes-read-pda-conflict.patch b/patches/network/27-hermes-read-pda-conflict.patch deleted file mode 100644 index c50624764587..000000000000 --- a/patches/network/27-hermes-read-pda-conflict.patch +++ /dev/null @@ -1,56 +0,0 @@ -Rename read_pda to something else because this symbol is used in a -define for something else in arch/um/include/asm/pda.h on older kernels. - ---- a/drivers/net/wireless/orinoco/fw.c -+++ b/drivers/net/wireless/orinoco/fw.c -@@ -123,7 +123,7 @@ orinoco_dl_firmware(struct orinoco_priva - dev_dbg(dev, "Attempting to download firmware %s\n", firmware); - - /* Read current plug data */ -- err = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size); -+ err = hw->ops->read_pda_h(hw, pda, fw->pda_addr, fw->pda_size); - dev_dbg(dev, "Read PDA returned %d\n", err); - if (err) - goto free; -@@ -225,7 +225,7 @@ symbol_dl_image(struct orinoco_private * - if (!pda) - return -ENOMEM; - -- ret = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size); -+ ret = hw->ops->read_pda_h(hw, pda, fw->pda_addr, fw->pda_size); - if (ret) - goto free; - } ---- a/drivers/net/wireless/orinoco/hermes.c -+++ b/drivers/net/wireless/orinoco/hermes.c -@@ -767,7 +767,7 @@ static const struct hermes_ops hermes_op - .write_ltv = hermes_write_ltv, - .bap_pread = hermes_bap_pread, - .bap_pwrite = hermes_bap_pwrite, -- .read_pda = hermes_read_pda, -+ .read_pda_h = hermes_read_pda, - .program_init = hermesi_program_init, - .program_end = hermesi_program_end, - .program = hermes_program_bytes, ---- a/drivers/net/wireless/orinoco/hermes.h -+++ b/drivers/net/wireless/orinoco/hermes.h -@@ -393,7 +393,7 @@ struct hermes_ops { - u16 id, u16 offset); - int (*bap_pwrite)(struct hermes *hw, int bap, const void *buf, - int len, u16 id, u16 offset); -- int (*read_pda)(struct hermes *hw, __le16 *pda, -+ int (*read_pda_h)(struct hermes *hw, __le16 *pda, - u32 pda_addr, u16 pda_len); - int (*program_init)(struct hermes *hw, u32 entry_point); - int (*program_end)(struct hermes *hw); ---- a/drivers/net/wireless/orinoco/orinoco_usb.c -+++ b/drivers/net/wireless/orinoco/orinoco_usb.c -@@ -1547,7 +1547,7 @@ static const struct hermes_ops ezusb_ops - .read_ltv = ezusb_read_ltv, - .write_ltv = ezusb_write_ltv, - .bap_pread = ezusb_bap_pread, -- .read_pda = ezusb_read_pda, -+ .read_pda_h = ezusb_read_pda, - .program_init = ezusb_program_init, - .program_end = ezusb_program_end, - .program = ezusb_program, diff --git a/patches/network/29-sdio_no_suspend.patch b/patches/network/29-sdio_no_suspend.patch deleted file mode 100644 index b3654a2143dd..000000000000 --- a/patches/network/29-sdio_no_suspend.patch +++ /dev/null @@ -1,199 +0,0 @@ -Starting with commit 66fceb69b72ff7e9cd8da2ca70033982d5376e0e -"libertas: Added callback functions to support SDIO suspend/resume." -libertas uses new functions from the in kernel sdio framework for -suspend and resume that are not backported. - ---- a/drivers/net/wireless/ath/ath6kl/sdio.c -+++ b/drivers/net/wireless/ath/ath6kl/sdio.c -@@ -807,6 +807,7 @@ out: - return ret; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - static int ath6kl_set_sdio_pm_caps(struct ath6kl *ar) - { - struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); -@@ -940,6 +941,17 @@ static int ath6kl_sdio_resume(struct ath - - return 0; - } -+#else -+static int ath6kl_sdio_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow) -+{ -+ return 0; -+} -+ -+static int ath6kl_sdio_resume(struct ath6kl *ar) -+{ -+ return 0; -+} -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ - - /* set the window address register (using 4-byte register access ). */ - static int ath6kl_set_addrwin_reg(struct ath6kl *ar, u32 reg_addr, u32 addr) -@@ -1251,7 +1263,7 @@ static const struct ath6kl_hif_ops ath6k - .stop = ath6kl_sdio_stop, - }; - --#ifdef CONFIG_PM_SLEEP -+#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - - /* - * Empty handlers so that mmc subsystem doesn't remove us entirely during -@@ -1401,7 +1413,9 @@ static struct sdio_driver ath6kl_sdio_dr - .id_table = ath6kl_sdio_devices, - .probe = ath6kl_sdio_probe, - .remove = ath6kl_sdio_remove, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - .drv.pm = ATH6KL_SDIO_PM_OPS, -+#endif - }; - - static int __init ath6kl_sdio_init(void) ---- a/drivers/net/wireless/libertas/if_sdio.c -+++ b/drivers/net/wireless/libertas/if_sdio.c -@@ -1341,6 +1341,7 @@ static void if_sdio_remove(struct sdio_f - lbs_deb_leave(LBS_DEB_SDIO); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - static int if_sdio_suspend(struct device *dev) - { - struct sdio_func *func = dev_to_sdio_func(dev); -@@ -1399,15 +1400,18 @@ static const struct dev_pm_ops if_sdio_p - .suspend = if_sdio_suspend, - .resume = if_sdio_resume, - }; -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ - - static struct sdio_driver if_sdio_driver = { - .name = "libertas_sdio", - .id_table = if_sdio_ids, - .probe = if_sdio_probe, - .remove = if_sdio_remove, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - .drv = { - .pm = &if_sdio_pm_ops, - }, -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ - }; - - /*******************************************************************/ ---- a/drivers/net/wireless/mwifiex/sdio.c -+++ b/drivers/net/wireless/mwifiex/sdio.c -@@ -129,8 +129,10 @@ mwifiex_sdio_remove(struct sdio_func *fu - wait_for_completion(&adapter->fw_load); - - if (user_rmmod) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - if (adapter->is_suspended) - mwifiex_sdio_resume(adapter->dev); -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ - - for (i = 0; i < adapter->priv_num; i++) - if ((GET_BSS_ROLE(adapter->priv[i]) == -@@ -147,6 +149,7 @@ mwifiex_sdio_remove(struct sdio_func *fu - kfree(card); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - /* - * SDIO suspend. - * -@@ -255,6 +258,7 @@ static int mwifiex_sdio_resume(struct de - - return 0; - } -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ - - /* Device ID for SD8786 */ - #define SDIO_DEVICE_ID_MARVELL_8786 (0x9116) -@@ -273,10 +277,12 @@ static const struct sdio_device_id mwifi - - MODULE_DEVICE_TABLE(sdio, mwifiex_ids); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - static const struct dev_pm_ops mwifiex_sdio_pm_ops = { - .suspend = mwifiex_sdio_suspend, - .resume = mwifiex_sdio_resume, - }; -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ - - static struct sdio_driver mwifiex_sdio = { - .name = "mwifiex_sdio", -@@ -285,7 +291,9 @@ static struct sdio_driver mwifiex_sdio = - .remove = mwifiex_sdio_remove, - .drv = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - .pm = &mwifiex_sdio_pm_ops, -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */ - } - }; - ---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c -@@ -73,7 +73,7 @@ static bool - brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev) - { - bool is_err = false; --#ifdef CONFIG_PM_SLEEP -+#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - is_err = atomic_read(&sdiodev->suspend); - #endif - return is_err; -@@ -82,7 +82,7 @@ brcmf_pm_resume_error(struct brcmf_sdio_ - static void - brcmf_pm_resume_wait(struct brcmf_sdio_dev *sdiodev, wait_queue_head_t *wq) - { --#ifdef CONFIG_PM_SLEEP -+#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - int retry = 0; - while (atomic_read(&sdiodev->suspend) && retry++ != 30) - wait_event_timeout(*wq, false, HZ/100); -@@ -550,7 +550,7 @@ static void brcmf_ops_sdio_remove(struct - brcmf_dbg(TRACE, "Exit\n"); - } - --#ifdef CONFIG_PM_SLEEP -+#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - static int brcmf_sdio_suspend(struct device *dev) - { - mmc_pm_flag_t sdio_flags; -@@ -600,7 +600,7 @@ static struct sdio_driver brcmf_sdmmc_dr - .remove = brcmf_ops_sdio_remove, - .name = "brcmfmac", - .id_table = brcmf_sdmmc_ids, --#ifdef CONFIG_PM_SLEEP -+#if defined(CONFIG_PM_SLEEP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - .drv = { - .pm = &brcmf_sdio_pm_ops, - }, ---- a/drivers/bluetooth/btmrvl_sdio.c -+++ b/drivers/bluetooth/btmrvl_sdio.c -@@ -1050,6 +1050,7 @@ static void btmrvl_sdio_remove(struct sd - } - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - static int btmrvl_sdio_suspend(struct device *dev) - { - struct sdio_func *func = dev_to_sdio_func(dev); -@@ -1145,6 +1146,7 @@ static const struct dev_pm_ops btmrvl_sd - .suspend = btmrvl_sdio_suspend, - .resume = btmrvl_sdio_resume, - }; -+#endif - - static struct sdio_driver bt_mrvl_sdio = { - .name = "btmrvl_sdio", -@@ -1153,7 +1155,9 @@ static struct sdio_driver bt_mrvl_sdio = - .remove = btmrvl_sdio_remove, - .drv = { - .owner = THIS_MODULE, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - .pm = &btmrvl_sdio_pm_ops, -+#endif - } - }; - diff --git a/patches/network/30-bridge-port.patch b/patches/network/30-bridge-port.patch deleted file mode 100644 index a426274e6c84..000000000000 --- a/patches/network/30-bridge-port.patch +++ /dev/null @@ -1,45 +0,0 @@ -The patch titled: - - bridge: use rx_handler_data pointer to store net_bridge_port pointer - -by Jiri Pirko moved the br_ports pointer -out of the netdev which older kernels relied on and then added -a flag to the netdev to check for it as follows: - -- dev->br_port) { -+ (dev->priv_flags & IFF_BRIDGE_PORT)) { - -So to backport this we instead rely on a br_port_exists() call -which compat.git provides and depending on the kernel it will either -check for the dev->br_port or the IFF_BRIDGE_PORT flag. A patch -to get the blow code merged upstream and to use br_port_exists() -everywhere else will be submitted but not sure if it will be -accepted. - -This patch can be removed once we get br_port_exists() accessible -to drivers and not just private bridge code. If that patch doesn't -get accepted upstream we'l have to carry this patch around for -compat-drivers. - ---- a/net/wireless/util.c -+++ b/net/wireless/util.c -@@ -813,7 +813,7 @@ int cfg80211_change_iface(struct cfg8021 - return -EOPNOTSUPP; - - /* if it's part of a bridge, reject changing type to station/ibss */ -- if ((dev->priv_flags & IFF_BRIDGE_PORT) && -+ if (br_port_exists(dev) && - (ntype == NL80211_IFTYPE_ADHOC || - ntype == NL80211_IFTYPE_STATION || - ntype == NL80211_IFTYPE_P2P_CLIENT)) ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -2014,7 +2014,7 @@ static int nl80211_valid_4addr(struct cf - enum nl80211_iftype iftype) - { - if (!use_4addr) { -- if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT)) -+ if (netdev && br_port_exists(netdev)) - return -EBUSY; - return 0; - } diff --git a/patches/network/32-remove-ns-type.patch b/patches/network/32-remove-ns-type.patch deleted file mode 100644 index 8e981b79082e..000000000000 --- a/patches/network/32-remove-ns-type.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/net/wireless/sysfs.c -+++ b/net/wireless/sysfs.c -@@ -122,12 +122,14 @@ static int wiphy_resume(struct device *d - return ret; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - static const void *wiphy_namespace(struct device *d) - { - struct wiphy *wiphy = container_of(d, struct wiphy, dev); - - return wiphy_net(wiphy); - } -+#endif - - struct class ieee80211_class = { - .name = "ieee80211", -@@ -139,8 +141,10 @@ struct class ieee80211_class = { - #endif - .suspend = wiphy_suspend, - .resume = wiphy_resume, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - .ns_type = &net_ns_type_operations, - .namespace = wiphy_namespace, -+#endif - }; - - int wiphy_sysfs_init(void) diff --git a/patches/network/35-fix-makefile-includes.patch b/patches/network/35-fix-makefile-includes.patch deleted file mode 100644 index d0e0089c6b1e..000000000000 --- a/patches/network/35-fix-makefile-includes.patch +++ /dev/null @@ -1,71 +0,0 @@ -When some other headers are included in some makefile it must be -relative to the current object file processed. When giving the full -path the make process will search in the kernel tree for the headers. - ---- a/drivers/net/wireless/rtl818x/rtl8180/Makefile -+++ b/drivers/net/wireless/rtl818x/rtl8180/Makefile -@@ -2,4 +2,4 @@ rtl8180-objs := dev.o rtl8225.o sa2400. - - obj-$(CONFIG_RTL8180) += rtl8180.o - --ccflags-y += -Idrivers/net/wireless/rtl818x -+ccflags-y += -I$(obj)/.. ---- a/drivers/net/wireless/rtl818x/rtl8187/Makefile -+++ b/drivers/net/wireless/rtl818x/rtl8187/Makefile -@@ -2,4 +2,4 @@ rtl8187-objs := dev.o rtl8225.o leds.o - - obj-$(CONFIG_RTL8187) += rtl8187.o - --ccflags-y += -Idrivers/net/wireless/rtl818x -+ccflags-y += -I$(obj)/.. ---- a/drivers/net/wireless/brcm80211/brcmfmac/Makefile -+++ b/drivers/net/wireless/brcm80211/brcmfmac/Makefile -@@ -16,8 +16,8 @@ - # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ccflags-y += \ -- -Idrivers/net/wireless/brcm80211/brcmfmac \ -- -Idrivers/net/wireless/brcm80211/include -+ -I$(obj) \ -+ -I$(obj)/../include - - ccflags-y += -D__CHECK_ENDIAN__ - ---- a/drivers/net/wireless/brcm80211/brcmsmac/Makefile -+++ b/drivers/net/wireless/brcm80211/brcmsmac/Makefile -@@ -17,9 +17,9 @@ - - ccflags-y := \ - -D__CHECK_ENDIAN__ \ -- -Idrivers/net/wireless/brcm80211/brcmsmac \ -- -Idrivers/net/wireless/brcm80211/brcmsmac/phy \ -- -Idrivers/net/wireless/brcm80211/include -+ -I$(obj) \ -+ -I$(obj)/phy \ -+ -I$(obj)/../include - - BRCMSMAC_OFILES := \ - mac80211_if.o \ ---- a/drivers/net/wireless/brcm80211/brcmutil/Makefile -+++ b/drivers/net/wireless/brcm80211/brcmutil/Makefile -@@ -16,8 +16,8 @@ - # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ccflags-y := \ -- -Idrivers/net/wireless/brcm80211/brcmutil \ -- -Idrivers/net/wireless/brcm80211/include -+ -I$(obj) \ -+ -I$(obj)/../include - - BRCMUTIL_OFILES := \ - utils.o ---- a/net/wireless/Makefile -+++ b/net/wireless/Makefile -@@ -20,6 +20,6 @@ CFLAGS_trace.o := -I$(src) - ccflags-y += -D__CHECK_ENDIAN__ - - $(obj)/regdb.c: $(src)/db.txt $(src)/genregdb.awk -- @$(AWK) -f $(srctree)/$(src)/genregdb.awk < $< > $@ -+ @$(AWK) -f $(src)/genregdb.awk < $< > $@ - - clean-files := regdb.c diff --git a/patches/network/36-workqueue.patch b/patches/network/36-workqueue.patch deleted file mode 100644 index f7a2b1a701f0..000000000000 --- a/patches/network/36-workqueue.patch +++ /dev/null @@ -1,16 +0,0 @@ -Backport commit 99b88a0ecbdbc6df03527292571b2b442965814a -The rest is backported in include/linux/compat-2.6.37.h - ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -1194,6 +1194,10 @@ static void __exit ieee80211_exit(void) - rc80211_minstrel_ht_exit(); - rc80211_minstrel_exit(); - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) -+ flush_scheduled_work(); -+#endif -+ - if (mesh_allocated) - ieee80211s_stop(); - diff --git a/patches/network/37-vsnprintk.patch b/patches/network/37-vsnprintk.patch deleted file mode 100644 index 2a3d30440034..000000000000 --- a/patches/network/37-vsnprintk.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/drivers/net/wireless/ath/main.c -+++ b/drivers/net/wireless/ath/main.c -@@ -59,6 +59,7 @@ struct sk_buff *ath_rxbuf_alloc(struct a - } - EXPORT_SYMBOL(ath_rxbuf_alloc); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - void ath_printk(const char *level, const struct ath_common* common, - const char *fmt, ...) - { -@@ -78,4 +79,24 @@ void ath_printk(const char *level, const - - va_end(args); - } -+#else -+void ath_printk(const char *level, const struct ath_common* common, -+ const char *fmt, ...) -+{ -+ va_list args; -+ -+ va_start(args, fmt); -+ -+ if (common && common->hw && common->hw->wiphy) -+ printk("%sath: %s: ", -+ level, wiphy_name(common->hw->wiphy)); -+ else -+ printk("%sath: ", level); -+ -+ vprintk(fmt, args); -+ -+ va_end(args); -+} -+#endif -+ - EXPORT_SYMBOL(ath_printk); diff --git a/patches/network/38-led-max-brightness.patch b/patches/network/38-led-max-brightness.patch deleted file mode 100644 index fa0dee71b0e6..000000000000 --- a/patches/network/38-led-max-brightness.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/drivers/net/wireless/iwlegacy/common.c -+++ b/drivers/net/wireless/iwlegacy/common.c -@@ -562,7 +562,9 @@ il_leds_init(struct il_priv *il) - kasprintf(GFP_KERNEL, "%s-led", wiphy_name(il->hw->wiphy)); - il->led.brightness_set = il_led_brightness_set; - il->led.blink_set = il_led_blink_set; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) - il->led.max_brightness = 1; -+#endif - - switch (mode) { - case IL_LED_DEFAULT: ---- a/drivers/net/wireless/iwlwifi/dvm/led.c -+++ b/drivers/net/wireless/iwlwifi/dvm/led.c -@@ -187,7 +187,9 @@ void iwl_leds_init(struct iwl_priv *priv - wiphy_name(priv->hw->wiphy)); - priv->led.brightness_set = iwl_led_brightness_set; - priv->led.blink_set = iwl_led_blink_set; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) - priv->led.max_brightness = 1; -+#endif - - switch (mode) { - case IWL_LED_DEFAULT: diff --git a/patches/network/39-remove_blink_set.patch b/patches/network/39-remove_blink_set.patch deleted file mode 100644 index dc9af73fb7b1..000000000000 --- a/patches/network/39-remove_blink_set.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/drivers/net/wireless/iwlegacy/common.c -+++ b/drivers/net/wireless/iwlegacy/common.c -@@ -540,6 +540,7 @@ il_led_brightness_set(struct led_classde - il_led_cmd(il, on, 0); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) - static int - il_led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on, - unsigned long *delay_off) -@@ -548,6 +549,7 @@ il_led_blink_set(struct led_classdev *le - - return il_led_cmd(il, *delay_on, *delay_off); - } -+#endif - - void - il_leds_init(struct il_priv *il) -@@ -561,7 +563,9 @@ il_leds_init(struct il_priv *il) - il->led.name = - kasprintf(GFP_KERNEL, "%s-led", wiphy_name(il->hw->wiphy)); - il->led.brightness_set = il_led_brightness_set; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) - il->led.blink_set = il_led_blink_set; -+#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) - il->led.max_brightness = 1; - #endif ---- a/drivers/net/wireless/iwlwifi/dvm/led.c -+++ b/drivers/net/wireless/iwlwifi/dvm/led.c -@@ -162,6 +162,7 @@ static void iwl_led_brightness_set(struc - iwl_led_cmd(priv, on, 0); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) - static int iwl_led_blink_set(struct led_classdev *led_cdev, - unsigned long *delay_on, - unsigned long *delay_off) -@@ -170,6 +171,7 @@ static int iwl_led_blink_set(struct led_ - - return iwl_led_cmd(priv, *delay_on, *delay_off); - } -+#endif - - void iwl_leds_init(struct iwl_priv *priv) - { -@@ -186,7 +188,9 @@ void iwl_leds_init(struct iwl_priv *priv - priv->led.name = kasprintf(GFP_KERNEL, "%s-led", - wiphy_name(priv->hw->wiphy)); - priv->led.brightness_set = iwl_led_brightness_set; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) - priv->led.blink_set = iwl_led_blink_set; -+#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) - priv->led.max_brightness = 1; - #endif diff --git a/patches/network/40-netdev-hw-features.patch b/patches/network/40-netdev-hw-features.patch deleted file mode 100644 index 605e97f1d281..000000000000 --- a/patches/network/40-netdev-hw-features.patch +++ /dev/null @@ -1,372 +0,0 @@ -This reverts the commits that deal with hw_features and -set_features, fix_features for kernels < 2.6.39. - -Below is one example commit being reverted, but we also do -this for ath6kl and any driver that uses this in this file. - -commit 782d640afd15af7a1faf01cfe566ca4ac511319d -Author: Michał Mirosław -Date: Thu Apr 7 07:32:18 2011 +0000 - - net: atl*: convert to hw_features - - Things left as they were: - - atl1: is RX checksum really enabled? - - atl2: copy-paste from atl1, with-errors-on-modify I presume - - atl1c: there's a bug: MTU can't be changed if device is not up - - Signed-off-by: Michał Mirosław - Signed-off-by: David S. Miller - ---- a/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c -+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c -@@ -114,6 +114,13 @@ static int atl1c_set_settings(struct net - return 0; - } - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) -+static u32 atl1c_get_tx_csum(struct net_device *netdev) -+{ -+ return (netdev->features & NETIF_F_HW_CSUM) != 0; -+} -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ -+ - static u32 atl1c_get_msglevel(struct net_device *netdev) - { - struct atl1c_adapter *adapter = netdev_priv(netdev); -@@ -301,6 +308,11 @@ static const struct ethtool_ops atl1c_et - .get_link = ethtool_op_get_link, - .get_eeprom_len = atl1c_get_eeprom_len, - .get_eeprom = atl1c_get_eeprom, -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) -+ .get_tx_csum = atl1c_get_tx_csum, -+ .get_sg = ethtool_op_get_sg, -+ .set_sg = ethtool_op_set_sg, -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ - }; - - void atl1c_set_ethtool_ops(struct net_device *netdev) ---- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -@@ -492,6 +492,7 @@ static void atl1c_set_rxbufsize(struct a - roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - static netdev_features_t atl1c_fix_features(struct net_device *netdev, - netdev_features_t features) - { -@@ -520,6 +521,7 @@ static int atl1c_set_features(struct net - - return 0; - } -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - - /** - * atl1c_change_mtu - Change the Maximum Transfer Unit -@@ -552,8 +554,19 @@ static int atl1c_change_mtu(struct net_d - netdev->mtu = new_mtu; - adapter->hw.max_frame_size = new_mtu; - atl1c_set_rxbufsize(adapter, netdev); -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) -+ if (new_mtu > MAX_TSO_FRAME_SIZE) { -+ adapter->netdev->features &= ~NETIF_F_TSO; -+ adapter->netdev->features &= ~NETIF_F_TSO6; -+ } else { -+ adapter->netdev->features |= NETIF_F_TSO; -+ adapter->netdev->features |= NETIF_F_TSO6; -+ } -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ - atl1c_down(adapter); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - netdev_update_features(netdev); -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - atl1c_up(adapter); - clear_bit(__AT_RESETTING, &adapter->flags); - } -@@ -2405,8 +2418,10 @@ static const struct net_device_ops atl1c - .ndo_set_mac_address = atl1c_set_mac_addr, - .ndo_set_rx_mode = atl1c_set_multi, - .ndo_change_mtu = atl1c_change_mtu, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - .ndo_fix_features = atl1c_fix_features, - .ndo_set_features = atl1c_set_features, -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - .ndo_do_ioctl = atl1c_ioctl, - .ndo_tx_timeout = atl1c_tx_timeout, - .ndo_get_stats = atl1c_get_stats, -@@ -2425,6 +2440,7 @@ static int atl1c_init_netdev(struct net_ - atl1c_set_ethtool_ops(netdev); - - /* TODO: add when ready */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - netdev->hw_features = NETIF_F_SG | - NETIF_F_HW_CSUM | - NETIF_F_HW_VLAN_RX | -@@ -2432,6 +2448,14 @@ static int atl1c_init_netdev(struct net_ - NETIF_F_TSO6; - netdev->features = netdev->hw_features | - NETIF_F_HW_VLAN_TX; -+#else -+ netdev->features = NETIF_F_SG | -+ NETIF_F_HW_CSUM | -+ NETIF_F_HW_VLAN_TX | -+ NETIF_F_HW_VLAN_RX | -+ NETIF_F_TSO | -+ NETIF_F_TSO6; -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - return 0; - } - ---- a/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c -+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c -@@ -384,6 +384,11 @@ static const struct ethtool_ops atl1e_et - .get_eeprom_len = atl1e_get_eeprom_len, - .get_eeprom = atl1e_get_eeprom, - .set_eeprom = atl1e_set_eeprom, -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) -+ .set_tx_csum = ethtool_op_set_tx_hw_csum, -+ .set_sg = ethtool_op_set_sg, -+ .set_tso = ethtool_op_set_tso, -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ - }; - - void atl1e_set_ethtool_ops(struct net_device *netdev) ---- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c -+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c -@@ -375,6 +375,7 @@ static int atl1e_set_mac_addr(struct net - return 0; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - static netdev_features_t atl1e_fix_features(struct net_device *netdev, - netdev_features_t features) - { -@@ -400,6 +401,7 @@ static int atl1e_set_features(struct net - - return 0; - } -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - - /** - * atl1e_change_mtu - Change the Maximum Transfer Unit -@@ -1929,7 +1931,11 @@ void atl1e_down(struct atl1e_adapter *ad - * reschedule our watchdog timer */ - set_bit(__AT_DOWN, &adapter->flags); - -+#if defined(NETIF_F_LLTX) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - netif_stop_queue(netdev); -+#else -+ netif_tx_disable(netdev); -+#endif - - /* reset MAC to disable all RX/TX */ - atl1e_reset_hw(&adapter->hw); -@@ -2199,8 +2205,10 @@ static const struct net_device_ops atl1e - .ndo_set_rx_mode = atl1e_set_multi, - .ndo_validate_addr = eth_validate_addr, - .ndo_set_mac_address = atl1e_set_mac_addr, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - .ndo_fix_features = atl1e_fix_features, - .ndo_set_features = atl1e_set_features, -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - .ndo_change_mtu = atl1e_change_mtu, - .ndo_do_ioctl = atl1e_ioctl, - .ndo_tx_timeout = atl1e_tx_timeout, -@@ -2220,10 +2228,15 @@ static int atl1e_init_netdev(struct net_ - netdev->watchdog_timeo = AT_TX_WATCHDOG; - atl1e_set_ethtool_ops(netdev); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - netdev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | - NETIF_F_HW_VLAN_RX; - netdev->features = netdev->hw_features | NETIF_F_LLTX | - NETIF_F_HW_VLAN_TX; -+#else -+ netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | -+ NETIF_F_HW_VLAN_RX | NETIF_F_LLTX | NETIF_F_HW_VLAN_TX; -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - - return 0; - } ---- a/drivers/net/ethernet/atheros/atlx/atl1.c -+++ b/drivers/net/ethernet/atheros/atlx/atl1.c -@@ -2917,8 +2917,10 @@ static const struct net_device_ops atl1_ - .ndo_validate_addr = eth_validate_addr, - .ndo_set_mac_address = atl1_set_mac, - .ndo_change_mtu = atl1_change_mtu, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - .ndo_fix_features = atlx_fix_features, - .ndo_set_features = atlx_set_features, -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - .ndo_do_ioctl = atlx_ioctl, - .ndo_tx_timeout = atlx_tx_timeout, - #ifdef CONFIG_NET_POLL_CONTROLLER -@@ -3029,11 +3031,13 @@ static int __devinit atl1_probe(struct p - netdev->features |= NETIF_F_SG; - netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - netdev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_TSO | - NETIF_F_HW_VLAN_RX; - - /* is this valid? see atl1_setup_mac_ctrl() */ - netdev->features |= NETIF_F_RXCSUM; -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - - /* - * patch for some L1 of old version, -@@ -3646,6 +3650,14 @@ static int atl1_set_pauseparam(struct ne - return 0; - } - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) -+/* FIXME: is this right? -- CHS */ -+static u32 atl1_get_rx_csum(struct net_device *netdev) -+{ -+ return 1; -+} -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ -+ - static void atl1_get_strings(struct net_device *netdev, u32 stringset, - u8 *data) - { -@@ -3718,4 +3730,10 @@ static const struct ethtool_ops atl1_eth - .nway_reset = atl1_nway_reset, - .get_ethtool_stats = atl1_get_ethtool_stats, - .get_sset_count = atl1_get_sset_count, -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) -+ .get_rx_csum = atl1_get_rx_csum, -+ .set_tx_csum = ethtool_op_set_tx_hw_csum, -+ .set_sg = ethtool_op_set_sg, -+ .set_tso = ethtool_op_set_tso, -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ - }; ---- a/drivers/net/ethernet/atheros/atlx/atl2.c -+++ b/drivers/net/ethernet/atheros/atlx/atl2.c -@@ -396,6 +396,7 @@ static void atl2_restore_vlan(struct atl - atl2_vlan_mode(adapter->netdev, adapter->netdev->features); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - static netdev_features_t atl2_fix_features(struct net_device *netdev, - netdev_features_t features) - { -@@ -421,6 +422,7 @@ static int atl2_set_features(struct net_ - - return 0; - } -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - - static void atl2_intr_rx(struct atl2_adapter *adapter) - { -@@ -1322,8 +1324,10 @@ static const struct net_device_ops atl2_ - .ndo_validate_addr = eth_validate_addr, - .ndo_set_mac_address = atl2_set_mac, - .ndo_change_mtu = atl2_change_mtu, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - .ndo_fix_features = atl2_fix_features, - .ndo_set_features = atl2_set_features, -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - .ndo_do_ioctl = atl2_ioctl, - .ndo_tx_timeout = atl2_tx_timeout, - #ifdef CONFIG_NET_POLL_CONTROLLER -@@ -1421,8 +1425,12 @@ static int __devinit atl2_probe(struct p - - err = -EIO; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_RX; -+#endif -+#if defined(NETIF_F_HW_VLAN_TX) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); -+#endif - - /* Init PHY as early as possible due to power saving issue */ - atl2_phy_init(&adapter->hw); -@@ -1849,6 +1857,13 @@ static int atl2_set_settings(struct net_ - return 0; - } - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) -+static u32 atl2_get_tx_csum(struct net_device *netdev) -+{ -+ return (netdev->features & NETIF_F_HW_CSUM) != 0; -+} -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ -+ - static u32 atl2_get_msglevel(struct net_device *netdev) - { - return 0; -@@ -2118,6 +2133,14 @@ static const struct ethtool_ops atl2_eth - .get_eeprom_len = atl2_get_eeprom_len, - .get_eeprom = atl2_get_eeprom, - .set_eeprom = atl2_set_eeprom, -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) -+ .get_tx_csum = atl2_get_tx_csum, -+ .get_sg = ethtool_op_get_sg, -+ .set_sg = ethtool_op_set_sg, -+#ifdef NETIF_F_TSO -+ .get_tso = ethtool_op_get_tso, -+#endif -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ - }; - - static void atl2_set_ethtool_ops(struct net_device *netdev) ---- a/drivers/net/ethernet/atheros/atlx/atlx.c -+++ b/drivers/net/ethernet/atheros/atlx/atlx.c -@@ -255,6 +255,7 @@ static void atlx_restore_vlan(struct atl - atlx_vlan_mode(adapter->netdev, adapter->netdev->features); - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - static netdev_features_t atlx_fix_features(struct net_device *netdev, - netdev_features_t features) - { -@@ -280,5 +281,6 @@ static int atlx_set_features(struct net_ - - return 0; - } -+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ - - #endif /* ATLX_C */ ---- a/drivers/net/wireless/ath/ath6kl/main.c -+++ b/drivers/net/wireless/ath/ath6kl/main.c -@@ -1149,6 +1149,7 @@ static struct net_device_stats *ath6kl_g - return &vif->net_stats; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - static int ath6kl_set_features(struct net_device *dev, - netdev_features_t features) - { -@@ -1181,6 +1182,7 @@ static int ath6kl_set_features(struct ne - - return err; - } -+#endif - - static void ath6kl_set_multicast_list(struct net_device *ndev) - { -@@ -1328,7 +1330,9 @@ static const struct net_device_ops ath6k - .ndo_stop = ath6kl_close, - .ndo_start_xmit = ath6kl_data_tx, - .ndo_get_stats = ath6kl_get_stats, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - .ndo_set_features = ath6kl_set_features, -+#endif - .ndo_set_rx_mode = ath6kl_set_multicast_list, - }; - -@@ -1343,7 +1347,11 @@ void init_netdev(struct net_device *dev) - sizeof(struct wmi_data_hdr) + HTC_HDR_LENGTH - + WMI_MAX_TX_META_SZ + ATH6KL_HTC_ALIGN_BYTES; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) - dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM; -+#else -+ dev->features |= NETIF_F_IP_CSUM; -+#endif - - return; - } diff --git a/patches/network/42-netlink_seq.patch b/patches/network/42-netlink_seq.patch deleted file mode 100644 index bb065ab1cbca..000000000000 --- a/patches/network/42-netlink_seq.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -4910,7 +4910,9 @@ static int nl80211_dump_scan(struct sk_b - spin_lock_bh(&rdev->bss_lock); - cfg80211_bss_expire(rdev); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) - cb->seq = rdev->bss_generation; -+#endif - - list_for_each_entry(scan, &rdev->bss_list, list) { - if (++idx <= start) diff --git a/patches/network/43-rename_pm_qos_request.patch b/patches/network/43-rename_pm_qos_request.patch deleted file mode 100644 index d000d913d3d5..000000000000 --- a/patches/network/43-rename_pm_qos_request.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/drivers/net/wireless/ipw2x00/ipw2100.c -+++ b/drivers/net/wireless/ipw2x00/ipw2100.c -@@ -175,7 +175,11 @@ that only one external action is invoked - #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver" - #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) -+static struct pm_qos_request_list ipw2100_pm_qos_req; -+#else - static struct pm_qos_request ipw2100_pm_qos_req; -+#endif - - /* Debugging stuff */ - #ifdef CONFIG_IPW2100_DEBUG diff --git a/patches/network/44-deactivate-mac80211-tracing.patch b/patches/network/44-deactivate-mac80211-tracing.patch deleted file mode 100644 index 9c9858ddb1ee..000000000000 --- a/patches/network/44-deactivate-mac80211-tracing.patch +++ /dev/null @@ -1,27 +0,0 @@ -Do not activate the mac80211 tracing for kernels <= 2.6.32 - ---- a/net/mac80211/Makefile -+++ b/net/mac80211/Makefile -@@ -25,7 +25,9 @@ mac80211-y := \ - wme.o \ - event.o \ - chan.o \ -- trace.o mlme.o -+ mlme.o -+ -+mac80211-$(CONFIG_COMPAT_MAC80211_DRIVER_API_TRACER) += trace.o - - mac80211-$(CONFIG_MAC80211_LEDS) += led.o - mac80211-$(CONFIG_MAC80211_DEBUGFS) += \ ---- a/net/wireless/Makefile -+++ b/net/wireless/Makefile -@@ -10,7 +10,8 @@ obj-$(CONFIG_WEXT_SPY) += wext-spy.o - obj-$(CONFIG_WEXT_PRIV) += wext-priv.o - - cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o --cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o trace.o -+cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o -+cfg80211-$(CONFIG_COMPAT_CFG80211_DRIVER_API_TRACER) += trace.o - cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o - cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o - cfg80211-$(CONFIG_CFG80211_INTERNAL_REGDB) += regdb.o diff --git a/patches/network/45-remove-platform-id-table.patch b/patches/network/45-remove-platform-id-table.patch deleted file mode 100644 index 886b52d222de..000000000000 --- a/patches/network/45-remove-platform-id-table.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/drivers/net/wireless/ti/wl12xx/main.c -+++ b/drivers/net/wireless/ti/wl12xx/main.c -@@ -1725,16 +1725,20 @@ out: - return ret; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) - static const struct platform_device_id wl12xx_id_table[] __devinitconst = { - { "wl12xx", 0 }, - { } /* Terminating Entry */ - }; - MODULE_DEVICE_TABLE(platform, wl12xx_id_table); -+#endif - - static struct platform_driver wl12xx_driver = { - .probe = wl12xx_probe, - .remove = __devexit_p(wlcore_remove), -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) - .id_table = wl12xx_id_table, -+#endif - .driver = { - .name = "wl12xx_driver", - .owner = THIS_MODULE, diff --git a/patches/network/46-use_other_workqueue.patch b/patches/network/46-use_other_workqueue.patch deleted file mode 100644 index 16fa39b56b0e..000000000000 --- a/patches/network/46-use_other_workqueue.patch +++ /dev/null @@ -1,19 +0,0 @@ -Old kernel versions do not support WQ_HIGHPRI and WQ_MEM_RECLAIM so we -should use create_singlethread_workqueue() which was used at this -position before. - ---- a/net/bluetooth/hci_core.c -+++ b/net/bluetooth/hci_core.c -@@ -1789,8 +1789,12 @@ int hci_register_dev(struct hci_dev *hde - list_add(&hdev->list, &hci_dev_list); - write_unlock(&hci_dev_list_lock); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - hdev->workqueue = alloc_workqueue(hdev->name, WQ_HIGHPRI | WQ_UNBOUND | - WQ_MEM_RECLAIM, 1); -+#else -+ hdev->workqueue = create_singlethread_workqueue(hdev->name); -+#endif - if (!hdev->workqueue) { - error = -ENOMEM; - goto err; diff --git a/patches/network/47-no_trans_start_on_netdev_queue.patch b/patches/network/47-no_trans_start_on_netdev_queue.patch deleted file mode 100644 index 8dea0756e651..000000000000 --- a/patches/network/47-no_trans_start_on_netdev_queue.patch +++ /dev/null @@ -1,17 +0,0 @@ -The struct netdev_queue does not have the attribute trans_start in -kernel < 2.6.31. trans_start on struct net_device does the same -on older kernels. - ---- a/drivers/net/wireless/mwifiex/init.c -+++ b/drivers/net/wireless/mwifiex/init.c -@@ -375,8 +375,10 @@ void mwifiex_set_trans_start(struct net_ - { - int i; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)) - for (i = 0; i < dev->num_tx_queues; i++) - netdev_get_tx_queue(dev, i)->trans_start = jiffies; -+#endif - - dev->trans_start = jiffies; - } diff --git a/patches/network/48-use_skb_get_queue_mapping.patch b/patches/network/48-use_skb_get_queue_mapping.patch deleted file mode 100644 index f27801d73c92..000000000000 --- a/patches/network/48-use_skb_get_queue_mapping.patch +++ /dev/null @@ -1,38 +0,0 @@ -Use skb_get_queue_mapping() for getting the queue_mapping member of -skb. Some old kernels do not have the member queue_mapping, but this -function always returns something. - ---- a/drivers/net/wireless/b43/main.c -+++ b/drivers/net/wireless/b43/main.c -@@ -3424,11 +3424,11 @@ static void b43_op_tx(struct ieee80211_h - } - B43_WARN_ON(skb_shinfo(skb)->nr_frags); - -- skb_queue_tail(&wl->tx_queue[skb->queue_mapping], skb); -- if (!wl->tx_queue_stopped[skb->queue_mapping]) { -+ skb_queue_tail(&wl->tx_queue[skb_get_queue_mapping(skb)], skb); -+ if (!wl->tx_queue_stopped[skb_get_queue_mapping(skb)]) { - ieee80211_queue_work(wl->hw, &wl->tx_work); - } else { -- ieee80211_stop_queue(wl->hw, skb->queue_mapping); -+ ieee80211_stop_queue(wl->hw, skb_get_queue_mapping(skb)); - } - } - ---- a/drivers/net/wireless/b43legacy/main.c -+++ b/drivers/net/wireless/b43legacy/main.c -@@ -2504,11 +2504,11 @@ static void b43legacy_op_tx(struct ieee8 - } - B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags); - -- skb_queue_tail(&wl->tx_queue[skb->queue_mapping], skb); -- if (!wl->tx_queue_stopped[skb->queue_mapping]) -+ skb_queue_tail(&wl->tx_queue[skb_get_queue_mapping(skb)], skb); -+ if (!wl->tx_queue_stopped[skb_get_queue_mapping(skb)]) - ieee80211_queue_work(wl->hw, &wl->tx_work); - else -- ieee80211_stop_queue(wl->hw, skb->queue_mapping); -+ ieee80211_stop_queue(wl->hw, skb_get_queue_mapping(skb)); - } - - static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, diff --git a/patches/network/50-libertas-olpc-ec-wakeup.patch b/patches/network/50-libertas-olpc-ec-wakeup.patch deleted file mode 100644 index 5997a7527b5a..000000000000 --- a/patches/network/50-libertas-olpc-ec-wakeup.patch +++ /dev/null @@ -1,23 +0,0 @@ -This section of the libertas driver calls functions that simply don't -exist before the release of 3.1. This code in question was an addition, -not a change from any existing code. It is safe to simply remove it for -older kernels. - ---- a/drivers/net/wireless/libertas/if_usb.c -+++ b/drivers/net/wireless/libertas/if_usb.c -@@ -962,6 +962,7 @@ static int if_usb_suspend(struct usb_int - goto out; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) - #ifdef CONFIG_OLPC - if (machine_is_olpc()) { - if (priv->wol_criteria == EHS_REMOVE_WAKEUP) -@@ -970,6 +971,7 @@ static int if_usb_suspend(struct usb_int - olpc_ec_wakeup_set(EC_SCI_SRC_WLAN); - } - #endif -+#endif - - ret = lbs_suspend(priv); - if (ret) diff --git a/patches/network/52-tty-dev.patch b/patches/network/52-tty-dev.patch deleted file mode 100644 index 659aa6928b4b..000000000000 --- a/patches/network/52-tty-dev.patch +++ /dev/null @@ -1,32 +0,0 @@ - -tty->dev does not exist until 2.6.37. Typically -subsystems will assign the tty device to a child -to make a symlink under /sys/class/foobar. An example -is the bluetooth subsystem. - -commit 7f4b2b04c88377af30c022f36c060190182850fb -Author: Andrei Warkentin -Date: Fri Feb 11 17:19:26 2011 -0600 - - Bluetooth: Make hci a child of the corresponding tty device. - - Make /sys/class/bluetooth/hciX a symlink to - path under corresponding tty. - - Signed-off-by: Andrei Warkentin - Signed-off-by: Gustavo F. Padovan - - ---- a/drivers/bluetooth/hci_ldisc.c -+++ b/drivers/bluetooth/hci_ldisc.c -@@ -421,7 +421,10 @@ static int hci_uart_register_dev(struct - hdev->close = hci_uart_close; - hdev->flush = hci_uart_flush; - hdev->send = hci_uart_send_frame; -+ -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)) - SET_HCIDEV_DEV(hdev, hu->tty->dev); -+#endif - - if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags)) - set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); diff --git a/patches/network/53-pr_fmt.patch b/patches/network/53-pr_fmt.patch deleted file mode 100644 index 9dc8d6446583..000000000000 --- a/patches/network/53-pr_fmt.patch +++ /dev/null @@ -1,820 +0,0 @@ -This is the correct way to use pr_fmt. This helps avoid -compiler warnings. This is going to be sent upstream. - ---- a/drivers/bcma/bcma_private.h -+++ b/drivers/bcma/bcma_private.h -@@ -1,10 +1,10 @@ - #ifndef LINUX_BCMA_PRIVATE_H_ - #define LINUX_BCMA_PRIVATE_H_ - --#ifndef pr_fmt -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt --#endif - -+#include - #include - #include - ---- a/drivers/net/ethernet/broadcom/b44.c -+++ b/drivers/net/ethernet/broadcom/b44.c -@@ -10,9 +10,11 @@ - * Distribute under GPL. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/drivers/net/wireless/iwlegacy/3945-mac.c -+++ b/drivers/net/wireless/iwlegacy/3945-mac.c -@@ -27,9 +27,11 @@ - * - *****************************************************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/drivers/net/wireless/iwlegacy/4965-mac.c -+++ b/drivers/net/wireless/iwlegacy/4965-mac.c -@@ -27,9 +27,11 @@ - * - *****************************************************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas/cfg.c -+++ b/drivers/net/wireless/libertas/cfg.c -@@ -6,8 +6,10 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas/if_usb.c -+++ b/drivers/net/wireless/libertas/if_usb.c -@@ -2,8 +2,10 @@ - * This file contains functions used in USB interface module. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas/if_sdio.c -+++ b/drivers/net/wireless/libertas/if_sdio.c -@@ -26,9 +26,11 @@ - * if_sdio_card_to_host() to pad the data. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas/if_spi.c -+++ b/drivers/net/wireless/libertas/if_spi.c -@@ -17,8 +17,10 @@ - * (at your option) any later version. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas/rx.c -+++ b/drivers/net/wireless/libertas/rx.c -@@ -2,8 +2,10 @@ - * This file contains the handling of RX in wlan driver. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas/if_cs.c -+++ b/drivers/net/wireless/libertas/if_cs.c -@@ -21,8 +21,10 @@ - - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas/mesh.c -+++ b/drivers/net/wireless/libertas/mesh.c -@@ -1,5 +1,7 @@ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas/main.c -+++ b/drivers/net/wireless/libertas/main.c -@@ -4,8 +4,10 @@ - * thread etc.. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas_tf/cmd.c -+++ b/drivers/net/wireless/libertas_tf/cmd.c -@@ -7,8 +7,10 @@ - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - */ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas_tf/if_usb.c -+++ b/drivers/net/wireless/libertas_tf/if_usb.c -@@ -9,11 +9,13 @@ - */ - #define DRV_NAME "lbtf_usb" - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "libertas_tf.h" - #include "if_usb.h" - -+#include - #include - #include - #include ---- a/drivers/net/wireless/libertas_tf/main.c -+++ b/drivers/net/wireless/libertas_tf/main.c -@@ -7,8 +7,10 @@ - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - */ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - ---- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c -+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c -@@ -14,9 +14,11 @@ - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - ---- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c -+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c -@@ -15,8 +15,10 @@ - */ - - #define __UNDEF_NO_VERSION__ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmsmac/main.c -+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c -@@ -14,8 +14,10 @@ - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmutil/utils.c -+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c -@@ -14,8 +14,10 @@ - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - ---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c -@@ -14,8 +14,10 @@ - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c -@@ -19,8 +19,10 @@ - * For certain dcmd codes, the dongle interprets string data from the host. - ******************************************************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - ---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c -@@ -15,8 +15,10 @@ - */ - /* ****************** SDIO CARD Interface Functions **************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c -@@ -14,10 +14,12 @@ - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include - #include -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c -@@ -14,9 +14,11 @@ - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c -@@ -15,8 +15,10 @@ - */ - /* ***** SDIO interface chip backplane handle functions ***** */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c -@@ -16,9 +16,11 @@ - - /* Toplevel file. Relies on dhd_linux.c to send commands to the dongle. */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c -@@ -14,6 +14,7 @@ - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include ---- a/net/bluetooth/lib.c -+++ b/net/bluetooth/lib.c -@@ -24,9 +24,11 @@ - - /* Bluetooth kernel library. */ - -+#undef pr_fmt - #define pr_fmt(fmt) "Bluetooth: " fmt - - #include -+#include - - #include - ---- a/net/wireless/lib80211.c -+++ b/net/wireless/lib80211.c -@@ -13,8 +13,10 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/net/wireless/reg.c -+++ b/net/wireless/reg.c -@@ -42,9 +42,11 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -4,8 +4,10 @@ - * Copyright 2006-2010 Johannes Berg - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/net/wireless/lib80211_crypt_tkip.c -+++ b/net/wireless/lib80211_crypt_tkip.c -@@ -10,8 +10,10 @@ - * more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c -+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c -@@ -16,8 +16,10 @@ - * File contents: support functions for PCI/PCIe - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - - #include ---- a/drivers/net/wireless/rtlwifi/wifi.h -+++ b/drivers/net/wireless/rtlwifi/wifi.h -@@ -30,8 +30,10 @@ - #ifndef __RTL_WIFI_H__ - #define __RTL_WIFI_H__ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/main.c -+++ b/drivers/net/wireless/ath/main.c -@@ -14,9 +14,11 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - - #include "ath.h" ---- a/drivers/net/wireless/ath/regd.c -+++ b/drivers/net/wireless/ath/regd.c -@@ -14,9 +14,11 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath5k/initvals.c -+++ b/drivers/net/wireless/ath/ath5k/initvals.c -@@ -19,8 +19,11 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "ath5k.h" - #include "reg.h" - #include "debug.h" ---- a/drivers/net/wireless/ath/ath5k/desc.c -+++ b/drivers/net/wireless/ath/ath5k/desc.c -@@ -21,8 +21,11 @@ - Hardware Descriptor Functions - \******************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "ath5k.h" - #include "reg.h" - #include "debug.h" ---- a/drivers/net/wireless/ath/ath5k/dma.c -+++ b/drivers/net/wireless/ath/ath5k/dma.c -@@ -29,8 +29,11 @@ - * status registers (ISR). - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "ath5k.h" - #include "reg.h" - #include "debug.h" ---- a/drivers/net/wireless/ath/ath5k/qcu.c -+++ b/drivers/net/wireless/ath/ath5k/qcu.c -@@ -20,8 +20,11 @@ - Queue Control Unit, DCF Control Unit Functions - \********************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "ath5k.h" - #include "reg.h" - #include "debug.h" ---- a/drivers/net/wireless/ath/ath5k/phy.c -+++ b/drivers/net/wireless/ath/ath5k/phy.c -@@ -22,8 +22,10 @@ - * PHY related functions * - \***********************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath5k/reset.c -+++ b/drivers/net/wireless/ath/ath5k/reset.c -@@ -23,10 +23,12 @@ - Reset function and helpers - \****************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include - -+#include - #include /* To determine if a card is pci-e */ - #include - #include ---- a/drivers/net/wireless/ath/ath5k/attach.c -+++ b/drivers/net/wireless/ath/ath5k/attach.c -@@ -20,8 +20,10 @@ - * Attach/Detach Functions and helpers * - \*************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include "ath5k.h" ---- a/drivers/net/wireless/ath/ath5k/base.c -+++ b/drivers/net/wireless/ath/ath5k/base.c -@@ -40,8 +40,10 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath5k/led.c -+++ b/drivers/net/wireless/ath/ath5k/led.c -@@ -39,8 +39,10 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include "ath5k.h" - ---- a/drivers/net/wireless/ath/ath5k/ani.c -+++ b/drivers/net/wireless/ath/ath5k/ani.c -@@ -14,8 +14,11 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "ath5k.h" - #include "reg.h" - #include "debug.h" ---- a/drivers/net/wireless/ath/ath5k/sysfs.c -+++ b/drivers/net/wireless/ath/ath5k/sysfs.c -@@ -1,5 +1,7 @@ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - ---- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c -+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c -@@ -41,11 +41,14 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include - #include - -+#include -+ - #include "ath5k.h" - #include "base.h" - #include "reg.h" ---- a/drivers/net/wireless/ath/ath5k/pci.c -+++ b/drivers/net/wireless/ath/ath5k/pci.c -@@ -14,8 +14,10 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath6kl/cfg80211.c -+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c -@@ -15,8 +15,10 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath6kl/init.c -+++ b/drivers/net/wireless/ath/ath6kl/init.c -@@ -16,8 +16,10 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath6kl/main.c -+++ b/drivers/net/wireless/ath/ath6kl/main.c -@@ -15,8 +15,11 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "core.h" - #include "hif-ops.h" - #include "cfg80211.h" ---- a/drivers/net/wireless/ath/ath6kl/txrx.c -+++ b/drivers/net/wireless/ath/ath6kl/txrx.c -@@ -15,8 +15,11 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "core.h" - #include "debug.h" - #include "htc-ops.h" ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -14,8 +14,10 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath9k/pci.c -+++ b/drivers/net/wireless/ath/ath9k/pci.c -@@ -14,8 +14,10 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath9k/htc_hst.c -+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c -@@ -14,8 +14,11 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "htc.h" - - static int htc_issue_send(struct htc_target *target, struct sk_buff* skb, ---- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c -+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c -@@ -14,8 +14,11 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include -+ - #include "htc.h" - - MODULE_AUTHOR("Atheros Communications"); ---- a/drivers/net/wireless/iwlwifi/dvm/main.c -+++ b/drivers/net/wireless/iwlwifi/dvm/main.c -@@ -27,8 +27,10 @@ - * - *****************************************************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/iwlwifi/pcie/drv.c -+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c -@@ -61,8 +61,10 @@ - * - *****************************************************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include ---- a/drivers/net/wireless/ath/ath5k/eeprom.c -+++ b/drivers/net/wireless/ath/ath5k/eeprom.c -@@ -21,8 +21,10 @@ - * EEPROM access functions and helpers * - \*************************************/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - - #include "ath5k.h" ---- a/drivers/net/wireless/ath/ath5k/debug.c -+++ b/drivers/net/wireless/ath/ath5k/debug.c -@@ -58,8 +58,10 @@ - * THE POSSIBILITY OF SUCH DAMAGES. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - diff --git a/patches/network/54-get_ts_info.patch b/patches/network/54-get_ts_info.patch deleted file mode 100644 index d28b39ba4990..000000000000 --- a/patches/network/54-get_ts_info.patch +++ /dev/null @@ -1,39 +0,0 @@ -Linux 3.5 will have get_ts_info to support the Precision Time Protocol. - -http://linuxptp.sourceforge.net/ -http://en.wikipedia.org/wiki/Precision_Time_Protocol - -We cannot backport this support given that this introduces -a data structure change on the ethtool_ops. - -commit c8f3a8c31069137fe0100e6920558f1a7487ef3c -Author: Richard Cochran -Date: Tue Apr 3 22:59:17 2012 +0000 - - ethtool: Introduce a method for getting time stamping capabilities. - - This commit adds a new ethtool ioctl that exposes the SO_TIMESTAMPING - capabilities of a network interface. In addition, user space programs - can use this ioctl to discover the PTP Hardware Clock (PHC) device - associated with the interface. - - Since software receive time stamps are handled by the stack, the generic - ethtool code can answer the query correctly in case the MAC or PHY - drivers lack special time stamping features. - - Signed-off-by: Richard Cochran - Reviewed-by: Ben Hutchings - Signed-off-by: David S. Miller - ---- a/drivers/net/usb/usbnet.c -+++ b/drivers/net/usb/usbnet.c -@@ -910,7 +910,9 @@ static const struct ethtool_ops usbnet_e - .get_drvinfo = usbnet_get_drvinfo, - .get_msglevel = usbnet_get_msglevel, - .set_msglevel = usbnet_set_msglevel, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .get_ts_info = ethtool_op_get_ts_info, -+#endif - }; - - /*-------------------------------------------------------------------------*/ diff --git a/patches/network/55-iwlwifi-msg-trace-fix.patch b/patches/network/55-iwlwifi-msg-trace-fix.patch deleted file mode 100644 index 6ccb5d19a2fb..000000000000 --- a/patches/network/55-iwlwifi-msg-trace-fix.patch +++ /dev/null @@ -1,70 +0,0 @@ -In recent kernels, %pV will copy the va_list before using it. -This isn't true for all kernels, so copy the va_list for use -by the dev_*() functions, otherwise the kernel will crash if -the message is printed and traced. - ---- a/drivers/net/wireless/iwlwifi/iwl-debug.c -+++ b/drivers/net/wireless/iwlwifi/iwl-debug.c -@@ -75,13 +75,16 @@ void __iwl_ ##fn(struct device *dev, con - struct va_format vaf = { \ - .fmt = fmt, \ - }; \ -- va_list args; \ -+ va_list args1, args2; \ - \ -- va_start(args, fmt); \ -- vaf.va = &args; \ -+ va_start(args1, fmt); \ -+ va_copy(args2, args1); \ -+ vaf.va = &args2; \ - dev_ ##fn(dev, "%pV", &vaf); \ -+ va_end(args2); \ -+ vaf.va = &args1; \ - trace_iwlwifi_ ##fn(&vaf); \ -- va_end(args); \ -+ va_end(args1); \ - } - - __iwl_fn(warn) -@@ -100,13 +103,18 @@ void __iwl_err(struct device *dev, bool - va_list args; - - va_start(args, fmt); -- vaf.va = &args; - if (!trace_only) { -+ va_list args2; -+ -+ va_copy(args2, args); -+ vaf.va = &args2; - if (rfkill_prefix) - dev_err(dev, "(RFKILL) %pV", &vaf); - else - dev_err(dev, "%pV", &vaf); -+ va_end(args2); - } -+ vaf.va = &args; - trace_iwlwifi_err(&vaf); - va_end(args); - } -@@ -123,13 +131,19 @@ void __iwl_dbg(struct device *dev, - va_list args; - - va_start(args, fmt); -- vaf.va = &args; - #ifdef CONFIG_IWLWIFI_DEBUG - if (iwl_have_debug_level(level) && -- (!limit || net_ratelimit())) -+ (!limit || net_ratelimit())) { -+ va_list args2; -+ -+ va_copy(args2, args); -+ vaf.va = &args2; - dev_dbg(dev, "%c %s %pV", in_interrupt() ? 'I' : 'U', - function, &vaf); -+ va_end(args2); -+ } - #endif -+ vaf.va = &args; - trace_iwlwifi_dbg(level, in_interrupt(), function, &vaf); - va_end(args); - } diff --git a/patches/network/56-mac80211-trace-fix.patch b/patches/network/56-mac80211-trace-fix.patch deleted file mode 100644 index 183cec252fe3..000000000000 --- a/patches/network/56-mac80211-trace-fix.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- a/net/mac80211/trace.c -+++ b/net/mac80211/trace.c -@@ -15,12 +15,16 @@ void __sdata_info(const char *fmt, ...) - struct va_format vaf = { - .fmt = fmt, - }; -- va_list args; -+ va_list args, args2; - - va_start(args, fmt); -- vaf.va = &args; - -+ va_copy(args2, args); -+ vaf.va = &args2; - pr_info("%pV", &vaf); -+ va_end(args2); -+ -+ vaf.va = &args; - trace_mac80211_info(&vaf); - va_end(args); - } -@@ -33,10 +37,16 @@ void __sdata_dbg(bool print, const char - va_list args; - - va_start(args, fmt); -- vaf.va = &args; - -- if (print) -+ if (print) { -+ va_list args2; -+ -+ va_copy(args2, args); -+ vaf.va = &args2; - pr_debug("%pV", &vaf); -+ va_end(args2); -+ } -+ vaf.va = &args; - trace_mac80211_dbg(&vaf); - va_end(args); - } -@@ -46,12 +56,16 @@ void __sdata_err(const char *fmt, ...) - struct va_format vaf = { - .fmt = fmt, - }; -- va_list args; -+ va_list args, args2; - - va_start(args, fmt); -- vaf.va = &args; - -+ va_copy(args2, args); -+ vaf.va = &args2; - pr_err("%pV", &vaf); -+ va_end(args2); -+ -+ vaf.va = &args; - trace_mac80211_err(&vaf); - va_end(args); - } -@@ -64,10 +78,16 @@ void __wiphy_dbg(struct wiphy *wiphy, bo - va_list args; - - va_start(args, fmt); -- vaf.va = &args; - -- if (print) -- wiphy_dbg(wiphy, "%pV", &vaf); -+ if (print) { -+ va_list args2; -+ -+ va_copy(args2, args); -+ vaf.va = &args2; -+ pr_debug("%pV", &vaf); -+ va_end(args2); -+ } -+ vaf.va = &args; - trace_mac80211_dbg(&vaf); - va_end(args); - } diff --git a/patches/network/57-iwlwifi-debug-fix.patch b/patches/network/57-iwlwifi-debug-fix.patch deleted file mode 100644 index 4b2dfa9d26f6..000000000000 --- a/patches/network/57-iwlwifi-debug-fix.patch +++ /dev/null @@ -1,19 +0,0 @@ -Due to compat including linux/device.h before we do, -we don't get a chance to #define DEBUG to get our -debugging prints. This patch replaces dev_dbg with -dev_printk to make them show up again. - ---- a/drivers/net/wireless/iwlwifi/iwl-debug.c -+++ b/drivers/net/wireless/iwlwifi/iwl-debug.c -@@ -138,8 +138,9 @@ void __iwl_dbg(struct device *dev, - - va_copy(args2, args); - vaf.va = &args2; -- dev_dbg(dev, "%c %s %pV", in_interrupt() ? 'I' : 'U', -- function, &vaf); -+ dev_printk(KERN_DEBUG, dev, "%c %s %pV", -+ in_interrupt() ? 'I' : 'U', -+ function, &vaf); - va_end(args2); - } - #endif diff --git a/patches/network/61-netdev-addr_assign_type.patch b/patches/network/61-netdev-addr_assign_type.patch deleted file mode 100644 index 8f8754e47a12..000000000000 --- a/patches/network/61-netdev-addr_assign_type.patch +++ /dev/null @@ -1,53 +0,0 @@ -You cannot backport assignment of netdev->addr_assign_type -given that its part of the netdev data structure only in future -kernels. - -mcgrof@tux ~/linux-next (git::master)$ git describe --contains c1f79426 -v2.6.36-rc1~571^2~104 - ---- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -@@ -476,7 +476,9 @@ static int atl1c_set_mac_addr(struct net - - memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); - memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - netdev->addr_assign_type &= ~NET_ADDR_RANDOM; -+#endif - - atl1c_hw_set_mac_addr(&adapter->hw, adapter->hw.mac_addr); - -@@ -2569,7 +2571,9 @@ static int __devinit atl1c_probe(struct - } - if (atl1c_read_mac_addr(&adapter->hw)) { - /* got a random MAC address, set NET_ADDR_RANDOM to netdev */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - netdev->addr_assign_type |= NET_ADDR_RANDOM; -+#endif - } - memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len); - memcpy(netdev->perm_addr, adapter->hw.mac_addr, netdev->addr_len); ---- a/drivers/net/ethernet/atheros/atlx/atlx.c -+++ b/drivers/net/ethernet/atheros/atlx/atlx.c -@@ -84,7 +84,9 @@ static int atlx_set_mac(struct net_devic - - memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); - memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - netdev->addr_assign_type &= ~NET_ADDR_RANDOM; -+#endif - - atlx_set_mac_addr(&adapter->hw); - return 0; ---- a/drivers/net/ethernet/atheros/atlx/atl1.c -+++ b/drivers/net/ethernet/atheros/atlx/atl1.c -@@ -3061,7 +3061,9 @@ static int __devinit atl1_probe(struct p - /* copy the MAC address out of the EEPROM */ - if (atl1_read_mac_addr(&adapter->hw)) { - /* mark random mac */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - netdev->addr_assign_type |= NET_ADDR_RANDOM; -+#endif - } - memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len); - diff --git a/patches/network/62-usb_driver_lpm.patch b/patches/network/62-usb_driver_lpm.patch deleted file mode 100644 index 02f18bbd35ce..000000000000 --- a/patches/network/62-usb_driver_lpm.patch +++ /dev/null @@ -1,276 +0,0 @@ ---- a/drivers/bluetooth/ath3k.c -+++ b/drivers/bluetooth/ath3k.c -@@ -453,7 +453,9 @@ static struct usb_driver ath3k_driver = - .probe = ath3k_probe, - .disconnect = ath3k_disconnect, - .id_table = ath3k_table, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(ath3k_driver); ---- a/drivers/bluetooth/bcm203x.c -+++ b/drivers/bluetooth/bcm203x.c -@@ -273,7 +273,9 @@ static struct usb_driver bcm203x_driver - .probe = bcm203x_probe, - .disconnect = bcm203x_disconnect, - .id_table = bcm203x_table, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(bcm203x_driver); ---- a/drivers/bluetooth/bfusb.c -+++ b/drivers/bluetooth/bfusb.c -@@ -745,7 +745,9 @@ static struct usb_driver bfusb_driver = - .probe = bfusb_probe, - .disconnect = bfusb_disconnect, - .id_table = bfusb_table, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(bfusb_driver); ---- a/drivers/bluetooth/bpa10x.c -+++ b/drivers/bluetooth/bpa10x.c -@@ -504,7 +504,9 @@ static struct usb_driver bpa10x_driver = - .probe = bpa10x_probe, - .disconnect = bpa10x_disconnect, - .id_table = bpa10x_table, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(bpa10x_driver); ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -1224,7 +1224,9 @@ static struct usb_driver btusb_driver = - #endif - .id_table = btusb_table, - .supports_autosuspend = 1, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(btusb_driver); ---- a/drivers/net/usb/cdc_ether.c -+++ b/drivers/net/usb/cdc_ether.c -@@ -716,7 +716,9 @@ static struct usb_driver cdc_driver = { - .resume = usbnet_resume, - .reset_resume = usbnet_resume, - .supports_autosuspend = 1, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(cdc_driver); ---- a/drivers/net/usb/rndis_host.c -+++ b/drivers/net/usb/rndis_host.c -@@ -643,7 +643,9 @@ static struct usb_driver rndis_driver = - .disconnect = usbnet_disconnect, - .suspend = usbnet_suspend, - .resume = usbnet_resume, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(rndis_driver); ---- a/drivers/net/wireless/at76c50x-usb.c -+++ b/drivers/net/wireless/at76c50x-usb.c -@@ -2453,7 +2453,9 @@ static struct usb_driver at76_driver = { - .probe = at76_probe, - .disconnect = at76_disconnect, - .id_table = dev_table, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - static int __init at76_mod_init(void) ---- a/drivers/net/wireless/ath/ath6kl/usb.c -+++ b/drivers/net/wireless/ath/ath6kl/usb.c -@@ -1201,7 +1201,9 @@ static struct usb_driver ath6kl_usb_driv - .disconnect = ath6kl_usb_remove, - .id_table = ath6kl_usb_ids, - .supports_autosuspend = true, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - static int ath6kl_usb_init(void) ---- a/drivers/net/wireless/ath/ath9k/hif_usb.c -+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c -@@ -1373,7 +1373,9 @@ static struct usb_driver ath9k_hif_usb_d - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) - .soft_unbind = 1, - #endif -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - int ath9k_hif_usb_init(void) ---- a/drivers/net/wireless/ath/carl9170/usb.c -+++ b/drivers/net/wireless/ath/carl9170/usb.c -@@ -1166,7 +1166,9 @@ static struct usb_driver carl9170_driver - .resume = carl9170_usb_resume, - .reset_resume = carl9170_usb_resume, - #endif /* CONFIG_PM */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(carl9170_driver); ---- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c -@@ -1502,7 +1502,9 @@ static struct usb_driver brcmf_usbdrvr = - .resume = brcmf_usb_resume, - .reset_resume = brcmf_usb_reset_resume, - .supports_autosuspend = 1, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - static void brcmf_release_fw(struct list_head *q) ---- a/drivers/net/wireless/libertas/if_usb.c -+++ b/drivers/net/wireless/libertas/if_usb.c -@@ -1015,7 +1015,9 @@ static struct usb_driver if_usb_driver = - .suspend = if_usb_suspend, - .resume = if_usb_resume, - .reset_resume = if_usb_resume, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(if_usb_driver); ---- a/drivers/net/wireless/libertas_tf/if_usb.c -+++ b/drivers/net/wireless/libertas_tf/if_usb.c -@@ -922,7 +922,9 @@ static struct usb_driver if_usb_driver = - .id_table = if_usb_table, - .suspend = if_usb_suspend, - .resume = if_usb_resume, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(if_usb_driver); ---- a/drivers/net/wireless/orinoco/orinoco_usb.c -+++ b/drivers/net/wireless/orinoco/orinoco_usb.c -@@ -1751,7 +1751,9 @@ static struct usb_driver orinoco_driver - .probe = ezusb_probe, - .disconnect = ezusb_disconnect, - .id_table = ezusb_table, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(orinoco_driver); ---- a/drivers/net/wireless/p54/p54usb.c -+++ b/drivers/net/wireless/p54/p54usb.c -@@ -1142,7 +1142,9 @@ static struct usb_driver p54u_driver = { - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) - .soft_unbind = 1, - #endif -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(p54u_driver); ---- a/drivers/net/wireless/rndis_wlan.c -+++ b/drivers/net/wireless/rndis_wlan.c -@@ -3761,7 +3761,9 @@ static struct usb_driver rndis_wlan_driv - .disconnect = usbnet_disconnect, - .suspend = usbnet_suspend, - .resume = usbnet_resume, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(rndis_wlan_driver); ---- a/drivers/net/wireless/rt2x00/rt2500usb.c -+++ b/drivers/net/wireless/rt2x00/rt2500usb.c -@@ -1989,7 +1989,9 @@ static struct usb_driver rt2500usb_drive - .suspend = rt2x00usb_suspend, - .resume = rt2x00usb_resume, - .reset_resume = rt2x00usb_resume, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(rt2500usb_driver); ---- a/drivers/net/wireless/rt2x00/rt2800usb.c -+++ b/drivers/net/wireless/rt2x00/rt2800usb.c -@@ -1284,7 +1284,9 @@ static struct usb_driver rt2800usb_drive - .suspend = rt2x00usb_suspend, - .resume = rt2x00usb_resume, - .reset_resume = rt2x00usb_resume, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(rt2800usb_driver); ---- a/drivers/net/wireless/rt2x00/rt73usb.c -+++ b/drivers/net/wireless/rt2x00/rt73usb.c -@@ -2536,7 +2536,9 @@ static struct usb_driver rt73usb_driver - .suspend = rt2x00usb_suspend, - .resume = rt2x00usb_resume, - .reset_resume = rt2x00usb_resume, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(rt73usb_driver); ---- a/drivers/net/wireless/rtl818x/rtl8187/dev.c -+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c -@@ -1673,7 +1673,9 @@ static struct usb_driver rtl8187_driver - .id_table = rtl8187_table, - .probe = rtl8187_probe, - .disconnect = __devexit_p(rtl8187_disconnect), -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(rtl8187_driver); ---- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c -+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c -@@ -377,7 +377,9 @@ static struct usb_driver rtl8192cu_drive - #ifdef CONFIG_AUTOSUSPEND - .supports_autosuspend = 1, - #endif -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - module_usb_driver(rtl8192cu_driver); ---- a/drivers/net/wireless/zd1211rw/zd_usb.c -+++ b/drivers/net/wireless/zd1211rw/zd_usb.c -@@ -1541,7 +1541,9 @@ static struct usb_driver driver = { - .disconnect = disconnect, - .pre_reset = pre_reset, - .post_reset = post_reset, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - .disable_hub_initiated_lpm = 1, -+#endif - }; - - struct workqueue_struct *zd_workqueue; diff --git a/patches/network/63-tty-termios.patch b/patches/network/63-tty-termios.patch deleted file mode 100644 index 0841106e5695..000000000000 --- a/patches/network/63-tty-termios.patch +++ /dev/null @@ -1,49 +0,0 @@ -This patch requires a manual backport: - -commit adc8d746caa67fff4b53ba3e5163a6cbacc3b523 -Author: Alan Cox -Date: Sat Jul 14 15:31:47 2012 +0100 - - tty: move the termios object into the tty - - This will let us sort out a whole pile of tty related races. The - alternative would be to keep points and refcount the termios objects. - However - 1. They are tiny anyway - 2. Many devices don't use the stored copies - 3. We can remove a pty special case - - Signed-off-by: Alan Cox - Signed-off-by: Greg Kroah-Hartman - -We cannot use compat.git for this given that the assignment -was not done through a static inline helper. - ---- a/drivers/bluetooth/hci_ath.c -+++ b/drivers/bluetooth/hci_ath.c -@@ -58,7 +58,11 @@ static int ath_wakeup_ar3k(struct tty_st - return status; - - /* Disable Automatic RTSCTS */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) - ktermios = tty->termios; -+#else -+ memcpy(&ktermios, tty->termios, sizeof(ktermios)); -+#endif - ktermios.c_cflag &= ~CRTSCTS; - tty_set_termios(tty, &ktermios); - ---- a/net/bluetooth/rfcomm/tty.c -+++ b/net/bluetooth/rfcomm/tty.c -@@ -873,7 +873,11 @@ static int rfcomm_tty_ioctl(struct tty_s - - static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old) - { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) - struct ktermios *new = &tty->termios; -+#else -+ struct ktermios *new = tty->termios; -+#endif - int old_baud_rate = tty_termios_baud_rate(old); - int new_baud_rate = tty_termios_baud_rate(new); - diff --git a/patches/network/64-b44-32bit-stats.patch b/patches/network/64-b44-32bit-stats.patch deleted file mode 100644 index b3138f8183fe..000000000000 --- a/patches/network/64-b44-32bit-stats.patch +++ /dev/null @@ -1,54 +0,0 @@ -This patch requires a manual backport: - -commit eeda8585522bcc173f91d6254dfa63e871087c54 -Author: Kevin Groeneveld -Date: Tue Jul 17 17:46:01 2012 +0000 - - b44: add 64 bit stats - - Add support for 64 bit stats to Broadcom b44 ethernet driver. - - Signed-off-by: Kevin Groeneveld - Signed-off-by: Eric Dumazet - Signed-off-by: David S. Miller - ---- a/drivers/net/ethernet/broadcom/b44.c -+++ b/drivers/net/ethernet/broadcom/b44.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -1641,10 +1642,17 @@ static int b44_close(struct net_device * - return 0; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *nstat) -+#else -+static struct net_device_stats *b44_get_stats(struct net_device *dev) -+#endif - { - struct b44 *bp = netdev_priv(dev); -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) -+ struct net_device_stats *nstat = &dev->stats; -+#endif - struct b44_hw_stats *hwstat = &bp->hw_stats; - unsigned int start; - -@@ -2135,7 +2143,11 @@ static const struct net_device_ops b44_n - .ndo_open = b44_open, - .ndo_stop = b44_close, - .ndo_start_xmit = b44_start_xmit, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - .ndo_get_stats64 = b44_get_stats64, -+#else -+ .ndo_get_stats = b44_get_stats, -+#endif - .ndo_set_rx_mode = b44_set_rx_mode, - .ndo_set_mac_address = b44_set_mac_addr, - .ndo_validate_addr = eth_validate_addr, diff --git a/patches/network/65-ignore-dismantle.patch b/patches/network/65-ignore-dismantle.patch deleted file mode 100644 index fde4ce247534..000000000000 --- a/patches/network/65-ignore-dismantle.patch +++ /dev/null @@ -1,23 +0,0 @@ -The following patch makes use of the dismantle member in struct -net_device, this patch removes that access on older kernels. - -commit 9d5d496c3464b7ad0ba942b4ada5f27c07e07079 -Author: Daniel Drake -Date: Mon Jul 30 22:58:04 2012 +0100 - - libertas: don't reset card on error when it is being removed - ---- a/drivers/net/wireless/libertas/main.c -+++ b/drivers/net/wireless/libertas/main.c -@@ -592,7 +592,11 @@ static int lbs_thread(void *data) - - /* Reset card, but only when it isn't in the process - * of being shutdown anyway. */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) - if (!dev->dismantle && priv->reset_card) -+#else -+ if (priv->reset_card) -+#endif - priv->reset_card(priv); - } - priv->cmd_timed_out = 0; diff --git a/patches/network/66-uapi-changes.patch b/patches/network/66-uapi-changes.patch deleted file mode 100644 index 362f9bc1bde0..000000000000 --- a/patches/network/66-uapi-changes.patch +++ /dev/null @@ -1,29 +0,0 @@ -The UAPI changes split up the kernel and userspace API -headers into separate directories. We provide backport -support for the new rfkill module to kernels older than -2.6.31. To allow us to dynamically provide only backport -support for those kernels we have a trick within compat -to provide its own include/linux/rfkill.h header which -then will include either your own kernel's rkfill.h or -include the one we are taking from linux-next. The one -we take from linux-next is renamed to rfkill_backport.h. -In order to allow the call to include your own kernel's -rfkill.h the compat rfkill.h uses include_next. The UAPI -changes would mean though that instead of getting your -own kernel's rfkill.h you'd end up getting the UAPI -header file. Fix this by ensuring that for new kernels -we linux_next into the user's kernels rfkill.h and if -the kernel is old we still to the rfkill_backport.h -naming scheme. - ---- a/include/linux/rfkill_backport.h -+++ b/include/linux/rfkill_backport.h -@@ -18,7 +18,7 @@ - #ifndef __RFKILL_H - #define __RFKILL_H - --#include -+#include - - /* don't allow anyone to use these in the kernel */ - enum rfkill_user_states { diff --git a/patches/network/67-use_spinlock_t.patch b/patches/network/67-use_spinlock_t.patch deleted file mode 100644 index 4c9f315c3ccd..000000000000 --- a/patches/network/67-use_spinlock_t.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h -+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h -@@ -158,7 +158,7 @@ typedef int (*brcmf_fweh_handler_t)(stru - */ - struct brcmf_fweh_info { - struct work_struct event_work; -- struct spinlock evt_q_lock; -+ spinlock_t evt_q_lock; - struct list_head event_q; - int (*evt_handler[BRCMF_E_LAST])(struct brcmf_if *ifp, - const struct brcmf_event_msg *evtmsg, diff --git a/patches/network/99-change-makefiles.patch b/patches/network/99-change-makefiles.patch deleted file mode 100644 index fc26a78ca0d6..000000000000 --- a/patches/network/99-change-makefiles.patch +++ /dev/null @@ -1,101 +0,0 @@ - -This patch removes all drivers we do not support -or do not want to support. This lets us build -only the wireless stuff. - ---- a/drivers/misc/eeprom/Makefile -+++ b/drivers/misc/eeprom/Makefile -@@ -1,7 +1 @@ --obj-$(CONFIG_EEPROM_AT24) += at24.o --obj-$(CONFIG_EEPROM_AT25) += at25.o --obj-$(CONFIG_EEPROM_LEGACY) += eeprom.o --obj-$(CONFIG_EEPROM_MAX6875) += max6875.o - obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o --obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o --obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o ---- a/drivers/net/usb/Makefile -+++ b/drivers/net/usb/Makefile -@@ -2,34 +2,7 @@ - # Makefile for USB Network drivers - # - --obj-$(CONFIG_USB_CATC) += catc.o --obj-$(CONFIG_USB_KAWETH) += kaweth.o --obj-$(CONFIG_USB_PEGASUS) += pegasus.o --obj-$(CONFIG_USB_RTL8150) += rtl8150.o --obj-$(CONFIG_USB_HSO) += hso.o --obj-$(CONFIG_USB_NET_AX8817X) += asix.o --asix-y := asix_devices.o asix_common.o ax88172a.o - obj-$(CONFIG_USB_NET_COMPAT_CDCETHER) += cdc_ether.o --obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o --obj-$(CONFIG_USB_NET_DM9601) += dm9601.o --obj-$(CONFIG_USB_NET_SMSC75XX) += smsc75xx.o --obj-$(CONFIG_USB_NET_SMSC95XX) += smsc95xx.o --obj-$(CONFIG_USB_NET_GL620A) += gl620a.o --obj-$(CONFIG_USB_NET_NET1080) += net1080.o --obj-$(CONFIG_USB_NET_PLUSB) += plusb.o - obj-$(CONFIG_USB_NET_COMPAT_RNDIS_HOST) += rndis_host.o --obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o --obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o --obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o - obj-$(CONFIG_USB_COMPAT_USBNET) += usbnet.o --obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o --obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o --obj-$(CONFIG_USB_NET_KALMIA) += kalmia.o --obj-$(CONFIG_USB_IPHETH) += ipheth.o --obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o --obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o --obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o --obj-$(CONFIG_USB_VL600) += lg-vl600.o --obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o --obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o - ---- a/drivers/net/wireless/Makefile -+++ b/drivers/net/wireless/Makefile -@@ -7,18 +7,8 @@ obj-$(CONFIG_IPW2200) += ipw2x00/ - - obj-$(CONFIG_HERMES) += orinoco/ - --obj-$(CONFIG_AIRO) += airo.o --obj-$(CONFIG_AIRO_CS) += airo_cs.o airo.o -- --obj-$(CONFIG_ATMEL) += atmel.o --obj-$(CONFIG_PCI_ATMEL) += atmel_pci.o --obj-$(CONFIG_PCMCIA_ATMEL) += atmel_cs.o -- - obj-$(CONFIG_AT76C50X_USB) += at76c50x-usb.o - --obj-$(CONFIG_PRISM54) += prism54/ -- --obj-$(CONFIG_HOSTAP) += hostap/ - obj-$(CONFIG_B43) += b43/ - obj-$(CONFIG_B43LEGACY) += b43legacy/ - obj-$(CONFIG_COMPAT_ZD1211RW) += zd1211rw/ -@@ -26,13 +16,8 @@ obj-$(CONFIG_RTL8180) += rtl818x/ - obj-$(CONFIG_RTL8187) += rtl818x/ - obj-$(CONFIG_RTLWIFI) += rtlwifi/ - --# 16-bit wireless PCMCIA client drivers --obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o --obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o -- - obj-$(CONFIG_USB_NET_COMPAT_RNDIS_WLAN) += rndis_wlan.o - --obj-$(CONFIG_USB_ZD1201) += zd1201.o - obj-$(CONFIG_LIBERTAS) += libertas/ - - obj-$(CONFIG_LIBERTAS_THINFIRM) += libertas_tf/ ---- a/net/wireless/Makefile -+++ b/net/wireless/Makefile -@@ -4,11 +4,6 @@ obj-$(CONFIG_LIB80211_CRYPT_WEP) += lib8 - obj-$(CONFIG_LIB80211_CRYPT_CCMP) += lib80211_crypt_ccmp.o - obj-$(CONFIG_LIB80211_CRYPT_TKIP) += lib80211_crypt_tkip.o - --obj-$(CONFIG_WEXT_CORE) += wext-core.o --obj-$(CONFIG_WEXT_PROC) += wext-proc.o --obj-$(CONFIG_WEXT_SPY) += wext-spy.o --obj-$(CONFIG_WEXT_PRIV) += wext-priv.o -- - cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o - cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o - cfg80211-$(CONFIG_COMPAT_CFG80211_DRIVER_API_TRACER) += trace.o diff --git a/patches/pending-stable/.ignore b/patches/pending-stable/.ignore new file mode 100644 index 000000000000..d95fa1383704 --- /dev/null +++ b/patches/pending-stable/.ignore @@ -0,0 +1 @@ +ath9k-lock-reset-and-PCU-start-stopping.patch diff --git a/patches/pending-stable/README b/patches/pending-stable/README new file mode 100644 index 000000000000..52529d6e4977 --- /dev/null +++ b/patches/pending-stable/README @@ -0,0 +1,23 @@ +compat-drivers pending-stable/ patches +======================================= + +Often right before the merge window we get a block on non +oops/regression fixes for stable fixes. Some stable fixes +often get propagated afterwards during the extraversion +maintenance of the kernels. Right before the merge window +circa rc4 and rc5 subsystem maintainers get pegged if they +throw in non oops/regression fixes for Linus or their +respective upstream maintainer. While this makes sense +for tree management and stable release considerations we +still need to get users some stable patches propagated. + +This directory is there to help with that. Only patches +which have been merged into linux-next.git will be included +in this directory which means you must post it and the maintainer +should have merged it and Stephen would have picked it up. + +This directory will always be empty for bleeding edge +releases as bleeding edge releases are always based on +linux-next already. This directory only makes sense for +stable release of the kernel, and it we will always try +to use it, in case there are stable fixes not yet propagated. diff --git a/patches/pending-stable/network/.gitignore b/patches/pending-stable/network/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pending-stable/.ignore b/pending-stable/.ignore deleted file mode 100644 index d95fa1383704..000000000000 --- a/pending-stable/.ignore +++ /dev/null @@ -1 +0,0 @@ -ath9k-lock-reset-and-PCU-start-stopping.patch diff --git a/pending-stable/README b/pending-stable/README deleted file mode 100644 index 52529d6e4977..000000000000 --- a/pending-stable/README +++ /dev/null @@ -1,23 +0,0 @@ -compat-drivers pending-stable/ patches -======================================= - -Often right before the merge window we get a block on non -oops/regression fixes for stable fixes. Some stable fixes -often get propagated afterwards during the extraversion -maintenance of the kernels. Right before the merge window -circa rc4 and rc5 subsystem maintainers get pegged if they -throw in non oops/regression fixes for Linus or their -respective upstream maintainer. While this makes sense -for tree management and stable release considerations we -still need to get users some stable patches propagated. - -This directory is there to help with that. Only patches -which have been merged into linux-next.git will be included -in this directory which means you must post it and the maintainer -should have merged it and Stephen would have picked it up. - -This directory will always be empty for bleeding edge -releases as bleeding edge releases are always based on -linux-next already. This directory only makes sense for -stable release of the kernel, and it we will always try -to use it, in case there are stable fixes not yet propagated. diff --git a/pending-stable/network/.gitignore b/pending-stable/network/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index f05081a4150b..c3f163f2e38d 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -150,19 +150,19 @@ nagometer() { let CHANGES=$ADD+$DEL case `dirname $1` in - "patches") + "patches/collateral-evolutions") brag_backport $ORIG_CODE $CHANGES $ADD $DEL ;; - "pending-stable") + "patches/pending-stable") nag_pending_stable $ORIG_CODE $CHANGES $ADD $DEL ;; - "linux-next-cherry-picks") + "patches/linux-next-cherry-picks") nag_next_cherry_pick $ORIG_CODE $CHANGES $ADD $DEL ;; - "linux-next-pending") + "patches/linux-next-pending") nag_pending $ORIG_CODE $CHANGES $ADD $DEL ;; - "crap") + "patches/crap") nag_crap $ORIG_CODE $CHANGES $ADD $DEL ;; *) @@ -212,7 +212,7 @@ ENABLE_NETWORK=1 ENABLE_DRM=1 SUBSYSTEMS= -EXTRA_PATCHES="patches" +EXTRA_PATCHES="patches/collateral-evolutions" REFRESH="n" GET_STABLE_PENDING="n" POSTFIX_RELEASE_TAG="" @@ -225,23 +225,23 @@ if [ $# -ge 1 ]; then case $1 in "-s") GET_STABLE_PENDING="y" - EXTRA_PATCHES="${EXTRA_PATCHES} pending-stable" - EXTRA_PATCHES="${EXTRA_PATCHES} pending-stable/backports/" + EXTRA_PATCHES="${EXTRA_PATCHES} patches/pending-stable" + EXTRA_PATCHES="${EXTRA_PATCHES} patches/pending-stable/backports/" POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}s" shift ;; "-n") - EXTRA_PATCHES="${EXTRA_PATCHES} linux-next-cherry-picks" + EXTRA_PATCHES="${EXTRA_PATCHES} patches/linux-next-cherry-picks" POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}n" shift ;; "-p") - EXTRA_PATCHES="${EXTRA_PATCHES} linux-next-pending" + EXTRA_PATCHES="${EXTRA_PATCHES} patches/linux-next-pending" POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}p" shift ;; "-c") - EXTRA_PATCHES="${EXTRA_PATCHES} crap" + EXTRA_PATCHES="${EXTRA_PATCHES} patches/crap" POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}c" shift ;;