Nuke the compat-wireless tree.

Replace it with a readme pointing at the backports project, and a couple
of out-of-tree patches.
This commit is contained in:
Solomon Peachy 2013-10-28 19:34:36 -04:00
parent 3362e9e699
commit 0d8456d604
2403 changed files with 1579 additions and 1393349 deletions

View file

@ -1 +0,0 @@
compat-v3.9-rc4-1

View file

@ -1 +0,0 @@
linux-stable.git

View file

@ -1 +0,0 @@
v3.9-rc4

View file

@ -1 +0,0 @@
compat-drivers-v3.9-rc4-2

30
.gitignore vendored
View file

@ -1,30 +0,0 @@
*.cmd
*.mod.c
*.ko
compat_autoconf.h
regdb.c
#drivers
#include
#net
#compat
#udev
*~
git-describe
compat-release
Module.symvers
module.order
.pc
#code-metrics.txt
#.compat_base
#.compat_base_tree
#.compat_base_tree_version
#.compat_version
.compat_autoconf_compat-*
.config
.config.mk_md5sum.txt
.tmp_versions/
#MAINTAINERS
modules
modules.order

356
COPYING
View file

@ -1,356 +0,0 @@
NOTE! This copyright does *not* cover user programs that use kernel
services by normal system calls - this is merely considered normal use
of the kernel, and does *not* fall under the heading of "derived work".
Also note that the GPL below is copyrighted by the Free Software
Foundation, but the instance of code that it refers to (the Linux
kernel) is copyrighted by me and others who actually wrote it.
Also note that the only valid version of the GPL as far as the kernel
is concerned is _this_ particular version of the license (ie v2, not
v2.2 or v3.x or whatever), unless explicitly otherwise stated.
Linus Torvalds
----------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

File diff suppressed because it is too large Load diff

264
Makefile
View file

@ -1,264 +0,0 @@
#
# Copyright (c) 2007-2012 Luis R. Rodriguez <mcgrof@frijolero.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
export KMODDIR?= updates
KMODDIR_ARG:= "INSTALL_MOD_DIR=$(KMODDIR)"
ifneq ($(origin KLIB), undefined)
KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)"
else
export KLIB:= /lib/modules/$(shell uname -r)
endif
export KLIB_BUILD ?= $(KLIB)/build
export MAKE
DESTDIR?=
ifneq ($(KERNELRELEASE),)
-include $(COMPAT_CONFIG)
include $(COMPAT_CONFIG_CW)
NOSTDINC_FLAGS := \
-I$(M)/include/ \
-I$(M)/include/uapi \
-I$(M)/include/drm \
-include $(M)/include/linux/compat-2.6.h \
$(CFLAGS)
obj-y := compat/
obj-$(CONFIG_COMPAT_RFKILL) += net/rfkill/
obj-$(CONFIG_COMPAT_VIDEO_MODULES) += drivers/gpu/drm/
obj-$(CONFIG_COMPAT_VIDEO_MODULES) += drivers/video/
ifeq ($(BT),)
obj-$(CONFIG_COMPAT_WIRELESS) += net/wireless/ net/mac80211/
obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += drivers/net/wireless/
obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/
obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/ethernet/atheros/
obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/ethernet/broadcom/
obj-$(CONFIG_COMPAT_VAR_MODULES) += drivers/ssb/
obj-$(CONFIG_COMPAT_VAR_MODULES) += drivers/bcma/
obj-$(CONFIG_COMPAT_VAR_MODULES) += drivers/misc/eeprom/
ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),)
endif
endif
obj-$(CONFIG_COMPAT_BLUETOOTH) += net/bluetooth/
obj-$(CONFIG_COMPAT_BLUETOOTH_MODULES) += drivers/bluetooth/
else
export PWD := $(shell pwd)
# The build will fail if there is any space in PWD.
ifneq (,$(findstring $() ,$(PWD)))
$(error "The path to this compat-drivers directory has spaces in it." \
"Please put it somewhere where there is no space")
endif
export CFLAGS += \
-DCOMPAT_BASE="\"$(shell cat $(PWD)/.compat_base)\"" \
-DCOMPAT_BASE_TREE="\"$(shell cat $(PWD)/.compat_base_tree)\"" \
-DCOMPAT_BASE_TREE_VERSION="\"$(shell cat $(PWD)/.compat_base_tree_version)\"" \
-DCOMPAT_PROJECT="\"Compat-drivers\"" \
-DCOMPAT_VERSION="\"$(shell cat $(PWD)/.compat_version)\""
# These exported as they are used by the scripts
# to check config and compat autoconf
export COMPAT_CONFIG_CW=$(PWD)/config.mk
export COMPAT_CONFIG=$(PWD)/.config
export CONFIG_CHECK=$(PWD)/.config.mk_md5sum.txt
export COMPAT_AUTOCONF=include/linux/compat_autoconf.h
export CREL=$(shell cat $(PWD)/.compat_version)
export CREL_PRE:=.compat_autoconf_
export CREL_CHECK:=$(PWD)/$(CREL_PRE)$(CREL)
all: modules
$(COMPAT_CONFIG): ;
modules: $(CREL_CHECK)
+@./scripts/check_config.sh
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules
@touch $@
bt: $(CREL_CHECK)
+@./scripts/check_config.sh
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) BT=TRUE modules
@touch $@
# We use a CREL_CHECK variable which will depend on the environment used to
# build. If the environment requirements change it forces a reconfiguration
# check. This means we force a new reconfiguration check if a the user gets a
# new updates of compat-drivers or when the user updates the $(COMPAT_CONFIG)
# file.
# XXX: add kernel target to the CREL_CHECK mix, this would ensure we also
# reconfigure and build again fresh if we detect a new target kernel is
# being used.
$(CREL_CHECK):
@# Force to regenerate compat autoconf
+@./compat/scripts/gen-compat-config.sh > $(COMPAT_CONFIG)
@rm -f $(CONFIG_CHECK)
+@./scripts/check_config.sh
@md5sum $(COMPAT_CONFIG_CW) > $(CONFIG_CHECK)
@touch $@
btinstall: btuninstall bt-install-modules
bt-install-modules: bt
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) BT=TRUE \
modules_install
@/sbin/depmod -ae
@echo
@echo Now run:
@echo
@echo sudo make btunload:
@echo
@echo And then load the needed bluetooth modules. If unsure reboot.
@echo
btuninstall:
@# New location, matches upstream
@rm -rf $(KLIB)/$(KMODDIR)/net/bluetooth/
@rm -rf $(KLIB)/$(KMODDIR)/drivers/bluetooth/
@# Lets only remove the stuff we are sure we are providing
@# on the misc directory.
@/sbin/depmod -ae
@echo
btclean:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) BT=TRUE clean
@rm -f $(CREL_PRE)*
install: uninstall install-modules install-scripts
install-modules: modules
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) \
modules_install
@./scripts/update-initramfs
install-scripts:
@# All the scripts we can use
@mkdir -p $(DESTDIR)/usr/lib/compat-drivers/
@install scripts/modlib.sh $(DESTDIR)/usr/lib/compat-drivers/
@install scripts/git-paranoia $(DESTDIR)/usr/sbin/
@install scripts/madwifi-unload $(DESTDIR)/usr/sbin/
@# This is to allow switching between drivers without blacklisting
@install scripts/athenable $(DESTDIR)/usr/sbin/
@install scripts/b43enable $(DESTDIR)/usr/sbin/
@install scripts/iwl-enable $(DESTDIR)/usr/sbin/
@install scripts/athload $(DESTDIR)/usr/sbin/
@install scripts/b43load $(DESTDIR)/usr/sbin/
@install scripts/iwl-load $(DESTDIR)/usr/sbin/
@if [ $(shell modinfo ath_pci > /dev/null 2>&1 && echo 1) ]; then \
echo -n "Note: madwifi detected, we're going to disable it. " ;\
echo "If you would like to enable it later you can run:" ;\
echo " sudo athenable madwifi" ;\
echo ;\
echo Running athenable ath5k...;\
$(DESTDIR)/usr/sbin/athenable ath5k ;\
fi
@if [ $(shell modinfo iwl4965 > /dev/null 2>&1 && echo 1) ]; then \
echo ;\
echo -n "Note: iwl4965 detected, we're going to disable it. " ;\
echo "If you would like to enable it later you can run:" ;\
echo " sudo iwl-load iwl4965" ;\
echo ;\
echo Running iwl-enable iwlagn...;\
$(DESTDIR)/usr/sbin/iwl-enable iwlagn ;\
fi
@if [ $(shell modinfo iwlagn > /dev/null 2>&1 && echo 1) ] \
&& [ $(shell modinfo iwlwifi > /dev/null 2>&1 && echo 1) ]; then \
echo ;\
echo -n "Note: iwlagn detected, we're going to disable it. " ;\
echo "If you would like to enable it later you can run:" ;\
echo " sudo iwl-load iwlagn" ;\
echo ;\
echo Running iwl-enable iwlwifi...;\
$(DESTDIR)/usr/sbin/iwl-enable iwlwifi ;\
fi
@# If on distributions like Mandriva which like to
@# compress their modules this will find out and do
@# it for you. Reason is some old version of modutils
@# won't know mac80211.ko should be used instead of
@# mac80211.ko.gz
@./scripts/compress_modules
@# Mandrake doesn't have a depmod.d/ conf file to prefer
@# the updates/ dir which is what we use so we add one for it
@# (or any other distribution that doens't have this).
@./scripts/check_depmod
@# Udev stuff needed for the new compat_firmware_class.
@./compat/scripts/compat_firmware_install
@/sbin/depmod -a
@echo
@echo Now run:
@echo
@echo sudo make unload to unload all: wireless, bluetooth and ethernet modules
@echo sudo make wlunload to unload wireless modules
@echo sudo make btunload to unload bluetooth modules
@echo
@echo Run sudo modprobe 'driver-name' to load your desired driver.
@echo If unsure reboot.
@echo
uninstall:
@# New location, matches upstream
@rm -rf $(KLIB)/$(KMODDIR)/compat/
@rm -rf $(KLIB)/$(KMODDIR)/net/mac80211/
@rm -rf $(KLIB)/$(KMODDIR)/net/rfkill/
@rm -rf $(KLIB)/$(KMODDIR)/net/wireless/
@rm -rf $(KLIB)/$(KMODDIR)/drivers/ssb/
@rm -rf $(KLIB)/$(KMODDIR)/drivers/net/usb/
@rm -rf $(KLIB)/$(KMODDIR)/drivers/net/wireless/
@rm -rf $(KLIB)/$(KMODDIR)/drivers/staging/
@rm -rf $(KLIB)/$(KMODDIR)/drivers/net/atl*
@find $(KLIB)/$(KMODDIR)/drivers/net/ -name "alx*.ko" -o -name "atl*.ko" 2>/dev/null |xargs rm -f
@# Lets only remove the stuff we are sure we are providing
@# on the misc directory.
@rm -f $(KLIB)/$(KMODDIR)/drivers/misc/eeprom/eeprom_93cx6.ko*
@rm -f $(KLIB)/$(KMODDIR)/drivers/misc/eeprom_93cx6.ko*
@rm -f $(KLIB)/$(KMODDIR)/drivers/net/b44.ko*
@/sbin/depmod -a
@./scripts/update-initramfs
@echo
clean:
@if [ -d net -a -d $(KLIB_BUILD) ]; then \
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) clean ;\
fi
@rm -f $(CREL_PRE)*
unload:
@./scripts/unload.sh
btunload:
@./scripts/btunload.sh
wlunload:
@./scripts/wlunload.sh
.PHONY: all clean install uninstall unload btunload wlunload modules bt Makefile
endif
clean-files += Module.symvers Module.markers modules modules.order
clean-files += $(CREL_CHECK) $(CONFIG_CHECK) $(COMPAT_CONFIG)

View file

@ -1,21 +1,34 @@
The cw1200 driver has been accepted into the upstream linux kernel; it
will be present in the 3.11-rc and newer releases. Consequently it will
be part of the 3.11-rc and newer compat-drivers/backports releases.
is present in the 3.11-rc and newer releases. It is also present in the
3.12 and newer backports releases. Please see:
https://backports.wiki.kernel.org/index.php/Releases
https://backports.wiki.kernel.org
Once that occurs, this git repository will become largely irrelevant,
though there will be at least three out-of-tree patches:
* Support kernels older than 2.6.36 (will be merged into backports)
* ETF mode operation
* ITP mode operation
In general, I recommend using the latest version of backports.
Down the line, these changes are anticipated:
* Devicetree bindings for the cw1200 driver (SPI and SDIO)
* Support for the cw1x50/cw1x60 (depends on hardware availability)
* Bugfixes as necessary
Also, I don't have permission to redistribute the device firmware, nor
do I have any contacts that still work for ST-E. You will need to
contact your module vendor for appropriate firmware.
There currently two out-of-tree patches, bundled here:
* ETF mode operation
* ITP mode operation
These patches are provided as-is with no support, as they are only
really of use if you have access to ST-E's ETF tools and intend to take
a device through regulatory approval. Contact your module vendor for
further details.
Similarly, I do not have permission to redistribute the device firmware.
You will need to contact your module vendor for appropriate firmware files.
-- -- --
Questions, comments, bug reports, and flames go to:
Solomon Peachy
pizza AT shaftnet DOT org
October, 2013

View file

@ -1,28 +0,0 @@
# Linux compat drivers compatibility package
This package provides backport support for drivers from newer kernels
down to older kernels. It currently backports 3 subsystems:
* Ethernet
* Wireless
* Bluetooth
* GPU
This package provides the latest Linux kernel subsystem enhancements
for kernels 2.6.24 and above. It is technically possible to support
kernels < 2.6.24 but more work is required for that.
# Documentation
This package is documented online and has more-up-to date information
online than on this README file. You should read the wiki page
and not rely on this README!
https://backports.wiki.kernel.org
# License
This work is a subset of the Linux kernel as such we keep the kernel's
Copyright practice. Some files have their own copyright and in those
cases the license is mentioned in the file. All additional work made
to building this package is licensed under the GPLv2.

View file

@ -1,28 +0,0 @@
compat-drivers code metrics
 1320314 - Total upstream lines of code being pulled
network
----------------------------------------
 3110 - backport code changes
 2605 - backport code additions
 505 - backport code deletions
 15026 - backport from compat module
 18136 - total backport code
 1.3736 - % of code consists of backport work
drm
----------------------------------------
 437 - backport code changes
 293 - backport code additions
 144 - backport code deletions
 15026 - backport from compat module
 15463 - total backport code
 1.1712 - % of code consists of backport work
Base tree: linux-stable.git
Base tree version: v3.9-rc4
compat.git: compat-v3.9-rc4-1
compat-drivers release: compat-drivers-v3.9-rc4-2
Code metrics archive: http://bit.ly/H6BTF7

View file

@ -1,62 +0,0 @@
ccflags-y += -I$(src)
obj-m += compat.o
#compat-objs :=
obj-$(CONFIG_COMPAT_FIRMWARE_CLASS) += compat_firmware_class.o
obj-$(CONFIG_COMPAT_NET_SCH_CODEL) += sch_codel.o
sch_fq_codel-y = sch_fq_codel_core.o flow_dissector.o
obj-$(CONFIG_COMPAT_NET_SCH_FQ_CODEL) += sch_fq_codel.o
compat-y += main.o
# Compat kernel compatibility code
compat-$(CONFIG_COMPAT_KERNEL_2_6_14) += compat-2.6.14.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_18) += compat-2.6.18.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_19) += compat-2.6.19.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_21) += compat-2.6.21.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_22) += compat-2.6.22.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_23) += compat-2.6.23.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_24) += compat-2.6.24.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_25) += \
compat-2.6.25.o \
pm_qos_params.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_26) += compat-2.6.26.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_27) += compat-2.6.27.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_28) += compat-2.6.28.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_29) += compat-2.6.29.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_32) += compat-2.6.32.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_33) += compat-2.6.33.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_34) += compat-2.6.34.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_35) += compat-2.6.35.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_36) += compat-2.6.36.o
compat-$(CONFIG_COMPAT_KFIFO) += kfifo.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_37) += compat-2.6.37.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_38) += compat-2.6.38.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_39) += \
compat-2.6.39.o \
kstrtox.o
compat-$(CONFIG_COMPAT_KERNEL_3_0) += compat-3.0.o
compat-$(CONFIG_COMPAT_KERNEL_3_1) += compat-3.1.o
compat-$(CONFIG_COMPAT_KERNEL_3_2) += compat-3.2.o
compat-$(CONFIG_COMPAT_KERNEL_3_3) += \
compat-3.3.o
compat-$(CONFIG_COMPAT_KERNEL_3_4) += compat-3.4.o
compat-$(CONFIG_COMPAT_KERNEL_3_5) += \
compat-3.5.o \
user_namespace.o
compat-$(CONFIG_COMPAT_KERNEL_3_7) += compat-3.7.o
compat-$(CONFIG_COMPAT_KERNEL_3_8) += compat-3.8.o
compat-$(CONFIG_COMPAT_CORDIC) += cordic.o
compat-$(CONFIG_COMPAT_CRC8) += crc8.o
ifndef CONFIG_64BIT
ifndef CONFIG_GENERIC_ATOMIC64
compat-y += compat_atomic.o
endif
endif

View file

@ -1,393 +0,0 @@
#!/usr/bin/env python
# ncurses Linux kernel cross kernel compilation utility
# Copyright (C) 2012 Luis R. Rodriguez <mcgrof@do-not-panic.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import locale
import curses
import time
import os
import re
import random
import tempfile
import subprocess
import sys
import signal
from Queue import *
from threading import Thread, Lock
from shutil import copytree, ignore_patterns, rmtree, copyfileobj
from time import sleep
releases_processed = []
releases_baking = []
processed_lock = Lock()
baking_lock = Lock()
my_cwd = os.getcwd()
ckmake_return = 0
tmp_path = my_cwd + "/.tmp.ckmake"
ckmake_log = my_cwd + "/ckmake.log"
ckmake_report = my_cwd + "/ckmake-report.log"
home = os.getenv("HOME")
ksrc = home + "/" + "compat-ksrc"
modules = ksrc + "/lib/modules"
def clean():
if os.path.exists(tmp_path):
rmtree(tmp_path)
def get_processed_rel(i):
"Because... list.pop(i) didn't work to keep order..."
processed_lock.acquire()
for rel in releases_processed:
if (rel['idx'] == i):
processed_lock.release()
return rel
processed_lock.release()
baking_lock.acquire()
for rel in releases_baking:
if (rel['idx'] == i):
releases_baking.remove(rel)
baking_lock.release()
return rel
baking_lock.release()
def get_status_name(status):
if (status == 0):
return 'OK'
elif (status == 130):
return 'TERM'
elif (status == 1234):
return 'INIT'
elif (status == -2):
return 'TERM'
else:
return 'FAIL'
def get_stat_pos(status):
if (status == 0):
return 34
elif (status == 130):
return 33
elif (status == 1234):
return 33
elif (status == -2):
return 33
else:
return 33
def get_status_color(status):
if (status == 0):
return curses.color_pair(1)
elif (status == 130):
return curses.color_pair(2)
elif (status == 1234):
return curses.color_pair(2)
elif (status == -2):
return curses.color_pair(2)
else:
return curses.color_pair(3)
def print_report():
os.system("clear")
sys.stdout.write("\n\n\n")
sys.stdout.write("== ckmake-report.log ==\n\n")
report = open(ckmake_report, 'r+')
copyfileobj(report, sys.stdout)
report.close()
def process_logs():
os.system('clear')
log = open(ckmake_log, 'w+')
report = open(ckmake_report, 'w+')
for i in range(0, len(releases_processed)):
rel = get_processed_rel(i)
rel_log = open(rel['log'], 'r+')
log.write(rel_log.read())
status = get_status_name(rel['status'])
rel_report = "%-4s%-20s[ %s ]\n" % \
( rel['idx']+1, rel['version'], status)
report.write(rel_report)
if (rel['status'] != 0 and
rel['status'] != 2):
ckmake_return = -1
report.close()
log.close()
print_report()
def process_kernel(num, kset):
while True:
rel = kset.queue.get()
work_dir = tmp_path + '/' + rel['version']
copytree(my_cwd, \
work_dir, \
ignore=ignore_patterns('\.git*', '.tmp*', ".git"))
build = '%s/build/' % rel['full_path']
jobs = ' -j%d ' % kset.build_jobs
make_args = 'KLIB=%(build)s KLIB_BUILD=%(build)s' % \
{ "build": build }
log_file = work_dir + '/' + 'ckmake.n.log'
rel['log'] = log_file
# XXX: figure out how to properly address logging
# without this nasty ass hack.
log = ' > %(log)s 2>&1' % { "log": log_file }
nice = 'ionice -c 3 nice -n 20 '
cmd = nice + 'make ' + jobs + make_args + log
my_env = os.environ.copy()
my_env["KCFLAGS"] = "-Wno-unused-but-set-variable"
kset.baking(rel)
p = subprocess.Popen([cmd],
env = my_env,
cwd = work_dir,
stdout=None,
stderr=None,
shell=True)
p.wait()
kset.update_status(rel, p.returncode)
kset.queue.task_done()
kset.completed(rel)
def cpu_info_build_jobs():
if not os.path.exists('/proc/cpuinfo'):
return 1
f = open('/proc/cpuinfo', 'r')
max_cpus = 1
for line in f:
m = re.match(r"(?P<PROC>processor\s*:)\s*" \
"(?P<NUM>\d+)",
line)
if not m:
continue
proc_specs = m.groupdict()
if (proc_specs['NUM'] > max_cpus):
max_cpus = proc_specs['NUM']
return int(max_cpus) + 1
def kill_curses():
curses.endwin()
sys.stdout = os.fdopen(0, 'w', 0)
def sig_handler(signal, frame):
kill_curses()
process_logs()
clean()
sys.exit(-2)
def get_rel_spec(rel):
if ("rc" in rel):
m = re.match(r"v*(?P<VERSION>\d+)\.+" \
"(?P<PATCHLEVEL>\d+)[.]+" \
"(?P<SUBLEVEL>\d+)[-]+" \
"\d+rc(?P<EXTRAVERSION>\d+)\-*",
rel)
else:
m = re.match(r"v*(?P<VERSION>\d+)\.+" \
"(?P<PATCHLEVEL>\d+)[.]+" \
"(?P<SUBLEVEL>\d+)[-]+" \
"(?P<EXTRAVERSION>\d+)\-*",
rel)
if (not m):
return m
rel_specs = m.groupdict()
return rel_specs
def krel_same_base(new_rel, rel):
if (int(new_rel['ver']) != int(rel['ver'])):
return False
if (int(new_rel['pat']) != int(rel['pat'])):
return False
if (int(new_rel['ver']) == 3):
return True
if (int(new_rel['ver']) != 2):
return False
if (int(new_rel['sub']) == int(rel['sub'])):
return True
return False
def krel_base_update(new_rel, rel):
if (not krel_same_base(new_rel, rel)):
return False
if (int(new_rel['sub']) > int(rel['sub'])):
return True
if (int(new_rel['sub']) < int(rel['sub'])):
return False
# Too lazy to deal with 2.x kernels,
if (not new_rel['is_rc']):
return False
if (int(new_rel['ext']) <= int(rel['ext'])):
return False
return True
def krel_base_smaller(new_rel, rel):
if (not krel_same_base(new_rel, rel)):
return False
if (int(new_rel['sub']) > int(rel['sub'])):
return False
if (int(new_rel['sub']) < int(rel['sub'])):
return True
return False
class kernel_set():
def __init__(self, stdscr):
self.queue = Queue()
self.releases = []
self.stdscr = stdscr
self.lock = Lock()
signal.signal(signal.SIGINT, sig_handler)
self.build_jobs = cpu_info_build_jobs()
if (curses.has_colors()):
curses.init_pair(1,
curses.COLOR_GREEN,
curses.COLOR_BLACK)
curses.init_pair(2,
curses.COLOR_CYAN,
curses.COLOR_BLACK)
curses.init_pair(3,
curses.COLOR_RED,
curses.COLOR_BLACK)
curses.init_pair(4,
curses.COLOR_BLUE,
curses.COLOR_BLACK)
def baking(self, rel):
baking_lock.acquire()
releases_baking.append(rel)
baking_lock.release()
def completed(self, rel):
processed_lock.acquire()
releases_processed.insert(rel['idx'], rel)
processed_lock.release()
def set_locale(self):
locale.setlocale(locale.LC_ALL, '')
code = locale.getpreferredencoding()
def refresh(self):
self.lock.acquire()
self.stdscr.refresh()
self.lock.release()
def evaluate_new_rel(self, new_rel):
for rel in self.releases:
if (krel_base_update(new_rel, rel)):
new_rel['idx'] = rel['idx']
self.releases.remove(rel)
break
if (krel_base_smaller(new_rel, rel)):
return
self.releases.insert(new_rel['idx'], new_rel)
def parse_releases(self):
for dirname, dirnames, filenames in os.walk(modules):
dirnames.sort()
for subdirname in dirnames:
specifics = get_rel_spec(subdirname)
if (not specifics):
continue
rc = False
ver = specifics['VERSION'] + '.' + \
specifics['PATCHLEVEL']
if ("rc" in subdirname):
rc = True
ver = ver + '-rc' + specifics['EXTRAVERSION']
else:
ver = ver + '.' + specifics['SUBLEVEL']
rel = dict(idx=len(self.releases),
name=subdirname,
full_path=dirname + '/' +
subdirname,
version=ver,
is_rc = rc,
ver=specifics['VERSION'],
pat=specifics['PATCHLEVEL'],
sub=specifics['SUBLEVEL'],
ext=specifics['EXTRAVERSION'],
processed=False,
log='',
status=1234)
self.evaluate_new_rel(rel)
self.refresh()
def setup_screen(self):
for i in range(0, len(self.releases)):
rel = self.releases[i]
self.lock.acquire()
self.stdscr.addstr(rel['idx'], 0,
"%-4d" % (rel['idx']+1))
if (curses.has_colors()):
self.stdscr.addstr(rel['idx'], 5,
"%-20s" % (rel['version']),
curses.color_pair(4))
else:
self.stdscr.addstr(rel['idx'], 0,
"%-20s" % (rel['version']))
self.stdscr.addstr(rel['idx'], 30, "[ ]")
self.stdscr.refresh()
self.lock.release()
def create_threads(self):
for rel in self.releases:
th = Thread(target=process_kernel, args=(0, self))
th.setDaemon(True)
th.start()
def kick_threads(self):
for rel in self.releases:
self.queue.put(rel)
sleep(1)
def wait_threads(self):
self.queue.join()
def update_status(self, rel, status):
self.lock.acquire()
stat_name = get_status_name(status)
stat_pos = get_stat_pos(status)
if (curses.has_colors()):
stat_color = get_status_color(status)
self.stdscr.addstr(rel['idx'], stat_pos, stat_name,
get_status_color(status))
else:
self.stdscr.addstr(rel['idx'], stat_pos, stat_name)
rel['processed'] = True
rel['status'] = status
self.stdscr.refresh()
self.lock.release()
def main(stdscr):
kset = kernel_set(stdscr)
kset.set_locale()
kset.parse_releases()
kset.setup_screen()
kset.create_threads()
kset.kick_threads()
kset.wait_threads()
kset.refresh()
if __name__ == "__main__":
if not os.path.exists(modules):
print "%s does not exist" % (modules)
sys.exit(1)
if not os.path.exists(my_cwd + '/Makefile'):
print "%s does not exist" % (my_cwd + '/Makefile')
sys.exit(1)
if os.path.exists(ckmake_log):
os.remove(ckmake_log)
if os.path.exists(ckmake_report):
os.remove(ckmake_report)
if os.path.exists(tmp_path):
rmtree(tmp_path)
os.makedirs(tmp_path)
curses.wrapper(main)
kill_curses()
process_logs()
clean()
sys.exit(ckmake_return)

View file

@ -1,14 +0,0 @@
/*
* Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Compatibility file for Linux wireless for kernels 2.6.14.
*/
#include <net/compat.h>
/* 2.6.14 compat code goes here */

View file

@ -1,14 +0,0 @@
/*
* Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Compatibility file for Linux wireless for kernels 2.6.18.
*/
#include <net/compat.h>
/* 2.6.18 compat code goes here */

View file

@ -1,14 +0,0 @@
/*
* Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Compatibility file for Linux wireless for kernels 2.6.19.
*/
#include <net/compat.h>
/* 2.6.19 compat code goes here */

View file

@ -1,14 +0,0 @@
/*
* Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Compatibility file for Linux wireless for kernels 2.6.21.
*/
#include <net/compat.h>
/* 2.6.21 compat code goes here */

View file

@ -1,14 +0,0 @@
/*
* Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Compatibility file for Linux wireless for kernels 2.6.22.
*/
#include <net/compat.h>
/* 2.6.22 compat code goes here */

View file

@ -1,239 +0,0 @@
/*
* Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Compatibility file for Linux wireless for kernels 2.6.23.
*/
#include <net/compat.h>
/* On net/core/dev.c as of 2.6.24 */
int __dev_addr_delete(struct dev_addr_list **list, int *count,
void *addr, int alen, int glbl)
{
struct dev_addr_list *da;
for (; (da = *list) != NULL; list = &da->next) {
if (memcmp(da->da_addr, addr, da->da_addrlen) == 0 &&
alen == da->da_addrlen) {
if (glbl) {
int old_glbl = da->da_gusers;
da->da_gusers = 0;
if (old_glbl == 0)
break;
}
if (--da->da_users)
return 0;
*list = da->next;
kfree(da);
(*count)--;
return 0;
}
}
return -ENOENT;
}
EXPORT_SYMBOL_GPL(__dev_addr_delete);
/* On net/core/dev.c as of 2.6.24. This is not yet used by mac80211 but
* might as well add it */
int __dev_addr_add(struct dev_addr_list **list, int *count,
void *addr, int alen, int glbl)
{
struct dev_addr_list *da;
for (da = *list; da != NULL; da = da->next) {
if (memcmp(da->da_addr, addr, da->da_addrlen) == 0 &&
da->da_addrlen == alen) {
if (glbl) {
int old_glbl = da->da_gusers;
da->da_gusers = 1;
if (old_glbl)
return 0;
}
da->da_users++;
return 0;
}
}
da = kmalloc(sizeof(*da), GFP_ATOMIC);
if (da == NULL)
return -ENOMEM;
memcpy(da->da_addr, addr, alen);
da->da_addrlen = alen;
da->da_users = 1;
da->da_gusers = glbl ? 1 : 0;
da->next = *list;
*list = da;
(*count)++;
return 0;
}
EXPORT_SYMBOL_GPL(__dev_addr_add);
/* Part of net/core/dev_mcast.c as of 2.6.23. This is a slightly different version.
* Since da->da_synced is not part of 2.6.22 we need to take longer route when
* syncing */
/**
* dev_mc_sync - Synchronize device's multicast list to another device
* @to: destination device
* @from: source device
*
* Add newly added addresses to the destination device and release
* addresses that have no users left. The source device must be
* locked by netif_tx_lock_bh.
*
* This function is intended to be called from the dev->set_multicast_list
* function of layered software devices.
*/
int dev_mc_sync(struct net_device *to, struct net_device *from)
{
struct dev_addr_list *da, *next, *da_to;
int err = 0;
netif_tx_lock_bh(to);
da = from->mc_list;
while (da != NULL) {
int synced = 0;
next = da->next;
da_to = to->mc_list;
/* 2.6.22 does not have da->da_synced so lets take the long route */
while (da_to != NULL) {
if (memcmp(da_to->da_addr, da->da_addr, da_to->da_addrlen) == 0 &&
da->da_addrlen == da_to->da_addrlen)
synced = 1;
break;
}
if (!synced) {
err = __dev_addr_add(&to->mc_list, &to->mc_count,
da->da_addr, da->da_addrlen, 0);
if (err < 0)
break;
da->da_users++;
} else if (da->da_users == 1) {
__dev_addr_delete(&to->mc_list, &to->mc_count,
da->da_addr, da->da_addrlen, 0);
__dev_addr_delete(&from->mc_list, &from->mc_count,
da->da_addr, da->da_addrlen, 0);
}
da = next;
}
if (!err)
__dev_set_rx_mode(to);
netif_tx_unlock_bh(to);
return err;
}
EXPORT_SYMBOL_GPL(dev_mc_sync);
/* Part of net/core/dev_mcast.c as of 2.6.23. This is a slighty different version.
* Since da->da_synced is not part of 2.6.22 we need to take longer route when
* unsyncing */
/**
* dev_mc_unsync - Remove synchronized addresses from the destination
* device
* @to: destination device
* @from: source device
*
* Remove all addresses that were added to the destination device by
* dev_mc_sync(). This function is intended to be called from the
* dev->stop function of layered software devices.
*/
void dev_mc_unsync(struct net_device *to, struct net_device *from)
{
struct dev_addr_list *da, *next, *da_to;
netif_tx_lock_bh(from);
netif_tx_lock_bh(to);
da = from->mc_list;
while (da != NULL) {
bool synced = false;
next = da->next;
da_to = to->mc_list;
/* 2.6.22 does not have da->da_synced so lets take the long route */
while (da_to != NULL) {
if (memcmp(da_to->da_addr, da->da_addr, da_to->da_addrlen) == 0 &&
da->da_addrlen == da_to->da_addrlen)
synced = true;
break;
}
if (!synced) {
da = next;
continue;
}
__dev_addr_delete(&to->mc_list, &to->mc_count,
da->da_addr, da->da_addrlen, 0);
__dev_addr_delete(&from->mc_list, &from->mc_count,
da->da_addr, da->da_addrlen, 0);
da = next;
}
__dev_set_rx_mode(to);
netif_tx_unlock_bh(to);
netif_tx_unlock_bh(from);
}
EXPORT_SYMBOL_GPL(dev_mc_unsync);
/* Added as of 2.6.23 on net/core/dev.c. Slightly modifed, no dev->set_rx_mode on
* 2.6.22 so ignore that. */
/*
* Upload unicast and multicast address lists to device and
* configure RX filtering. When the device doesn't support unicast
* filtering it is put in promiscous mode while unicast addresses
* are present.
*/
void __dev_set_rx_mode(struct net_device *dev)
{
/* dev_open will call this function so the list will stay sane. */
if (!(dev->flags&IFF_UP))
return;
if (!netif_device_present(dev))
return;
/* This needs to be ported to 2.6.22 framework */
#if 0
/* Unicast addresses changes may only happen under the rtnl,
* therefore calling __dev_set_promiscuity here is safe.
*/
if (dev->uc_count > 0 && !dev->uc_promisc) {
__dev_set_promiscuity(dev, 1);
dev->uc_promisc = 1;
} else if (dev->uc_count == 0 && dev->uc_promisc) {
__dev_set_promiscuity(dev, -1);
dev->uc_promisc = 0;
}
#endif
if (dev->set_multicast_list)
dev->set_multicast_list(dev);
}
/**
* pci_try_set_mwi - enables memory-write-invalidate PCI transaction
* @dev: the PCI device for which MWI is enabled
*
* Enables the Memory-Write-Invalidate transaction in %PCI_COMMAND.
* Callers are not required to check the return value.
*
* RETURNS: An appropriate -ERRNO error value on error, or zero for success.
*/
int pci_try_set_mwi(struct pci_dev *dev)
{
int rc = 0;
#ifdef HAVE_PCI_SET_MWI
rc = pci_set_mwi(dev);
#endif
return rc;
}
EXPORT_SYMBOL_GPL(pci_try_set_mwi);
#endif

View file

@ -1,158 +0,0 @@
/*
* Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Compatibility file for Linux wireless for kernels 2.6.24.
*/
#include <net/compat.h>
#include <net/arp.h>
/*
* We simply won't use it though, just declare it for our wrappers and
* for usage with tons of code that makes mention to it.
*/
struct net init_net;
EXPORT_SYMBOL_GPL(init_net);
/* 2.6.22 and 2.6.23 have eth_header_cache_update defined as extern in include/linux/etherdevice.h
* and actually defined in net/ethernet/eth.c but 2.6.24 exports it. Lets export it here */
/**
* eth_header_cache_update - update cache entry
* @hh: destination cache entry
* @dev: network device
* @haddr: new hardware address
*
* Called by Address Resolution module to notify changes in address.
*/