2012-08-09 18:01:49

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 00/13] Merge GSoC DRM changes to admin-update.sh

Hi,

The patches below modifies the admin-update.sh script so that it
accepts a variable-length last argument, namely network or/and drm,
to selectively fetch specific subsystem codes into the tree.

The last 2 patches constitutes the work done so far for the my
GSoC project.

This first attempt is mostly for getting some comments. For example,
eventhough you fetch network and drm drivers, make will just build
network drivers. I will either port the project to kconfig which
will dynamically configure and build what's available or hack
config.mk and Makefile to detect the availability of other drivers
than the wireless ones.

I thank Luis R. Rodriguez, my mentor, for his helpful and highly
responsive mentorship :)

Ozan Çağlayan (13):
compat-wireless: Clean up *.mod.c once after everything
compat-wireless: Isolate drivers into different groups
compat-wireless: List everything vertically without concatenating
compat-wireless: Add ability to enable/disable subsystems
compat-wireless: Add 2 convenience functions
compat-wireless: Conditionally build network drivers
compat-wireless: Put network patches into its directory
compat-wireless: No need to search for patches
compat-wireless: Fix cmdline parameter's name
compat-wireless: Selectively apply patches
compat-wireless: Move refresh logic into the loop
compat-wireless: Fetch in DRM drivers
compat-wireless: Add DRM patches

...-QCA-ethernet-driver-which-supercedes-atl.patch | 13498 -------------------
crap/0002-backport-alx.patch | 133 -
crap/0003-remove-atl1c-devices-from-alx.patch | 19 -
...s-adds-the-802.11ad-60-GHz-wil6210-driver.patch | 5757 --------
...-QCA-ethernet-driver-which-supercedes-atl.patch | 13498 +++++++++++++++++++
crap/network/0002-backport-alx.patch | 133 +
.../0003-remove-atl1c-devices-from-alx.patch | 19 +
...s-adds-the-802.11ad-60-GHz-wil6210-driver.patch | 5757 ++++++++
patches/0001-netdev_ops.patch | 279 -
patches/0002-net-misc.patch | 68 -
patches/0003-netdev-needed_headroom_tailroom.patch | 36 -
patches/0004-wext-namespace.patch | 58 -
patches/02-ksize.patch | 69 -
patches/03-rfkill.patch | 66 -
patches/04-netns.patch | 149 -
patches/05-usb.patch | 26 -
patches/06-header-changes.patch | 117 -
patches/07-change-default-rate-alg.patch | 34 -
patches/08-rename-config-options.patch | 167 -
patches/09-cfg80211-wext-padding.patch | 62 -
patches/09-threaded-irq.patch | 129 -
patches/10-add-wext-handlers-to-netdev.patch | 47 -
patches/11-dev-pm-ops.patch | 403 -
patches/12-iw_handler-changes.patch | 14 -
patches/12-mac80211-disable-tx-status.patch | 24 -
patches/14-device-type.patch | 56 -
patches/15-symbol-export-conflicts.patch | 18 -
patches/16-bluetooth.patch | 576 -
patches/17-netdev-queue.patch | 47 -
patches/18-rename-usb-net-symbols.patch | 53 -
patches/21-capi-proc_fops.patch | 73 -
patches/22-multiqueue.patch | 43 -
patches/24-pcmcia.patch | 1414 --
patches/25-multicast-list_head.patch | 820 --
patches/26-sdio-quirks.patch | 32 -
patches/27-hermes-read-pda-conflict.patch | 56 -
patches/29-sdio_no_suspend.patch | 199 -
patches/30-bridge-port.patch | 45 -
patches/32-remove-ns-type.patch | 28 -
patches/35-fix-makefile-includes.patch | 71 -
patches/36-workqueue.patch | 16 -
patches/37-vsnprintk.patch | 35 -
patches/38-led-max-brightness.patch | 24 -
patches/39-remove_blink_set.patch | 56 -
patches/40-netdev-hw-features.patch | 372 -
patches/42-netlink_seq.patch | 12 -
patches/43-rename_pm_qos_request.patch | 14 -
patches/44-deactivate-mac80211-tracing.patch | 15 -
patches/45-remove-platform-id-table.patch | 23 -
patches/46-use_other_workqueue.patch | 19 -
patches/47-no_trans_start_on_netdev_queue.patch | 17 -
patches/48-use_skb_get_queue_mapping.patch | 38 -
patches/50-libertas-olpc-ec-wakeup.patch | 23 -
patches/52-tty-dev.patch | 32 -
patches/53-pr_fmt.patch | 821 --
patches/54-get_ts_info.patch | 39 -
patches/55-iwlwifi-msg-trace-fix.patch | 70 -
patches/56-mac80211-trace-fix.patch | 79 -
patches/57-iwlwifi-debug-fix.patch | 19 -
patches/61-netdev-addr_assign_type.patch | 53 -
patches/62-usb_driver_lpm.patch | 276 -
patches/63-tty-termios.patch | 49 -
patches/64-b44-32bit-stats.patch | 54 -
patches/65-ignore-dismantle.patch | 23 -
patches/99-change-makefiles.patch | 100 -
patches/drm/01-dma_buf_ops-addition.patch | 54 +
patches/drm/02-revert-vm_mmap.patch | 100 +
patches/drm/03-swiotlb.patch | 87 +
patches/drm/04-revert-prime-support.patch | 384 +
patches/drm/05-i915-define-acpi-video-class.patch | 18 +
patches/drm/98-pr_fmt.patch | 199 +
patches/drm/99-change-makefile.patch | 28 +
patches/network/0001-netdev_ops.patch | 279 +
patches/network/0002-net-misc.patch | 68 +
.../0003-netdev-needed_headroom_tailroom.patch | 36 +
patches/network/0004-wext-namespace.patch | 58 +
patches/network/02-ksize.patch | 69 +
patches/network/03-rfkill.patch | 66 +
patches/network/04-netns.patch | 149 +
patches/network/05-usb.patch | 26 +
patches/network/06-header-changes.patch | 117 +
patches/network/07-change-default-rate-alg.patch | 34 +
patches/network/08-rename-config-options.patch | 167 +
patches/network/09-cfg80211-wext-padding.patch | 62 +
patches/network/09-threaded-irq.patch | 129 +
.../network/10-add-wext-handlers-to-netdev.patch | 47 +
patches/network/11-dev-pm-ops.patch | 403 +
patches/network/12-iw_handler-changes.patch | 14 +
.../network/12-mac80211-disable-tx-status.patch | 24 +
patches/network/14-device-type.patch | 56 +
patches/network/15-symbol-export-conflicts.patch | 18 +
patches/network/16-bluetooth.patch | 576 +
patches/network/17-netdev-queue.patch | 47 +
patches/network/18-rename-usb-net-symbols.patch | 53 +
patches/network/21-capi-proc_fops.patch | 73 +
patches/network/22-multiqueue.patch | 43 +
patches/network/24-pcmcia.patch | 1414 ++
patches/network/25-multicast-list_head.patch | 820 ++
patches/network/26-sdio-quirks.patch | 32 +
patches/network/27-hermes-read-pda-conflict.patch | 56 +
patches/network/29-sdio_no_suspend.patch | 199 +
patches/network/30-bridge-port.patch | 45 +
patches/network/32-remove-ns-type.patch | 28 +
patches/network/35-fix-makefile-includes.patch | 71 +
patches/network/36-workqueue.patch | 16 +
patches/network/37-vsnprintk.patch | 35 +
patches/network/38-led-max-brightness.patch | 24 +
patches/network/39-remove_blink_set.patch | 56 +
patches/network/40-netdev-hw-features.patch | 372 +
patches/network/42-netlink_seq.patch | 12 +
patches/network/43-rename_pm_qos_request.patch | 14 +
.../network/44-deactivate-mac80211-tracing.patch | 15 +
patches/network/45-remove-platform-id-table.patch | 23 +
patches/network/46-use_other_workqueue.patch | 19 +
.../47-no_trans_start_on_netdev_queue.patch | 17 +
patches/network/48-use_skb_get_queue_mapping.patch | 38 +
patches/network/50-libertas-olpc-ec-wakeup.patch | 23 +
patches/network/52-tty-dev.patch | 32 +
patches/network/53-pr_fmt.patch | 821 ++
patches/network/54-get_ts_info.patch | 39 +
patches/network/55-iwlwifi-msg-trace-fix.patch | 70 +
patches/network/56-mac80211-trace-fix.patch | 79 +
patches/network/57-iwlwifi-debug-fix.patch | 19 +
patches/network/61-netdev-addr_assign_type.patch | 53 +
patches/network/62-usb_driver_lpm.patch | 276 +
patches/network/63-tty-termios.patch | 49 +
patches/network/64-b44-32bit-stats.patch | 54 +
patches/network/65-ignore-dismantle.patch | 23 +
patches/network/99-change-makefiles.patch | 100 +
scripts/admin-update.sh | 573 +-
130 files changed, 28145 insertions(+), 27228 deletions(-)
delete mode 100644 crap/0001-alx-add-new-QCA-ethernet-driver-which-supercedes-atl.patch
delete mode 100644 crap/0002-backport-alx.patch
delete mode 100644 crap/0003-remove-atl1c-devices-from-alx.patch
delete mode 100644 crap/0004-wireless-adds-the-802.11ad-60-GHz-wil6210-driver.patch
create mode 100644 crap/network/0001-alx-add-new-QCA-ethernet-driver-which-supercedes-atl.patch
create mode 100644 crap/network/0002-backport-alx.patch
create mode 100644 crap/network/0003-remove-atl1c-devices-from-alx.patch
create mode 100644 crap/network/0004-wireless-adds-the-802.11ad-60-GHz-wil6210-driver.patch
delete mode 100644 patches/0001-netdev_ops.patch
delete mode 100644 patches/0002-net-misc.patch
delete mode 100644 patches/0003-netdev-needed_headroom_tailroom.patch
delete mode 100644 patches/0004-wext-namespace.patch
delete mode 100644 patches/02-ksize.patch
delete mode 100644 patches/03-rfkill.patch
delete mode 100644 patches/04-netns.patch
delete mode 100644 patches/05-usb.patch
delete mode 100644 patches/06-header-changes.patch
delete mode 100644 patches/07-change-default-rate-alg.patch
delete mode 100644 patches/08-rename-config-options.patch
delete mode 100644 patches/09-cfg80211-wext-padding.patch
delete mode 100644 patches/09-threaded-irq.patch
delete mode 100644 patches/10-add-wext-handlers-to-netdev.patch
delete mode 100644 patches/11-dev-pm-ops.patch
delete mode 100644 patches/12-iw_handler-changes.patch
delete mode 100644 patches/12-mac80211-disable-tx-status.patch
delete mode 100644 patches/14-device-type.patch
delete mode 100644 patches/15-symbol-export-conflicts.patch
delete mode 100644 patches/16-bluetooth.patch
delete mode 100644 patches/17-netdev-queue.patch
delete mode 100644 patches/18-rename-usb-net-symbols.patch
delete mode 100644 patches/21-capi-proc_fops.patch
delete mode 100644 patches/22-multiqueue.patch
delete mode 100644 patches/24-pcmcia.patch
delete mode 100644 patches/25-multicast-list_head.patch
delete mode 100644 patches/26-sdio-quirks.patch
delete mode 100644 patches/27-hermes-read-pda-conflict.patch
delete mode 100644 patches/29-sdio_no_suspend.patch
delete mode 100644 patches/30-bridge-port.patch
delete mode 100644 patches/32-remove-ns-type.patch
delete mode 100644 patches/35-fix-makefile-includes.patch
delete mode 100644 patches/36-workqueue.patch
delete mode 100644 patches/37-vsnprintk.patch
delete mode 100644 patches/38-led-max-brightness.patch
delete mode 100644 patches/39-remove_blink_set.patch
delete mode 100644 patches/40-netdev-hw-features.patch
delete mode 100644 patches/42-netlink_seq.patch
delete mode 100644 patches/43-rename_pm_qos_request.patch
delete mode 100644 patches/44-deactivate-mac80211-tracing.patch
delete mode 100644 patches/45-remove-platform-id-table.patch
delete mode 100644 patches/46-use_other_workqueue.patch
delete mode 100644 patches/47-no_trans_start_on_netdev_queue.patch
delete mode 100644 patches/48-use_skb_get_queue_mapping.patch
delete mode 100644 patches/50-libertas-olpc-ec-wakeup.patch
delete mode 100644 patches/52-tty-dev.patch
delete mode 100644 patches/53-pr_fmt.patch
delete mode 100644 patches/54-get_ts_info.patch
delete mode 100644 patches/55-iwlwifi-msg-trace-fix.patch
delete mode 100644 patches/56-mac80211-trace-fix.patch
delete mode 100644 patches/57-iwlwifi-debug-fix.patch
delete mode 100644 patches/61-netdev-addr_assign_type.patch
delete mode 100644 patches/62-usb_driver_lpm.patch
delete mode 100644 patches/63-tty-termios.patch
delete mode 100644 patches/64-b44-32bit-stats.patch
delete mode 100644 patches/65-ignore-dismantle.patch
delete mode 100644 patches/99-change-makefiles.patch
create mode 100644 patches/drm/01-dma_buf_ops-addition.patch
create mode 100644 patches/drm/02-revert-vm_mmap.patch
create mode 100644 patches/drm/03-swiotlb.patch
create mode 100644 patches/drm/04-revert-prime-support.patch
create mode 100644 patches/drm/05-i915-define-acpi-video-class.patch
create mode 100644 patches/drm/98-pr_fmt.patch
create mode 100644 patches/drm/99-change-makefile.patch
create mode 100644 patches/network/0001-netdev_ops.patch
create mode 100644 patches/network/0002-net-misc.patch
create mode 100644 patches/network/0003-netdev-needed_headroom_tailroom.patch
create mode 100644 patches/network/0004-wext-namespace.patch
create mode 100644 patches/network/02-ksize.patch
create mode 100644 patches/network/03-rfkill.patch
create mode 100644 patches/network/04-netns.patch
create mode 100644 patches/network/05-usb.patch
create mode 100644 patches/network/06-header-changes.patch
create mode 100644 patches/network/07-change-default-rate-alg.patch
create mode 100644 patches/network/08-rename-config-options.patch
create mode 100644 patches/network/09-cfg80211-wext-padding.patch
create mode 100644 patches/network/09-threaded-irq.patch
create mode 100644 patches/network/10-add-wext-handlers-to-netdev.patch
create mode 100644 patches/network/11-dev-pm-ops.patch
create mode 100644 patches/network/12-iw_handler-changes.patch
create mode 100644 patches/network/12-mac80211-disable-tx-status.patch
create mode 100644 patches/network/14-device-type.patch
create mode 100644 patches/network/15-symbol-export-conflicts.patch
create mode 100644 patches/network/16-bluetooth.patch
create mode 100644 patches/network/17-netdev-queue.patch
create mode 100644 patches/network/18-rename-usb-net-symbols.patch
create mode 100644 patches/network/21-capi-proc_fops.patch
create mode 100644 patches/network/22-multiqueue.patch
create mode 100644 patches/network/24-pcmcia.patch
create mode 100644 patches/network/25-multicast-list_head.patch
create mode 100644 patches/network/26-sdio-quirks.patch
create mode 100644 patches/network/27-hermes-read-pda-conflict.patch
create mode 100644 patches/network/29-sdio_no_suspend.patch
create mode 100644 patches/network/30-bridge-port.patch
create mode 100644 patches/network/32-remove-ns-type.patch
create mode 100644 patches/network/35-fix-makefile-includes.patch
create mode 100644 patches/network/36-workqueue.patch
create mode 100644 patches/network/37-vsnprintk.patch
create mode 100644 patches/network/38-led-max-brightness.patch
create mode 100644 patches/network/39-remove_blink_set.patch
create mode 100644 patches/network/40-netdev-hw-features.patch
create mode 100644 patches/network/42-netlink_seq.patch
create mode 100644 patches/network/43-rename_pm_qos_request.patch
create mode 100644 patches/network/44-deactivate-mac80211-tracing.patch
create mode 100644 patches/network/45-remove-platform-id-table.patch
create mode 100644 patches/network/46-use_other_workqueue.patch
create mode 100644 patches/network/47-no_trans_start_on_netdev_queue.patch
create mode 100644 patches/network/48-use_skb_get_queue_mapping.patch
create mode 100644 patches/network/50-libertas-olpc-ec-wakeup.patch
create mode 100644 patches/network/52-tty-dev.patch
create mode 100644 patches/network/53-pr_fmt.patch
create mode 100644 patches/network/54-get_ts_info.patch
create mode 100644 patches/network/55-iwlwifi-msg-trace-fix.patch
create mode 100644 patches/network/56-mac80211-trace-fix.patch
create mode 100644 patches/network/57-iwlwifi-debug-fix.patch
create mode 100644 patches/network/61-netdev-addr_assign_type.patch
create mode 100644 patches/network/62-usb_driver_lpm.patch
create mode 100644 patches/network/63-tty-termios.patch
create mode 100644 patches/network/64-b44-32bit-stats.patch
create mode 100644 patches/network/65-ignore-dismantle.patch
create mode 100644 patches/network/99-change-makefiles.patch

--
1.7.11.2



2012-08-09 18:02:36

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 11/13] compat-wireless: Move refresh logic into the loop

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index e701406..f0c7ad0 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -610,11 +610,12 @@ ORIG_CODE=$(find ./ -type f -name \*.[ch] |
printf "\n${CYAN}compat-drivers code metrics${NORMAL}\n\n" > $CODE_METRICS
printf "${PURPLE}%10s${NORMAL} - Total upstream lines of code being pulled\n" $ORIG_CODE >> $CODE_METRICS

-for dir in $EXTRA_PATCHES; do
- LAST_ELEM=$dir
-done
-
for subsystem in $SUBSYSTEMS; do
+
+ for dir in $EXTRA_PATCHES; do
+ LAST_ELEM=$dir
+ done
+
for dir in $EXTRA_PATCHES; do
PATCHDIR="$dir/$subsystem"
if [[ ! -d $PATCHDIR ]]; then
@@ -622,7 +623,7 @@ for subsystem in $SUBSYSTEMS; do
continue
fi
if [[ $LAST_ELEM = $dir && "$REFRESH" = y ]]; then
- patchRefresh $dir
+ patchRefresh $PATCHDIR
fi

for i in $(ls -v $PATCHDIR/*.patch 2> /dev/null); do
--
1.7.11.2


2012-08-09 18:01:51

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 03/13] compat-wireless: List everything vertically without concatenating

List everything vertically as it is much more readable. Also don't
concat strings but list them sequentially in one variable.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 116 ++++++++++++++++++++++++++++--------------------
1 file changed, 67 insertions(+), 49 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index df82ea3..6d7ca54 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -266,14 +266,32 @@ else
fi

# Now define what files to copy from $GIT_URL
-INCLUDE_NET_BT="hci_core.h l2cap.h bluetooth.h rfcomm.h hci.h hci_mon.h mgmt.h sco.h smp.h a2mp.h"
-NET_BT_DIRS="bluetooth bluetooth/bnep bluetooth/cmtp bluetooth/rfcomm bluetooth/hidp"
-
-INCLUDE_LINUX="ieee80211.h nl80211.h"
-INCLUDE_LINUX="$INCLUDE_LINUX pci_ids.h eeprom_93cx6.h"
-INCLUDE_LINUX="$INCLUDE_LINUX ath9k_platform.h"
-INCLUDE_LINUX="$INCLUDE_LINUX wl12xx.h"
-INCLUDE_LINUX="$INCLUDE_LINUX rndis.h"
+INCLUDE_NET_BT="hci_core.h
+ l2cap.h
+ bluetooth.h
+ rfcomm.h
+ hci.h
+ hci_mon.h
+ mgmt.h
+ sco.h
+ smp.h
+ a2mp.h"
+
+# Bluetooth related directories
+NET_BT_DIRS="bluetooth
+ bluetooth/bnep
+ bluetooth/cmtp
+ bluetooth/rfcomm
+ bluetooth/hidp"
+
+# Required headers from include/linux
+INCLUDE_LINUX="ieee80211.h
+ nl80211.h
+ pci_ids.h
+ eeprom_93cx6.h
+ ath9k_platform.h
+ wl12xx.h
+ rndis.h"

# For rndis_wext
INCLUDE_LINUX_USB="usbnet.h rndis_host.h"
@@ -291,47 +309,47 @@ INCLUDE_NET="cfg80211.h
NET_DIRS="wireless mac80211 rfkill"

# WLAN drivers that have their own directory
-DRIVERS_WLAN="drivers/bcma"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath/carl9170"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath/ath5k"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath/ath6kl"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath/ath9k"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/b43"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/b43legacy"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/brcmfmac"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/brcmsmac"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/brcmsmac/phy"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/brcmutil"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/include"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/iwlegacy"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/iwlwifi"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/iwlwifi/pcie"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/iwlwifi/dvm"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rt2x00"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/zd1211rw"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/libertas"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/p54"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtl818x"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtl818x/rtl8180"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtl818x/rtl8187"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192c"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192ce"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192cu"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192se"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192de"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/libertas_tf"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ipw2x00"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti/wl12xx"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti/wl1251"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti/wlcore"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti/wl18xx"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/orinoco"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/mwifiex"
-DRIVERS_WLAN="$DRIVERS_WLAN drivers/ssb"
+DRIVERS_WLAN="drivers/bcma
+ drivers/net/wireless/ath
+ drivers/net/wireless/ath/carl9170
+ drivers/net/wireless/ath/ath5k
+ drivers/net/wireless/ath/ath6kl
+ drivers/net/wireless/ath/ath9k
+ drivers/net/wireless/b43
+ drivers/net/wireless/b43legacy
+ drivers/net/wireless/brcm80211
+ drivers/net/wireless/brcm80211/brcmfmac
+ drivers/net/wireless/brcm80211/brcmsmac
+ drivers/net/wireless/brcm80211/brcmsmac/phy
+ drivers/net/wireless/brcm80211/brcmutil
+ drivers/net/wireless/brcm80211/include
+ drivers/net/wireless/iwlegacy
+ drivers/net/wireless/iwlwifi
+ drivers/net/wireless/iwlwifi/pcie
+ drivers/net/wireless/iwlwifi/dvm
+ drivers/net/wireless/rt2x00
+ drivers/net/wireless/zd1211rw
+ drivers/net/wireless/libertas
+ drivers/net/wireless/p54
+ drivers/net/wireless/rtl818x
+ drivers/net/wireless/rtl818x/rtl8180
+ drivers/net/wireless/rtl818x/rtl8187
+ drivers/net/wireless/rtlwifi
+ drivers/net/wireless/rtlwifi/rtl8192c
+ drivers/net/wireless/rtlwifi/rtl8192ce
+ drivers/net/wireless/rtlwifi/rtl8192cu
+ drivers/net/wireless/rtlwifi/rtl8192se
+ drivers/net/wireless/rtlwifi/rtl8192de
+ drivers/net/wireless/libertas_tf
+ drivers/net/wireless/ipw2x00
+ drivers/net/wireless/ti
+ drivers/net/wireless/ti/wl12xx
+ drivers/net/wireless/ti/wl1251
+ drivers/net/wireless/ti/wlcore
+ drivers/net/wireless/ti/wl18xx
+ drivers/net/wireless/orinoco
+ drivers/net/wireless/mwifiex
+ drivers/ssb"

# WLAN drivers not having dedicated directories
DRIVERS_WLAN_FILES="adm8211.c
--
1.7.11.2


2012-08-09 18:02:39

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 13/13] compat-wireless: Add DRM patches

Bring DRM patches from compat-drm GSoC tree.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
patches/drm/01-dma_buf_ops-addition.patch | 54 +++
patches/drm/02-revert-vm_mmap.patch | 100 ++++++
patches/drm/03-swiotlb.patch | 87 +++++
patches/drm/04-revert-prime-support.patch | 384 ++++++++++++++++++++++
patches/drm/05-i915-define-acpi-video-class.patch | 18 +
patches/drm/98-pr_fmt.patch | 199 +++++++++++
patches/drm/99-change-makefile.patch | 28 ++
7 files changed, 870 insertions(+)
create mode 100644 patches/drm/01-dma_buf_ops-addition.patch
create mode 100644 patches/drm/02-revert-vm_mmap.patch
create mode 100644 patches/drm/03-swiotlb.patch
create mode 100644 patches/drm/04-revert-prime-support.patch
create mode 100644 patches/drm/05-i915-define-acpi-video-class.patch
create mode 100644 patches/drm/98-pr_fmt.patch
create mode 100644 patches/drm/99-change-makefile.patch

diff --git a/patches/drm/01-dma_buf_ops-addition.patch b/patches/drm/01-dma_buf_ops-addition.patch
new file mode 100644
index 0000000..ee95cb5
--- /dev/null
+++ b/patches/drm/01-dma_buf_ops-addition.patch
@@ -0,0 +1,54 @@
+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.
+
+Note that the dma-buf itself was added with 3.4. It is not available
+on kernels < 3.4.
+
+Index: compat-drm/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/i915_gem_dmabuf.c
++++ compat-drm/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+@@ -159,9 +159,11 @@ 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
+ };
+
+ struct dma_buf *i915_gem_prime_export(struct drm_device *dev,
+Index: compat-drm/drivers/gpu/drm/nouveau/nouveau_prime.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/nouveau/nouveau_prime.c
++++ compat-drm/drivers/gpu/drm/nouveau/nouveau_prime.c
+@@ -111,9 +111,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
+Index: compat-drm/drivers/gpu/drm/radeon/radeon_prime.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/radeon/radeon_prime.c
++++ compat-drm/drivers/gpu/drm/radeon/radeon_prime.c
+@@ -134,9 +134,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
new file mode 100644
index 0000000..aec746a
--- /dev/null
+++ b/patches/drm/02-revert-vm_mmap.patch
@@ -0,0 +1,100 @@
+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.
+
+Index: compat-drm/drivers/gpu/drm/drm_bufs.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/drm_bufs.c
++++ compat-drm/drivers/gpu/drm/drm_bufs.c
+@@ -1553,6 +1553,20 @@ int drm_mapbufs(struct drm_device *dev,
+ retcode = -EINVAL;
+ goto done;
+ }
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
++ down_write(&current->mm->mmap_sem);
++ virtual = do_mmap(file_priv->filp, 0, map->size,
++ PROT_READ | PROT_WRITE,
++ MAP_SHARED,
++ token);
++ up_write(&current->mm->mmap_sem);
++ } else {
++ down_write(&current->mm->mmap_sem);
++ virtual = do_mmap(file_priv->filp, 0, dma->byte_count,
++ PROT_READ | PROT_WRITE,
++ MAP_SHARED, 0);
++ up_write(&current->mm->mmap_sem);
++#else
+ virtual = vm_mmap(file_priv->filp, 0, map->size,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED,
+@@ -1561,6 +1575,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 */
+Index: compat-drm/drivers/gpu/drm/i810/i810_dma.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i810/i810_dma.c
++++ compat-drm/drivers/gpu/drm/i810/i810_dma.c
+@@ -133,9 +133,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(&current->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(&current->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)) {
+@@ -156,9 +164,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(&current->mm->mmap_sem);
++ retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual,
++ (size_t) buf->total);
++ up_write(&current->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;
+
+Index: compat-drm/drivers/gpu/drm/i915/i915_gem.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/i915_gem.c
++++ compat-drm/drivers/gpu/drm/i915/i915_gem.c
+@@ -1045,10 +1045,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(&current->mm->mmap_sem);
++ addr = do_mmap(obj->filp, 0, args->size,
++ PROT_READ | PROT_WRITE, MAP_SHARED,
++ args->offset);
++ up_write(&current->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
new file mode 100644
index 0000000..eaa583b
--- /dev/null
+++ b/patches/drm/03-swiotlb.patch
@@ -0,0 +1,87 @@
+
+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.
+
+Index: compat-drm/drivers/gpu/drm/nouveau/nouveau_bo.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/nouveau/nouveau_bo.c
++++ compat-drm/drivers/gpu/drm/nouveau/nouveau_bo.c
+@@ -1297,11 +1297,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) {
+@@ -1347,12 +1349,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]) {
+Index: compat-drm/drivers/gpu/drm/radeon/radeon_ttm.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/radeon/radeon_ttm.c
++++ compat-drm/drivers/gpu/drm/radeon/radeon_ttm.c
+@@ -630,11 +630,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(&gtt->ttm, rdev->dev);
+ }
+ #endif
++#endif
+
+ r = ttm_pool_populate(ttm);
+ if (r) {
+@@ -676,12 +678,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(&gtt->ttm, rdev->dev);
+ return;
+ }
+ #endif
++#endif
+
+ for (i = 0; i < ttm->num_pages; i++) {
+ if (gtt->ttm.dma_address[i]) {
+@@ -906,6 +910,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");
+@@ -915,6 +920,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
new file mode 100644
index 0000000..c835790
--- /dev/null
+++ b/patches/drm/04-revert-prime-support.patch
@@ -0,0 +1,384 @@
+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.
+
+Index: compat-drm/drivers/gpu/drm/drm_drv.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/drm_drv.c
++++ compat-drm/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_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
+ DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCRTC, drm_mode_getcrtc, DRM_CONTROL_ALLOW|DRM_UNLOCKED),
+Index: compat-drm/drivers/gpu/drm/drm_fops.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/drm_fops.c
++++ compat-drm/drivers/gpu/drm/drm_fops.c
+@@ -271,8 +271,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);
+@@ -575,8 +577,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
+
+ kfree(file_priv);
+
+Index: compat-drm/drivers/gpu/drm/drm_gem.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/drm_gem.c
++++ compat-drm/drivers/gpu/drm/drm_gem.c
+@@ -35,7 +35,11 @@
+ #include <linux/mman.h>
+ #include <linux/pagemap.h>
+ #include <linux/shmem_fs.h>
++
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ #include <linux/dma-buf.h>
++#endif
++
+ #include "drmP.h"
+
+ /** @file drm_gem.c
+@@ -204,6 +208,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 +217,7 @@ drm_gem_remove_prime_handles(struct drm_
+ drm_prime_remove_imported_buf_handle(&filp->prime,
+ obj->export_dma_buf);
+ }
++#endif
+ }
+
+ /**
+Index: compat-drm/drivers/gpu/drm/drm_prime.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/drm_prime.c
++++ compat-drm/drivers/gpu/drm/drm_prime.c
+@@ -26,6 +26,8 @@
+ *
+ */
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
++
+ #include <linux/export.h>
+ #include <linux/dma-buf.h>
+ #include "drmP.h"
+@@ -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)) */
+Index: compat-drm/drivers/gpu/drm/nouveau/nouveau_prime.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/nouveau/nouveau_prime.c
++++ compat-drm/drivers/gpu/drm/nouveau/nouveau_prime.c
+@@ -22,6 +22,7 @@
+ * Authors: Dave Airlie
+ */
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ #include "drmP.h"
+ #include "drm.h"
+
+@@ -230,4 +231,4 @@ fail_detach:
+ dma_buf_detach(dma_buf, attach);
+ return ERR_PTR(ret);
+ }
+-
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */
+Index: compat-drm/drivers/gpu/drm/radeon/radeon_prime.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/radeon/radeon_prime.c
++++ compat-drm/drivers/gpu/drm/radeon/radeon_prime.c
+@@ -23,6 +23,8 @@
+ *
+ * Authors: Alex Deucher
+ */
++
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ #include "drmP.h"
+ #include "drm.h"
+
+@@ -226,3 +228,4 @@ fail_detach:
+ dma_buf_detach(dma_buf, attach);
+ return ERR_PTR(ret);
+ }
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */
+Index: compat-drm/drivers/gpu/drm/radeon/radeon_drv.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/radeon/radeon_drv.c
++++ compat-drm/drivers/gpu/drm/radeon/radeon_drv.c
+@@ -340,8 +340,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,
+@@ -377,10 +379,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,
+Index: compat-drm/drivers/gpu/drm/radeon/radeon_gem.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/radeon/radeon_gem.c
++++ compat-drm/drivers/gpu/drm/radeon/radeon_gem.c
+@@ -42,8 +42,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);
+ }
+ }
+Index: compat-drm/drivers/gpu/drm/radeon/radeon_ttm.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/radeon/radeon_ttm.c
++++ compat-drm/drivers/gpu/drm/radeon/radeon_ttm.c
+@@ -583,17 +583,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
+@@ -637,10 +641,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
+Index: compat-drm/drivers/gpu/drm/nouveau/nouveau_bo.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/nouveau/nouveau_bo.c
++++ compat-drm/drivers/gpu/drm/nouveau/nouveau_bo.c
+@@ -1275,11 +1275,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,
+@@ -1287,6 +1290,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *t
+ ttm->state = tt_unbound;
+ return 0;
+ }
++#endif
+
+ dev_priv = nouveau_bdev(ttm->bdev);
+ dev = dev_priv->dev;
+@@ -1334,10 +1338,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt
+ struct drm_nouveau_private *dev_priv;
+ 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
+
+ dev_priv = nouveau_bdev(ttm->bdev);
+ dev = dev_priv->dev;
+Index: compat-drm/drivers/gpu/drm/nouveau/nouveau_drv.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/nouveau/nouveau_drv.c
++++ compat-drm/drivers/gpu/drm/nouveau/nouveau_drv.c
+@@ -403,7 +403,10 @@ static struct drm_driver 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_load,
+ .firstopen = nouveau_firstopen,
+ .lastclose = nouveau_lastclose,
+@@ -426,10 +429,12 @@ static struct drm_driver 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,
+Index: compat-drm/drivers/gpu/drm/nouveau/nouveau_gem.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/nouveau/nouveau_gem.c
++++ compat-drm/drivers/gpu/drm/nouveau/nouveau_gem.c
+@@ -23,7 +23,9 @@
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ #include <linux/dma-buf.h>
++#endif
+ #include "drmP.h"
+ #include "drm.h"
+
+@@ -55,8 +57,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);
+
+Index: compat-drm/drivers/gpu/drm/i915/i915_drv.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/i915_drv.c
++++ compat-drm/drivers/gpu/drm/i915/i915_drv.c
+@@ -1050,7 +1050,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,
+@@ -1074,10 +1078,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,
+Index: compat-drm/drivers/gpu/drm/i915/i915_gem.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/i915_gem.c
++++ compat-drm/drivers/gpu/drm/i915/i915_gem.c
+@@ -35,7 +35,9 @@
+ #include <linux/slab.h>
+ #include <linux/swap.h>
+ #include <linux/pci.h>
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ #include <linux/dma-buf.h>
++#endif
+
+ static __must_check int i915_gem_object_flush_gpu_write_domain(struct drm_i915_gem_object *obj);
+ static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj);
+@@ -3522,8 +3524,10 @@ void i915_gem_free_object(struct drm_gem
+
+ trace_i915_gem_object_destroy(obj);
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ if (gem_obj->import_attach)
+ drm_prime_gem_destroy(gem_obj, obj->sg_table);
++#endif
+
+ if (obj->phys_obj)
+ i915_gem_detach_phys_object(dev, obj);
+Index: compat-drm/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/i915_gem_dmabuf.c
++++ compat-drm/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+@@ -23,6 +23,7 @@
+ * Authors:
+ * Dave Airlie <[email protected]>
+ */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ #include "drmP.h"
+ #include "i915_drv.h"
+ #include <linux/dma-buf.h>
+@@ -232,3 +233,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
new file mode 100644
index 0000000..7fddd3b
--- /dev/null
+++ b/patches/drm/05-i915-define-acpi-video-class.patch
@@ -0,0 +1,18 @@
+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.
+
+Index: compat-drm/drivers/gpu/drm/i915/intel_opregion.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/intel_opregion.c
++++ compat-drm/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/98-pr_fmt.patch b/patches/drm/98-pr_fmt.patch
new file mode 100644
index 0000000..1b0680b
--- /dev/null
+++ b/patches/drm/98-pr_fmt.patch
@@ -0,0 +1,199 @@
+
+Undef/define/include printk.h for fixing redefinition warnings
+during build.
+
+Patch adapted from compat-wireless tree.
+
+Index: compat-drm/drivers/gpu/drm/ttm/ttm_agp_backend.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/ttm/ttm_agp_backend.c
++++ compat-drm/drivers/gpu/drm/ttm/ttm_agp_backend.c
+@@ -29,8 +29,10 @@
+ * Keith Packard.
+ */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) "[TTM] " fmt
+
++#include <linux/printk.h>
+ #include "ttm/ttm_module.h"
+ #include "ttm/ttm_bo_driver.h"
+ #include "ttm/ttm_page_alloc.h"
+Index: compat-drm/drivers/gpu/drm/ttm/ttm_bo.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/ttm/ttm_bo.c
++++ compat-drm/drivers/gpu/drm/ttm/ttm_bo.c
+@@ -28,11 +28,13 @@
+ * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
+ */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) "[TTM] " fmt
+
+ #include "ttm/ttm_module.h"
+ #include "ttm/ttm_bo_driver.h"
+ #include "ttm/ttm_placement.h"
++#include <linux/printk.h>
+ #include <linux/jiffies.h>
+ #include <linux/slab.h>
+ #include <linux/sched.h>
+Index: compat-drm/drivers/gpu/drm/ttm/ttm_bo_vm.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/ttm/ttm_bo_vm.c
++++ compat-drm/drivers/gpu/drm/ttm/ttm_bo_vm.c
+@@ -28,8 +28,10 @@
+ * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
+ */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) "[TTM] " fmt
+
++#include <linux/printk.h>
+ #include <ttm/ttm_module.h>
+ #include <ttm/ttm_bo_driver.h>
+ #include <ttm/ttm_placement.h>
+Index: compat-drm/drivers/gpu/drm/ttm/ttm_memory.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/ttm/ttm_memory.c
++++ compat-drm/drivers/gpu/drm/ttm/ttm_memory.c
+@@ -25,11 +25,13 @@
+ *
+ **************************************************************************/
+
++#undef pr_fmt
+ #define pr_fmt(fmt) "[TTM] " fmt
+
+ #include "ttm/ttm_memory.h"
+ #include "ttm/ttm_module.h"
+ #include "ttm/ttm_page_alloc.h"
++#include <linux/printk.h>
+ #include <linux/spinlock.h>
+ #include <linux/sched.h>
+ #include <linux/wait.h>
+Index: compat-drm/drivers/gpu/drm/ttm/ttm_object.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/ttm/ttm_object.c
++++ compat-drm/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 "ttm/ttm_object.h"
+ #include "ttm/ttm_module.h"
++#include <linux/printk.h>
+ #include <linux/list.h>
+ #include <linux/spinlock.h>
+ #include <linux/slab.h>
+Index: compat-drm/drivers/gpu/drm/ttm/ttm_page_alloc.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/ttm/ttm_page_alloc.c
++++ compat-drm/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 <linux/printk.h>
+ #include <linux/list.h>
+ #include <linux/spinlock.h>
+ #include <linux/highmem.h>
+Index: compat-drm/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
++++ compat-drm/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 <linux/printk.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/list.h>
+ #include <linux/seq_file.h> /* for seq_printf */
+Index: compat-drm/drivers/gpu/drm/ttm/ttm_tt.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/ttm/ttm_tt.c
++++ compat-drm/drivers/gpu/drm/ttm/ttm_tt.c
+@@ -28,8 +28,10 @@
+ * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
+ */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) "[TTM] " fmt
+
++#include <linux/printk.h>
+ #include <linux/sched.h>
+ #include <linux/highmem.h>
+ #include <linux/pagemap.h>
+Index: compat-drm/drivers/gpu/drm/i915/i915_dma.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/i915_dma.c
++++ compat-drm/drivers/gpu/drm/i915/i915_dma.c
+@@ -26,6 +26,7 @@
+ *
+ */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+ #include "drmP.h"
+@@ -36,6 +37,7 @@
+ #include "i915_drm.h"
+ #include "i915_drv.h"
+ #include "i915_trace.h"
++#include <linux/printk.h>
+ #include <linux/pci.h>
+ #include <linux/vgaarb.h>
+ #include <linux/acpi.h>
+Index: compat-drm/drivers/gpu/drm/i915/i915_irq.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/i915_irq.c
++++ compat-drm/drivers/gpu/drm/i915/i915_irq.c
+@@ -26,8 +26,10 @@
+ *
+ */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
++#include <linux/printk.h>
+ #include <linux/sysrq.h>
+ #include <linux/slab.h>
+ #include "drmP.h"
+Index: compat-drm/drivers/gpu/drm/i915/intel_opregion.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/intel_opregion.c
++++ compat-drm/drivers/gpu/drm/i915/intel_opregion.c
+@@ -25,8 +25,10 @@
+ *
+ */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
++#include <linux/printk.h>
+ #include <linux/acpi.h>
+ #include <linux/acpi_io.h>
+ #include <acpi/video.h>
+Index: compat-drm/drivers/gpu/drm/i915/intel_panel.c
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/i915/intel_panel.c
++++ compat-drm/drivers/gpu/drm/i915/intel_panel.c
+@@ -28,8 +28,10 @@
+ * Chris Wilson <[email protected]>
+ */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
++#include <linux/printk.h>
+ #include <linux/moduleparam.h>
+ #include "intel_drv.h"
+
diff --git a/patches/drm/99-change-makefile.patch b/patches/drm/99-change-makefile.patch
new file mode 100644
index 0000000..882a02d
--- /dev/null
+++ b/patches/drm/99-change-makefile.patch
@@ -0,0 +1,28 @@
+Remove drivers that we do not want to build from gpu/drm/Makefile
+
+Index: compat-drm/drivers/gpu/drm/Makefile
+===================================================================
+--- compat-drm.orig/drivers/gpu/drm/Makefile
++++ compat-drm/drivers/gpu/drm/Makefile
+@@ -28,21 +28,14 @@ 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-y += i2c/
--
1.7.11.2


2012-08-09 18:01:50

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 02/13] compat-wireless: Isolate drivers into different groups

Start isolating wlan, bt, eth drivers into different variables
for being able to selectively bring them in the near future.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 133 ++++++++++++++++++++++++++----------------------
1 file changed, 71 insertions(+), 62 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 0b09708..df82ea3 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -280,79 +280,88 @@ INCLUDE_LINUX_USB="usbnet.h rndis_host.h"

INCLUDE_LINUX_SPI="libertas_spi.h"

-# The good new yummy stuff
-INCLUDE_NET="cfg80211.h ieee80211_radiotap.h cfg80211-wext.h"
-INCLUDE_NET="$INCLUDE_NET mac80211.h lib80211.h regulatory.h"
+# 802.11 related headers
+INCLUDE_NET="cfg80211.h
+ cfg80211-wext.h
+ ieee80211_radiotap.h
+ lib80211.h
+ mac80211.h
+ regulatory.h"

NET_DIRS="wireless mac80211 rfkill"

-# Drivers that have their own directory
-DRIVERS="drivers/net/wireless/ath"
-DRIVERS="$DRIVERS drivers/net/wireless/ath/carl9170"
-DRIVERS="$DRIVERS drivers/net/wireless/ath/ath5k"
-DRIVERS="$DRIVERS drivers/net/wireless/ath/ath6kl"
-DRIVERS="$DRIVERS drivers/net/wireless/ath/ath9k"
-DRIVERS="$DRIVERS drivers/ssb"
-DRIVERS="$DRIVERS drivers/bcma"
-DRIVERS="$DRIVERS drivers/net/wireless/b43"
-DRIVERS="$DRIVERS drivers/net/wireless/b43legacy"
-DRIVERS="$DRIVERS drivers/net/wireless/brcm80211"
-DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/brcmfmac"
-DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/brcmsmac"
-DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/brcmsmac/phy"
-DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/brcmutil"
-DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/include"
-DRIVERS="$DRIVERS drivers/net/wireless/iwlegacy"
-DRIVERS="$DRIVERS drivers/net/wireless/iwlwifi"
-DRIVERS="$DRIVERS drivers/net/wireless/iwlwifi/pcie"
-DRIVERS="$DRIVERS drivers/net/wireless/iwlwifi/dvm"
-DRIVERS="$DRIVERS drivers/net/wireless/rt2x00"
-DRIVERS="$DRIVERS drivers/net/wireless/zd1211rw"
-DRIVERS="$DRIVERS drivers/net/wireless/libertas"
-DRIVERS="$DRIVERS drivers/net/wireless/p54"
-DRIVERS="$DRIVERS drivers/net/wireless/rtl818x"
-DRIVERS="$DRIVERS drivers/net/wireless/rtl818x/rtl8180"
-DRIVERS="$DRIVERS drivers/net/wireless/rtl818x/rtl8187"
-DRIVERS="$DRIVERS drivers/net/wireless/rtlwifi"
-DRIVERS="$DRIVERS drivers/net/wireless/rtlwifi/rtl8192c"
-DRIVERS="$DRIVERS drivers/net/wireless/rtlwifi/rtl8192ce"
-DRIVERS="$DRIVERS drivers/net/wireless/rtlwifi/rtl8192cu"
-DRIVERS="$DRIVERS drivers/net/wireless/rtlwifi/rtl8192se"
-DRIVERS="$DRIVERS drivers/net/wireless/rtlwifi/rtl8192de"
-DRIVERS="$DRIVERS drivers/net/wireless/libertas_tf"
-DRIVERS="$DRIVERS drivers/net/wireless/ipw2x00"
-DRIVERS="$DRIVERS drivers/net/wireless/ti"
-DRIVERS="$DRIVERS drivers/net/wireless/ti/wl12xx"
-DRIVERS="$DRIVERS drivers/net/wireless/ti/wl1251"
-DRIVERS="$DRIVERS drivers/net/wireless/ti/wlcore"
-DRIVERS="$DRIVERS drivers/net/wireless/ti/wl18xx"
-DRIVERS="$DRIVERS drivers/net/wireless/orinoco"
-DRIVERS="$DRIVERS drivers/net/wireless/mwifiex"
-
-# Staging drivers
-STAGING_DRIVERS=""
+# WLAN drivers that have their own directory
+DRIVERS_WLAN="drivers/bcma"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath/carl9170"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath/ath5k"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath/ath6kl"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ath/ath9k"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/b43"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/b43legacy"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/brcmfmac"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/brcmsmac"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/brcmsmac/phy"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/brcmutil"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/brcm80211/include"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/iwlegacy"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/iwlwifi"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/iwlwifi/pcie"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/iwlwifi/dvm"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rt2x00"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/zd1211rw"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/libertas"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/p54"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtl818x"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtl818x/rtl8180"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtl818x/rtl8187"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192c"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192ce"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192cu"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192se"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/rtlwifi/rtl8192de"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/libertas_tf"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ipw2x00"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti/wl12xx"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti/wl1251"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti/wlcore"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/ti/wl18xx"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/orinoco"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/net/wireless/mwifiex"
+DRIVERS_WLAN="$DRIVERS_WLAN drivers/ssb"
+
+# WLAN drivers not having dedicated directories
+DRIVERS_WLAN_FILES="adm8211.c
+ adm8211.h
+ at76c50x-usb.c
+ at76c50x-usb.h
+ mac80211_hwsim.c
+ mac80211_hwsim.h
+ mwl8k.c
+ rndis_wlan.c"

# Ethernet drivers
-DRIVERS="$DRIVERS drivers/net/ethernet/atheros"
-DRIVERS="$DRIVERS drivers/net/ethernet/atheros/atl1c"
-DRIVERS="$DRIVERS drivers/net/ethernet/atheros/atl1e"
-DRIVERS="$DRIVERS drivers/net/ethernet/atheros/atlx"
-DRIVERS="$DRIVERS drivers/net/ethernet/atheros/alx"
+DRIVERS_ETH="drivers/net/ethernet/atheros
+ drivers/net/ethernet/atheros/atl1c
+ drivers/net/ethernet/atheros/atl1e
+ drivers/net/ethernet/atheros/atlx
+ drivers/net/ethernet/atheros/alx"

# Bluetooth drivers
DRIVERS_BT="drivers/bluetooth"

-# Drivers that belong the the wireless directory
-DRIVER_FILES="adm8211.c adm8211.h"
-DRIVER_FILES="$DRIVER_FILES rndis_wlan.c"
-DRIVER_FILES="$DRIVER_FILES mac80211_hwsim.c mac80211_hwsim.h"
-DRIVER_FILES="$DRIVER_FILES at76c50x-usb.c at76c50x-usb.h"
-DRIVER_FILES="$DRIVER_FILES mwl8k.c"
+# Staging drivers if any
+STAGING_DRIVERS=""
+
+# Select which drivers to build
+DRIVERS="$DRIVERS_WLAN $DRIVERS_ETH"

rm -rf drivers/

-mkdir -p include/linux/ \
- include/net/ \
+mkdir -p \
include/net/bluetooth \
include/linux/usb \
include/linux/unaligned \
@@ -489,7 +498,7 @@ cp $GIT_TREE/drivers/misc/eeprom/Makefile drivers/misc/eeprom/

DIR="drivers/net/wireless"
# Drivers part of the wireless directory
-for i in $DRIVER_FILES; do
+for i in $DRIVERS_WLAN_FILES; do
cp $GIT_TREE/$DIR/$i $DIR/
done

--
1.7.11.2


2012-08-09 19:01:11

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH 10/13] compat-wireless: Selectively apply patches

On 08/09/2012 08:01 PM, Ozan Çağlayan wrote:
> Patches are now structured in network/ and drm/ subfolders.
> Apply them only if the relevant subsystem is enabled.
>
> Signed-off-by: Ozan Çağlayan <[email protected]>
> ---
> scripts/admin-update.sh | 49 +++++++++++++++++++++++++++++++------------------
> 1 file changed, 31 insertions(+), 18 deletions(-)
>
> diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
> index b5dbc4e..e701406 100755
> --- a/scripts/admin-update.sh
> +++ b/scripts/admin-update.sh
> @@ -143,7 +143,7 @@ nagometer() {
>
> let CHANGES=$ADD+$DEL
>
> - case $1 in
> + case `dirname $1` in
> "patches")
> brag_backport $ORIG_CODE $CHANGES $ADD $DEL
> ;;
> @@ -201,6 +201,7 @@ copyDirectories() {
> # These switches determines which drivers to fetch in.
> ENABLE_NETWORK=
> ENABLE_DRM=
> +SUBSYSTEMS=
>
> EXTRA_PATCHES="patches"
> REFRESH="n"
> @@ -262,6 +263,15 @@ if [ $# -ge 1 ]; then
> done
> fi
>
> +# SUBSYSTEMS is used to select which patches to apply
> +if [[ -n "$ENABLE_NETWORK" ]]; then
> + SUBSYSTEMS="network"
> +fi
> +
> +if [[ -n "$ENABLE_DRM" ]]; then
> + SUBSYSTEMS+=" drm"
> +fi
> +
> # User exported this variable
> if [ -z $GIT_TREE ]; then
> GIT_TREE="$HOME/linux-next"
> @@ -604,25 +614,28 @@ for dir in $EXTRA_PATCHES; do
> LAST_ELEM=$dir
> done
>
> -for dir in $EXTRA_PATCHES; do
> - if [[ ! -d $dir ]]; then
> - echo -e "${RED}Patches: $dir empty, skipping...${NORMAL}\n"
> - continue
> - fi
> - if [[ $LAST_ELEM = $dir && "$REFRESH" = y ]]; then
> - patchRefresh $dir
> - fi
> -
> - for i in $(ls -v $dir/*.patch &> /dev/null); do
> - echo -e "${GREEN}Applying backport patch${NORMAL}: ${BLUE}$i${NORMAL}"
> - patch -p1 -N -t < $i
> - RET=$?
> - if [[ $RET -ne 0 ]]; then
> - echo -e "${RED}Patching $i failed${NORMAL}, update it"
> - exit $RET
> +for subsystem in $SUBSYSTEMS; do
> + for dir in $EXTRA_PATCHES; do
> + PATCHDIR="$dir/$subsystem"

The folder network does not exists in this patch, this will break git
bisect. Could you add the move of the patches from patches to network in
this commit.

I do not like the name network for the folder containing the patches,
because it could easily be to mixed up with the net folder. What about
patches-net as the folder name?

> + if [[ ! -d $PATCHDIR ]]; then
> + echo -e "${RED}Patches: $PATCHDIR empty, skipping...${NORMAL}\n"
> + continue
> + fi
> + if [[ $LAST_ELEM = $dir && "$REFRESH" = y ]]; then
> + patchRefresh $dir
> fi
> +
> + for i in $(ls -v $PATCHDIR/*.patch 2> /dev/null); do
> + echo -e "${GREEN}Applying backport patch${NORMAL}: ${BLUE}$i${NORMAL}"
> + patch -p1 -N -t < $i
> + RET=$?
> + if [[ $RET -ne 0 ]]; then
> + echo -e "${RED}Patching $i failed${NORMAL}, update it"
> + exit $RET
> + fi
> + done
> + nagometer $PATCHDIR $ORIG_CODE >> $CODE_METRICS
> done
> - nagometer $dir $ORIG_CODE >> $CODE_METRICS
> done
>
> DIR="$PWD"
>


2012-08-09 18:50:37

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH 06/13] compat-wireless: Conditionally build network drivers

On 08/09/2012 08:01 PM, Ozan Çağlayan wrote:
> Separate building of network drivers into its own conditional block.
>
> Pass network as the last cmdline argument to mimic older compat-wireless
> behaviour.
>
> Signed-off-by: Ozan Çağlayan <[email protected]>
> ---
> scripts/admin-update.sh | 254 ++++++++++++++++++------------------------------
> 1 file changed, 92 insertions(+), 162 deletions(-)
>
> diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
> index 1c516e9..05ec449 100755
> --- a/scripts/admin-update.sh
> +++ b/scripts/admin-update.sh
> @@ -75,7 +75,7 @@ patchRefresh() {
> ###
> usage() {
> printf "Usage: $0 [refresh] [ --help | -h | -s | -n | -p | -c ] <subsystem1 subsystem2 ..>\n
> - Where subsystems are: wlan, bluetooth, ethernet and drm.\n"
> + Where subsystems are: network and drm.\n"

Why are you adding the subsystems "wlan, bluetooth, ethernet" in a
previous patch and now remove them? If you reverted your original plan
to add these three subsystems and now came to the conclusion it would
need some more work, this is no problem, but you should modify your
first patch and add only that one network subsystem in the first patch
and just add drm in this one.

> printf "\n"
> printf "${GREEN}%10s${NORMAL} - Update all your patch offsets using quilt\n" "refresh"
> @@ -199,10 +199,8 @@ copyDirectories() {
> # can not be applied correctly after a code update in $GIT_URL.
>
> # These switches determines which drivers to fetch in.
> -ENABLE_WLAN=
> -ENABLE_ETH=
> +ENABLE_NETWORK=
> ENABLE_DRM=
> -ENABLE_BT=
>
> EXTRA_PATCHES="patches"
> REFRESH="n"
> @@ -247,16 +245,8 @@ if [ $# -ge 1 ]; then
> REFRESH="y"
> shift
> ;;
> - "wlan")
> - ENABLE_WLAN=1
> - shift
> - ;;
> - "bluetooth")
> - ENABLE_BT=1
> - shift
> - ;;
> - "ethernet")
> - ENABLE_ETH=1
> + "net")
> + ENABLE_NETWORK=1
> shift
> ;;
> "drm")
> @@ -323,26 +313,26 @@ INCLUDE_NET_BT="hci_core.h
> smp.h
> a2mp.h"
>
> -# Bluetooth related directories
> -NET_BT_DIRS="bluetooth
> - bluetooth/bnep
> - bluetooth/cmtp
> - bluetooth/rfcomm
> - bluetooth/hidp"
> -
> # Required headers from include/linux
> -INCLUDE_LINUX="ieee80211.h
> - nl80211.h
> - pci_ids.h
> - eeprom_93cx6.h
> - ath9k_platform.h
> - wl12xx.h
> - rndis.h"
> +INCLUDE_LINUX_WLAN="ieee80211.h
> + nl80211.h
> + eeprom_93cx6.h
> + ath9k_platform.h
> + wl12xx.h
> + rndis.h"
>
> # For rndis_wext
> -INCLUDE_LINUX_USB="usbnet.h rndis_host.h"
> +INCLUDE_LINUX_USB_WLAN="usbnet.h
> + rndis_host.h"
>
> -INCLUDE_LINUX_SPI="libertas_spi.h"
> +# For rndis_wlan, we need a new rndis_host.ko, cdc_ether.ko and usbnet.ko
> +RNDIS_REQUIREMENTS="Makefile
> + rndis_host.c
> + cdc_ether.c
> + usbnet.c"
> +
> +# For libertas
> +INCLUDE_LINUX_LIBERTAS_WLAN="libertas_spi.h"
>
> # 802.11 related headers
> INCLUDE_NET="cfg80211.h
> @@ -352,7 +342,17 @@ INCLUDE_NET="cfg80211.h
> mac80211.h
> regulatory.h"
>
> -NET_DIRS="wireless mac80211 rfkill"
> +# Core 802.11 and rfkill code
> +NET_WLAN_DIRS="net/wireless
> + net/mac80211
> + net/rfkill"
> +
> +# Bluetooth related directories
> +NET_BT_DIRS="net/bluetooth
> + net/bluetooth/bnep
> + net/bluetooth/cmtp
> + net/bluetooth/rfcomm
> + net/bluetooth/hidp"
>
> # WLAN drivers that have their own directory
> DRIVERS_WLAN="drivers/bcma
> @@ -433,97 +433,58 @@ mkdir -p \
> include/trace \
> include/pcmcia \
> include/crypto \
> - net/mac80211/ \
> - net/wireless/ \
> - net/rfkill/ \
> - drivers/ssb/ \
> - drivers/bcma/ \
> - drivers/net/usb/ \
> - drivers/net/wireless/ \
> - drivers/net/ethernet/atheros \
> - drivers/net/ethernet/broadcom
> -
> -# include/linux
> -DIR="include/linux"
> -for i in $INCLUDE_LINUX; do
> - echo "Copying $GIT_TREE/$DIR/$i"
> - cp "$GIT_TREE/$DIR/$i" $DIR/
> -done
> -
> -cp -a $GIT_TREE/include/linux/ssb include/linux/
> -cp -a $GIT_TREE/include/linux/bcma include/linux/
> -cp -a $GIT_TREE/include/linux/rfkill.h include/linux/rfkill_backport.h
> -
> -# include/net
> -DIR="include/net"
> -for i in $INCLUDE_NET; do
> - echo "Copying $GIT_TREE/$DIR/$i"
> - cp "$GIT_TREE/$DIR/$i" $DIR/
> -done
> -
> -DIR="include/net/bluetooth"
> -for i in $INCLUDE_NET_BT; do
> - echo "Copying $GIT_TREE/$DIR/$i"
> - cp $GIT_TREE/$DIR/$i $DIR/
> -done
> -
> -DIR="include/linux/usb"
> -for i in $INCLUDE_LINUX_USB; do
> - echo "Copying $GIT_TREE/$DIR/$i"
> - cp $GIT_TREE/$DIR/$i $DIR/
> -done
> -
> -DIR="include/linux/spi"
> -for i in $INCLUDE_LINUX_SPI; do
> - echo "Copying $GIT_TREE/$DIR/$i"
> - cp $GIT_TREE/$DIR/$i $DIR/
> -done
> -
> -# net/wireless and net/mac80211
> -for i in $NET_DIRS; do
> - echo "Copying $GIT_TREE/net/$i/*.[ch]"
> - cp $GIT_TREE/net/$i/*.[ch] net/$i/
> - cp $GIT_TREE/net/$i/Makefile net/$i/
> - cp $GIT_TREE/net/$i/Kconfig net/$i/
> -done
> -
> -cp $GIT_TREE/MAINTAINERS ./
> -
> -# Copy files needed for statically compiled regulatory rules database
> -cp $GIT_TREE/net/wireless/db.txt net/wireless/
> -cp $GIT_TREE/net/wireless/genregdb.awk net/wireless/
> -
> -# net/bluetooth
> -for i in $NET_BT_DIRS; do
> - mkdir -p net/$i
> - echo "Copying $GIT_TREE/net/$i/*.[ch]"
> - cp $GIT_TREE/net/$i/*.[ch] net/$i/
> - cp $GIT_TREE/net/$i/Makefile net/$i/
> -done
> -
> -# Drivers in their own directory
> -for i in $DRIVERS; do
> - mkdir -p $i
> -
> - # -print -quit will just print once, so we don't burden
> - # this script with searching for further files if one is
> - # found
> - FILES_FOUND=$(find $GIT_TREE/$i/ -maxdepth 1 -type f -name \*.[ch] -print -quit | wc -l)
> - if [ $FILES_FOUND -eq 1 ]; then
> - echo "Copying $GIT_TREE/$i/*.[ch]"
> - cp $GIT_TREE/$i/*.[ch] $i/
> - fi
> - if [ -f $GIT_TREE/$i/Makefile ]; then
> - cp $GIT_TREE/$i/Makefile $i/
> - fi
> - if [ -f $GIT_TREE/$i/Kconfig ]; then
> - cp $GIT_TREE/$i/Kconfig $i/
> - fi
> -done
> + drivers/bcma \
> + drivers/misc/eeprom \
> + drivers/net/usb \
> + drivers/net/ethernet/broadcom \
> + drivers/ssb \
> + drivers/staging \
> + $NET_WLAN_DIRS \
> + $NET_BT_DIRS \
> + $DRIVERS_WLAN \
> + $DRIVERS_ETH \
> + $DRIVERS_BT
> +
> +# Copy pci_ids.h for every situation
> +cp $GIT_TREE/include/linux/pci_ids.h include/linux
> +
> +if [[ -n "$ENABLE_NETWORK" ]]; then
> + # WLAN and bluetooth files
> + copyFiles "$INCLUDE_LINUX_WLAN" "include/linux"
> + copyFiles "$INCLUDE_NET" "include/net"
> + copyFiles "$INCLUDE_NET_BT" "include/net/bluetooth"
> + copyFiles "$INCLUDE_LINUX_USB_WLAN" "include/linux/usb"
> + copyFiles "$INCLUDE_LINUX_LIBERTAS_WLAN" "include/linux/spi"
> + copyFiles "$DRIVERS_WLAN_FILES" "drivers/net/wireless"
> + copyFiles "$RNDIS_REQUIREMENTS" "drivers/net/usb"
> +
> + copyDirectories "$NET_WLAN_DIRS"
> + copyDirectories "$NET_BT_DIRS"
> + copyDirectories "$DRIVERS_BT"
> + copyDirectories "$DRIVERS_WLAN"
> + copyDirectories "$DRIVERS_ETH"
> +
> + cp -a $GIT_TREE/include/linux/ssb include/linux/
> + cp -a $GIT_TREE/include/linux/bcma include/linux/
> + cp -a $GIT_TREE/include/linux/rfkill.h include/linux/rfkill_backport.h
> +
> + # Misc
> + cp $GIT_TREE/drivers/misc/eeprom/{Makefile,eeprom_93cx6.c} drivers/misc/eeprom/
> +
> + # Copy files needed for statically compiled regulatory rules database
> + cp $GIT_TREE/net/wireless/{db.txt,genregdb.awk} net/wireless/
> +
> + # Top level wireless driver Makefile
> + cp $GIT_TREE/drivers/net/wireless/Makefile drivers/net/wireless
> +
> + # Broadcom case
> + DIR="drivers/net/ethernet/broadcom"
> + cp $GIT_TREE/$DIR/b44.[ch] drivers/net/ethernet/broadcom
> + # Not yet
> + echo "obj-\$(CONFIG_B44) += b44.o" > drivers/net/ethernet/broadcom/Makefile
> +fi
>
> # Staging drivers in their own directory
> -rm -rf drivers/staging/
> -mkdir -p drivers/staging/
> for i in $STAGING_DRIVERS; do
> if [ ! -d $GIT_TREE/$i ]; then
> continue
> @@ -534,59 +495,28 @@ for i in $STAGING_DRIVERS; do
> cp -a $GIT_TREE/$i drivers/staging/
> done
>
> -for i in $DRIVERS_BT; do
> - mkdir -p $i
> - echo "Copying $GIT_TREE/$i/*.[ch]"
> - cp $GIT_TREE/$i/*.[ch] $i/
> - cp $GIT_TREE/$i/Makefile $i/
> -done
> -
> -# For rndis_wlan, we need a new rndis_host.ko, cdc_ether.ko and usbnet.ko
> -RNDIS_REQS="Makefile rndis_host.c cdc_ether.c usbnet.c"
> -DIR="drivers/net/usb"
> -for i in $RNDIS_REQS; do
> - echo "Copying $GIT_TREE/$DIR/$i"
> - cp $GIT_TREE/$DIR/$i $DIR/
> -done
> -
> -DIR="drivers/net/ethernet/broadcom"
> -echo > $DIR/Makefile
> -cp $GIT_TREE/$DIR/b44.[ch] $DIR
> -# Not yet
> -echo "obj-\$(CONFIG_B44) += b44.o" >> $DIR/Makefile
> -
> -# Misc
> -mkdir -p drivers/misc/eeprom/
> -cp $GIT_TREE/drivers/misc/eeprom/eeprom_93cx6.c drivers/misc/eeprom/
> -cp $GIT_TREE/drivers/misc/eeprom/Makefile drivers/misc/eeprom/
> -
> -DIR="drivers/net/wireless"
> -# Drivers part of the wireless directory
> -for i in $DRIVERS_WLAN_FILES; do
> - cp $GIT_TREE/$DIR/$i $DIR/
> -done
> -
> -# Top level wireless driver Makefile
> -cp $GIT_TREE/$DIR/Makefile $DIR
> +###########################
> +# Suck in compat.git tree #
> +###########################
>
> -# Compat stuff
> COMPAT="compat"
> mkdir -p $COMPAT
> echo "Copying $GIT_COMPAT_TREE/ files..."
> -cp $GIT_COMPAT_TREE/compat/*.[ch] $COMPAT/
> -cp $GIT_COMPAT_TREE/compat/Makefile $COMPAT/
> cp -a $GIT_COMPAT_TREE/udev .
> cp -a $GIT_COMPAT_TREE/scripts $COMPAT/
> cp $GIT_COMPAT_TREE/bin/ckmake $COMPAT/
> -cp -a $GIT_COMPAT_TREE/include/linux/* include/linux/
> -cp -a $GIT_COMPAT_TREE/include/net/* include/net/
> -cp -a $GIT_COMPAT_TREE/include/trace/* include/trace/
> -cp -a $GIT_COMPAT_TREE/include/pcmcia/* include/pcmcia/
> -cp -a $GIT_COMPAT_TREE/include/crypto/* include/crypto/
> +cp $GIT_COMPAT_TREE/compat/{Makefile,*.[ch]} $COMPAT/
> +DIRS="linux net trace crypto pcmcia"
> +for dir in $DIRS; do
> + cp -a $GIT_COMPAT_TREE/include/$dir/* include/$dir/
> +done
>
> # Clean up possible *.mod.c leftovers
> find -type f -name "*.mod.c" -exec rm -f {} \;
>
> +# Finally copy MAINTAINERS file
> +cp $GIT_TREE/MAINTAINERS ./
> +
> # files we suck in for wireless drivers
> export WSTABLE="
> net/wireless/
>


2012-08-09 18:01:48

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 01/13] compat-wireless: Clean up *.mod.c once after everything

Remove possible .mod.c leftovers at the end instead of after every
copying operation.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 73c3939..0b09708 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -412,7 +412,6 @@ for i in $NET_DIRS; do
cp $GIT_TREE/net/$i/*.[ch] net/$i/
cp $GIT_TREE/net/$i/Makefile net/$i/
cp $GIT_TREE/net/$i/Kconfig net/$i/
- rm -f net/$i/*.mod.c
done

cp $GIT_TREE/MAINTAINERS ./
@@ -427,7 +426,6 @@ for i in $NET_BT_DIRS; do
echo "Copying $GIT_TREE/net/$i/*.[ch]"
cp $GIT_TREE/net/$i/*.[ch] net/$i/
cp $GIT_TREE/net/$i/Makefile net/$i/
- rm -f net/$i/*.mod.c
done

# Drivers in their own directory
@@ -448,7 +446,6 @@ for i in $DRIVERS; do
if [ -f $GIT_TREE/$i/Kconfig ]; then
cp $GIT_TREE/$i/Kconfig $i/
fi
- rm -f $i/*.mod.c
done

# Staging drivers in their own directory
@@ -462,7 +459,6 @@ for i in $STAGING_DRIVERS; do
echo -e "Copying ${RED}STAGING${NORMAL} $GIT_TREE/$i/*.[ch]"
# staging drivers tend to have their own subdirs...
cp -a $GIT_TREE/$i drivers/staging/
- rm -f $i/*.mod.c
done

for i in $DRIVERS_BT; do
@@ -470,7 +466,6 @@ for i in $DRIVERS_BT; do
echo "Copying $GIT_TREE/$i/*.[ch]"
cp $GIT_TREE/$i/*.[ch] $i/
cp $GIT_TREE/$i/Makefile $i/
- rm -f $i/*.mod.c
done

# For rndis_wlan, we need a new rndis_host.ko, cdc_ether.ko and usbnet.ko
@@ -515,7 +510,9 @@ cp -a $GIT_COMPAT_TREE/include/net/* include/net/
cp -a $GIT_COMPAT_TREE/include/trace/* include/trace/
cp -a $GIT_COMPAT_TREE/include/pcmcia/* include/pcmcia/
cp -a $GIT_COMPAT_TREE/include/crypto/* include/crypto/
-rm -f $COMPAT/*.mod.c
+
+# Clean up possible *.mod.c leftovers
+find -type f -name "*.mod.c" -exec rm -f {} \;

# files we suck in for wireless drivers
export WSTABLE="
--
1.7.11.2


2012-08-09 18:01:57

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 06/13] compat-wireless: Conditionally build network drivers

Separate building of network drivers into its own conditional block.

Pass network as the last cmdline argument to mimic older compat-wireless
behaviour.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 254 ++++++++++++++++++------------------------------
1 file changed, 92 insertions(+), 162 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 1c516e9..05ec449 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -75,7 +75,7 @@ patchRefresh() {
###
usage() {
printf "Usage: $0 [refresh] [ --help | -h | -s | -n | -p | -c ] <subsystem1 subsystem2 ..>\n
- Where subsystems are: wlan, bluetooth, ethernet and drm.\n"
+ Where subsystems are: network and drm.\n"

printf "\n"
printf "${GREEN}%10s${NORMAL} - Update all your patch offsets using quilt\n" "refresh"
@@ -199,10 +199,8 @@ copyDirectories() {
# can not be applied correctly after a code update in $GIT_URL.

# These switches determines which drivers to fetch in.
-ENABLE_WLAN=
-ENABLE_ETH=
+ENABLE_NETWORK=
ENABLE_DRM=
-ENABLE_BT=

EXTRA_PATCHES="patches"
REFRESH="n"
@@ -247,16 +245,8 @@ if [ $# -ge 1 ]; then
REFRESH="y"
shift
;;
- "wlan")
- ENABLE_WLAN=1
- shift
- ;;
- "bluetooth")
- ENABLE_BT=1
- shift
- ;;
- "ethernet")
- ENABLE_ETH=1
+ "net")
+ ENABLE_NETWORK=1
shift
;;
"drm")
@@ -323,26 +313,26 @@ INCLUDE_NET_BT="hci_core.h
smp.h
a2mp.h"

-# Bluetooth related directories
-NET_BT_DIRS="bluetooth
- bluetooth/bnep
- bluetooth/cmtp
- bluetooth/rfcomm
- bluetooth/hidp"
-
# Required headers from include/linux
-INCLUDE_LINUX="ieee80211.h
- nl80211.h
- pci_ids.h
- eeprom_93cx6.h
- ath9k_platform.h
- wl12xx.h
- rndis.h"
+INCLUDE_LINUX_WLAN="ieee80211.h
+ nl80211.h
+ eeprom_93cx6.h
+ ath9k_platform.h
+ wl12xx.h
+ rndis.h"

# For rndis_wext
-INCLUDE_LINUX_USB="usbnet.h rndis_host.h"
+INCLUDE_LINUX_USB_WLAN="usbnet.h
+ rndis_host.h"

-INCLUDE_LINUX_SPI="libertas_spi.h"
+# For rndis_wlan, we need a new rndis_host.ko, cdc_ether.ko and usbnet.ko
+RNDIS_REQUIREMENTS="Makefile
+ rndis_host.c
+ cdc_ether.c
+ usbnet.c"
+
+# For libertas
+INCLUDE_LINUX_LIBERTAS_WLAN="libertas_spi.h"

# 802.11 related headers
INCLUDE_NET="cfg80211.h
@@ -352,7 +342,17 @@ INCLUDE_NET="cfg80211.h
mac80211.h
regulatory.h"

-NET_DIRS="wireless mac80211 rfkill"
+# Core 802.11 and rfkill code
+NET_WLAN_DIRS="net/wireless
+ net/mac80211
+ net/rfkill"
+
+# Bluetooth related directories
+NET_BT_DIRS="net/bluetooth
+ net/bluetooth/bnep
+ net/bluetooth/cmtp
+ net/bluetooth/rfcomm
+ net/bluetooth/hidp"

# WLAN drivers that have their own directory
DRIVERS_WLAN="drivers/bcma
@@ -433,97 +433,58 @@ mkdir -p \
include/trace \
include/pcmcia \
include/crypto \
- net/mac80211/ \
- net/wireless/ \
- net/rfkill/ \
- drivers/ssb/ \
- drivers/bcma/ \
- drivers/net/usb/ \
- drivers/net/wireless/ \
- drivers/net/ethernet/atheros \
- drivers/net/ethernet/broadcom
-
-# include/linux
-DIR="include/linux"
-for i in $INCLUDE_LINUX; do
- echo "Copying $GIT_TREE/$DIR/$i"
- cp "$GIT_TREE/$DIR/$i" $DIR/
-done
-
-cp -a $GIT_TREE/include/linux/ssb include/linux/
-cp -a $GIT_TREE/include/linux/bcma include/linux/
-cp -a $GIT_TREE/include/linux/rfkill.h include/linux/rfkill_backport.h
-
-# include/net
-DIR="include/net"
-for i in $INCLUDE_NET; do
- echo "Copying $GIT_TREE/$DIR/$i"
- cp "$GIT_TREE/$DIR/$i" $DIR/
-done
-
-DIR="include/net/bluetooth"
-for i in $INCLUDE_NET_BT; do
- echo "Copying $GIT_TREE/$DIR/$i"
- cp $GIT_TREE/$DIR/$i $DIR/
-done
-
-DIR="include/linux/usb"
-for i in $INCLUDE_LINUX_USB; do
- echo "Copying $GIT_TREE/$DIR/$i"
- cp $GIT_TREE/$DIR/$i $DIR/
-done
-
-DIR="include/linux/spi"
-for i in $INCLUDE_LINUX_SPI; do
- echo "Copying $GIT_TREE/$DIR/$i"
- cp $GIT_TREE/$DIR/$i $DIR/
-done
-
-# net/wireless and net/mac80211
-for i in $NET_DIRS; do
- echo "Copying $GIT_TREE/net/$i/*.[ch]"
- cp $GIT_TREE/net/$i/*.[ch] net/$i/
- cp $GIT_TREE/net/$i/Makefile net/$i/
- cp $GIT_TREE/net/$i/Kconfig net/$i/
-done
-
-cp $GIT_TREE/MAINTAINERS ./
-
-# Copy files needed for statically compiled regulatory rules database
-cp $GIT_TREE/net/wireless/db.txt net/wireless/
-cp $GIT_TREE/net/wireless/genregdb.awk net/wireless/
-
-# net/bluetooth
-for i in $NET_BT_DIRS; do
- mkdir -p net/$i
- echo "Copying $GIT_TREE/net/$i/*.[ch]"
- cp $GIT_TREE/net/$i/*.[ch] net/$i/
- cp $GIT_TREE/net/$i/Makefile net/$i/
-done
-
-# Drivers in their own directory
-for i in $DRIVERS; do
- mkdir -p $i
-
- # -print -quit will just print once, so we don't burden
- # this script with searching for further files if one is
- # found
- FILES_FOUND=$(find $GIT_TREE/$i/ -maxdepth 1 -type f -name \*.[ch] -print -quit | wc -l)
- if [ $FILES_FOUND -eq 1 ]; then
- echo "Copying $GIT_TREE/$i/*.[ch]"
- cp $GIT_TREE/$i/*.[ch] $i/
- fi
- if [ -f $GIT_TREE/$i/Makefile ]; then
- cp $GIT_TREE/$i/Makefile $i/
- fi
- if [ -f $GIT_TREE/$i/Kconfig ]; then
- cp $GIT_TREE/$i/Kconfig $i/
- fi
-done
+ drivers/bcma \
+ drivers/misc/eeprom \
+ drivers/net/usb \
+ drivers/net/ethernet/broadcom \
+ drivers/ssb \
+ drivers/staging \
+ $NET_WLAN_DIRS \
+ $NET_BT_DIRS \
+ $DRIVERS_WLAN \
+ $DRIVERS_ETH \
+ $DRIVERS_BT
+
+# Copy pci_ids.h for every situation
+cp $GIT_TREE/include/linux/pci_ids.h include/linux
+
+if [[ -n "$ENABLE_NETWORK" ]]; then
+ # WLAN and bluetooth files
+ copyFiles "$INCLUDE_LINUX_WLAN" "include/linux"
+ copyFiles "$INCLUDE_NET" "include/net"
+ copyFiles "$INCLUDE_NET_BT" "include/net/bluetooth"
+ copyFiles "$INCLUDE_LINUX_USB_WLAN" "include/linux/usb"
+ copyFiles "$INCLUDE_LINUX_LIBERTAS_WLAN" "include/linux/spi"
+ copyFiles "$DRIVERS_WLAN_FILES" "drivers/net/wireless"
+ copyFiles "$RNDIS_REQUIREMENTS" "drivers/net/usb"
+
+ copyDirectories "$NET_WLAN_DIRS"
+ copyDirectories "$NET_BT_DIRS"
+ copyDirectories "$DRIVERS_BT"
+ copyDirectories "$DRIVERS_WLAN"
+ copyDirectories "$DRIVERS_ETH"
+
+ cp -a $GIT_TREE/include/linux/ssb include/linux/
+ cp -a $GIT_TREE/include/linux/bcma include/linux/
+ cp -a $GIT_TREE/include/linux/rfkill.h include/linux/rfkill_backport.h
+
+ # Misc
+ cp $GIT_TREE/drivers/misc/eeprom/{Makefile,eeprom_93cx6.c} drivers/misc/eeprom/
+
+ # Copy files needed for statically compiled regulatory rules database
+ cp $GIT_TREE/net/wireless/{db.txt,genregdb.awk} net/wireless/
+
+ # Top level wireless driver Makefile
+ cp $GIT_TREE/drivers/net/wireless/Makefile drivers/net/wireless
+
+ # Broadcom case
+ DIR="drivers/net/ethernet/broadcom"
+ cp $GIT_TREE/$DIR/b44.[ch] drivers/net/ethernet/broadcom
+ # Not yet
+ echo "obj-\$(CONFIG_B44) += b44.o" > drivers/net/ethernet/broadcom/Makefile
+fi

# Staging drivers in their own directory
-rm -rf drivers/staging/
-mkdir -p drivers/staging/
for i in $STAGING_DRIVERS; do
if [ ! -d $GIT_TREE/$i ]; then
continue
@@ -534,59 +495,28 @@ for i in $STAGING_DRIVERS; do
cp -a $GIT_TREE/$i drivers/staging/
done

-for i in $DRIVERS_BT; do
- mkdir -p $i
- echo "Copying $GIT_TREE/$i/*.[ch]"
- cp $GIT_TREE/$i/*.[ch] $i/
- cp $GIT_TREE/$i/Makefile $i/
-done
-
-# For rndis_wlan, we need a new rndis_host.ko, cdc_ether.ko and usbnet.ko
-RNDIS_REQS="Makefile rndis_host.c cdc_ether.c usbnet.c"
-DIR="drivers/net/usb"
-for i in $RNDIS_REQS; do
- echo "Copying $GIT_TREE/$DIR/$i"
- cp $GIT_TREE/$DIR/$i $DIR/
-done
-
-DIR="drivers/net/ethernet/broadcom"
-echo > $DIR/Makefile
-cp $GIT_TREE/$DIR/b44.[ch] $DIR
-# Not yet
-echo "obj-\$(CONFIG_B44) += b44.o" >> $DIR/Makefile
-
-# Misc
-mkdir -p drivers/misc/eeprom/
-cp $GIT_TREE/drivers/misc/eeprom/eeprom_93cx6.c drivers/misc/eeprom/
-cp $GIT_TREE/drivers/misc/eeprom/Makefile drivers/misc/eeprom/
-
-DIR="drivers/net/wireless"
-# Drivers part of the wireless directory
-for i in $DRIVERS_WLAN_FILES; do
- cp $GIT_TREE/$DIR/$i $DIR/
-done
-
-# Top level wireless driver Makefile
-cp $GIT_TREE/$DIR/Makefile $DIR
+###########################
+# Suck in compat.git tree #
+###########################

-# Compat stuff
COMPAT="compat"
mkdir -p $COMPAT
echo "Copying $GIT_COMPAT_TREE/ files..."
-cp $GIT_COMPAT_TREE/compat/*.[ch] $COMPAT/
-cp $GIT_COMPAT_TREE/compat/Makefile $COMPAT/
cp -a $GIT_COMPAT_TREE/udev .
cp -a $GIT_COMPAT_TREE/scripts $COMPAT/
cp $GIT_COMPAT_TREE/bin/ckmake $COMPAT/
-cp -a $GIT_COMPAT_TREE/include/linux/* include/linux/
-cp -a $GIT_COMPAT_TREE/include/net/* include/net/
-cp -a $GIT_COMPAT_TREE/include/trace/* include/trace/
-cp -a $GIT_COMPAT_TREE/include/pcmcia/* include/pcmcia/
-cp -a $GIT_COMPAT_TREE/include/crypto/* include/crypto/
+cp $GIT_COMPAT_TREE/compat/{Makefile,*.[ch]} $COMPAT/
+DIRS="linux net trace crypto pcmcia"
+for dir in $DIRS; do
+ cp -a $GIT_COMPAT_TREE/include/$dir/* include/$dir/
+done

# Clean up possible *.mod.c leftovers
find -type f -name "*.mod.c" -exec rm -f {} \;

+# Finally copy MAINTAINERS file
+cp $GIT_TREE/MAINTAINERS ./
+
# files we suck in for wireless drivers
export WSTABLE="
net/wireless/
--
1.7.11.2


2012-08-09 18:01:54

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 04/13] compat-wireless: Add ability to enable/disable subsystems

Pass wlan,bluetooth,ethernet or drm to the end of the cmdline
to fetch the relevant drivers into the tree.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 94 ++++++++++++++++++++++++++++++++-----------------
1 file changed, 61 insertions(+), 33 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 6d7ca54..aa7cbd6 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -74,8 +74,10 @@ patchRefresh() {
# usage() function
###
usage() {
- printf "Usage: $0 [refresh] [ --help | -h | -s | -n | -p | -c ]\n"
+ printf "Usage: $0 [refresh] [ --help | -h | -s | -n | -p | -c ] <subsystem1 subsystem2 ..>\n
+ Where subsystems are: wlan, bluetooth, ethernet and drm.\n"

+ printf "\n"
printf "${GREEN}%10s${NORMAL} - Update all your patch offsets using quilt\n" "refresh"
printf "${GREEN}%10s${NORMAL} - Get and apply pending-stable/ fixes purging old files there\n" "-s"
printf "${GREEN}%10s${NORMAL} - Apply the patches from linux-next-cherry-picks directory\n" "-n"
@@ -178,12 +180,20 @@ nagometer() {
# uses quilt to refresh the patches. This is useful if patches
# can not be applied correctly after a code update in $GIT_URL.

+# These switches determines which drivers to fetch in.
+ENABLE_WLAN=
+ENABLE_ETH=
+ENABLE_DRM=
+ENABLE_BT=
+
EXTRA_PATCHES="patches"
REFRESH="n"
GET_STABLE_PENDING="n"
POSTFIX_RELEASE_TAG=""
+
+# Parse command line arguments
if [ $# -ge 1 ]; then
- if [ $# -gt 4 ]; then
+ if [ $# -gt 8 ]; then
usage $0
exit
fi
@@ -192,38 +202,56 @@ if [ $# -ge 1 ]; then
exit
fi
while [ $# -ne 0 ]; do
- if [[ "$1" = "-s" ]]; then
- GET_STABLE_PENDING="y"
- EXTRA_PATCHES="${EXTRA_PATCHES} pending-stable"
- EXTRA_PATCHES="${EXTRA_PATCHES} pending-stable/backports/"
- POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}s"
- shift; continue;
- fi
- if [[ "$1" = "-n" ]]; then
- EXTRA_PATCHES="${EXTRA_PATCHES} linux-next-cherry-picks"
- POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}n"
- shift; continue;
- fi
- if [[ "$1" = "-p" ]]; then
- EXTRA_PATCHES="${EXTRA_PATCHES} linux-next-pending"
- POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}p"
- shift; continue;
- fi
- if [[ "$1" = "-c" ]]; then
- EXTRA_PATCHES="${EXTRA_PATCHES} crap"
- POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}c"
- shift; continue;
- fi
- if [[ "$1" = "refresh" ]]; then
- REFRESH="y"
- shift; continue;
- fi
-
- echo "Unexpected argument passed: $1"
- usage $0
- exit
+ case $1 in
+ "-s")
+ GET_STABLE_PENDING="y"
+ EXTRA_PATCHES="${EXTRA_PATCHES} pending-stable"
+ EXTRA_PATCHES="${EXTRA_PATCHES} pending-stable/backports/"
+ POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}s"
+ shift
+ ;;
+ "-n")
+ EXTRA_PATCHES="${EXTRA_PATCHES} linux-next-cherry-picks"
+ POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}n"
+ shift
+ ;;
+ "-p")
+ EXTRA_PATCHES="${EXTRA_PATCHES} linux-next-pending"
+ POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}p"
+ shift
+ ;;
+ "-c")
+ EXTRA_PATCHES="${EXTRA_PATCHES} crap"
+ POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}c"
+ shift
+ ;;
+ "refresh")
+ REFRESH="y"
+ shift
+ ;;
+ "wlan")
+ ENABLE_WLAN=1
+ shift
+ ;;
+ "bluetooth")
+ ENABLE_BT=1
+ shift
+ ;;
+ "ethernet")
+ ENABLE_ETH=1
+ shift
+ ;;
+ "drm")
+ ENABLE_DRM=1
+ shift
+ ;;
+ *)
+ echo "Unexpected argument passed: $1"
+ usage $0
+ exit
+ ;;
+ esac
done
-
fi

# User exported this variable
--
1.7.11.2


2012-08-09 18:02:32

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 10/13] compat-wireless: Selectively apply patches

Patches are now structured in network/ and drm/ subfolders.
Apply them only if the relevant subsystem is enabled.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 49 +++++++++++++++++++++++++++++++------------------
1 file changed, 31 insertions(+), 18 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index b5dbc4e..e701406 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -143,7 +143,7 @@ nagometer() {

let CHANGES=$ADD+$DEL

- case $1 in
+ case `dirname $1` in
"patches")
brag_backport $ORIG_CODE $CHANGES $ADD $DEL
;;
@@ -201,6 +201,7 @@ copyDirectories() {
# These switches determines which drivers to fetch in.
ENABLE_NETWORK=
ENABLE_DRM=
+SUBSYSTEMS=

EXTRA_PATCHES="patches"
REFRESH="n"
@@ -262,6 +263,15 @@ if [ $# -ge 1 ]; then
done
fi

+# SUBSYSTEMS is used to select which patches to apply
+if [[ -n "$ENABLE_NETWORK" ]]; then
+ SUBSYSTEMS="network"
+fi
+
+if [[ -n "$ENABLE_DRM" ]]; then
+ SUBSYSTEMS+=" drm"
+fi
+
# User exported this variable
if [ -z $GIT_TREE ]; then
GIT_TREE="$HOME/linux-next"
@@ -604,25 +614,28 @@ for dir in $EXTRA_PATCHES; do
LAST_ELEM=$dir
done

-for dir in $EXTRA_PATCHES; do
- if [[ ! -d $dir ]]; then
- echo -e "${RED}Patches: $dir empty, skipping...${NORMAL}\n"
- continue
- fi
- if [[ $LAST_ELEM = $dir && "$REFRESH" = y ]]; then
- patchRefresh $dir
- fi
-
- for i in $(ls -v $dir/*.patch &> /dev/null); do
- echo -e "${GREEN}Applying backport patch${NORMAL}: ${BLUE}$i${NORMAL}"
- patch -p1 -N -t < $i
- RET=$?
- if [[ $RET -ne 0 ]]; then
- echo -e "${RED}Patching $i failed${NORMAL}, update it"
- exit $RET
+for subsystem in $SUBSYSTEMS; do
+ for dir in $EXTRA_PATCHES; do
+ PATCHDIR="$dir/$subsystem"
+ if [[ ! -d $PATCHDIR ]]; then
+ echo -e "${RED}Patches: $PATCHDIR empty, skipping...${NORMAL}\n"
+ continue
+ fi
+ if [[ $LAST_ELEM = $dir && "$REFRESH" = y ]]; then
+ patchRefresh $dir
fi
+
+ for i in $(ls -v $PATCHDIR/*.patch 2> /dev/null); do
+ echo -e "${GREEN}Applying backport patch${NORMAL}: ${BLUE}$i${NORMAL}"
+ patch -p1 -N -t < $i
+ RET=$?
+ if [[ $RET -ne 0 ]]; then
+ echo -e "${RED}Patching $i failed${NORMAL}, update it"
+ exit $RET
+ fi
+ done
+ nagometer $PATCHDIR $ORIG_CODE >> $CODE_METRICS
done
- nagometer $dir $ORIG_CODE >> $CODE_METRICS
done

DIR="$PWD"
--
1.7.11.2


2012-08-09 18:29:09

by Sedat Dilek

[permalink] [raw]
Subject: Re: [PATCH 00/13] Merge GSoC DRM changes to admin-update.sh

On Thu, Aug 9, 2012 at 8:01 PM, Ozan Çağlayan <[email protected]> wrote:
> Hi,
>
> The patches below modifies the admin-update.sh script so that it
> accepts a variable-length last argument, namely network or/and drm,
> to selectively fetch specific subsystem codes into the tree.
>
> The last 2 patches constitutes the work done so far for the my
> GSoC project.
>
> This first attempt is mostly for getting some comments. For example,
> eventhough you fetch network and drm drivers, make will just build
> network drivers. I will either port the project to kconfig which
> will dynamically configure and build what's available or hack
> config.mk and Makefile to detect the availability of other drivers
> than the wireless ones.
>
> I thank Luis R. Rodriguez, my mentor, for his helpful and highly
> responsive mentorship :)
>
> Ozan Çağlayan (13):
> compat-wireless: Clean up *.mod.c once after everything
> compat-wireless: Isolate drivers into different groups
> compat-wireless: List everything vertically without concatenating
> compat-wireless: Add ability to enable/disable subsystems
> compat-wireless: Add 2 convenience functions
> compat-wireless: Conditionally build network drivers
> compat-wireless: Put network patches into its directory
> compat-wireless: No need to search for patches
> compat-wireless: Fix cmdline parameter's name
> compat-wireless: Selectively apply patches
> compat-wireless: Move refresh logic into the loop
> compat-wireless: Fetch in DRM drivers
> compat-wireless: Add DRM patches
>

Am I the only one missing 07/13 in series?
On [1] I do not see, too.

- "Birinci" Sedat -

[1] http://marc.info/?l=linux-wireless&r=1&b=201208&w=2

- Sedat -

2012-08-10 11:42:48

by Ozan Çağlayan

[permalink] [raw]
Subject: Re: [PATCH 06/13] compat-wireless: Conditionally build network drivers

> Why are you adding the subsystems "wlan, bluetooth, ethernet" in a
> previous patch and now remove them? If you reverted your original plan
> to add these three subsystems and now came to the conclusion it would
> need some more work, this is no problem, but you should modify your
> first patch and add only that one network subsystem in the first patch
> and just add drm in this one.

Yep you're right. I was actually going to ask about it and then I
decided to send these patches mainly for getting comments so I didn't
take my time to merge the incremental changes.

Thanks.

2012-08-10 11:44:55

by Ozan Çağlayan

[permalink] [raw]
Subject: Re: [PATCH 10/13] compat-wireless: Selectively apply patches

On Thu, Aug 9, 2012 at 10:00 PM, Hauke Mehrtens <[email protected]> wrote:

> The folder network does not exists in this patch, this will break git
> bisect. Could you add the move of the patches from patches to network in
> this commit.

Ah, Okay.

>
> I do not like the name network for the folder containing the patches,
> because it could easily be to mixed up with the net folder. What about
> patches-net as the folder name?

It is already under patches/, e.g. patches/network and patches/drm.






--
Ozan Çağlayan

2012-08-09 18:02:38

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 12/13] compat-wireless: Fetch in DRM drivers

DRM drivers can now be sucked in when 'drm' is given as the
command line parameter.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 45 +++++++++++++++++++++++++++++++++++++++++----
1 file changed, 41 insertions(+), 4 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index f0c7ad0..3cf7647 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -427,12 +427,26 @@ DRIVERS_ETH="drivers/net/ethernet/atheros
# Bluetooth drivers
DRIVERS_BT="drivers/bluetooth"

+# DRM drivers
+DRIVERS_DRM="drivers/gpu/drm/ast
+ drivers/gpu/drm/cirrus
+ drivers/gpu/drm/gma500
+ drivers/gpu/drm/i2c
+ drivers/gpu/drm/i810
+ drivers/gpu/drm/i915
+ drivers/gpu/drm/mgag200
+ drivers/gpu/drm/nouveau
+ drivers/gpu/drm/radeon
+ drivers/gpu/drm/ttm
+ drivers/gpu/drm/via
+ drivers/gpu/drm/vmwgfx"
+
+# UDL uses the new dma-buf API, let's disable this for now
+#DRIVERS="$DRIVERS drivers/gpu/drm/udl"
+
# Staging drivers if any
STAGING_DRIVERS=""

-# Select which drivers to build
-DRIVERS="$DRIVERS_WLAN $DRIVERS_ETH"
-
rm -rf drivers/

mkdir -p \
@@ -444,6 +458,7 @@ mkdir -p \
include/pcmcia \
include/crypto \
drivers/bcma \
+ drivers/platform/x86 \
drivers/misc/eeprom \
drivers/net/usb \
drivers/net/ethernet/broadcom \
@@ -453,7 +468,8 @@ mkdir -p \
$NET_BT_DIRS \
$DRIVERS_WLAN \
$DRIVERS_ETH \
- $DRIVERS_BT
+ $DRIVERS_BT \
+ $DRIVERS_DRM

# Copy pci_ids.h for every situation
cp $GIT_TREE/include/linux/pci_ids.h include/linux
@@ -494,6 +510,27 @@ if [[ -n "$ENABLE_NETWORK" ]]; then
echo "obj-\$(CONFIG_B44) += b44.o" > drivers/net/ethernet/broadcom/Makefile
fi

+if [[ -n "$ENABLE_DRM" ]]; then
+ # DRM drivers
+ copyDirectories "$DRIVERS_DRM"
+
+ # Copy standalone drivers
+ echo "Copying $GIT_TREE/drivers/gpu/drm/*.[ch]"
+ cp $GIT_TREE/drivers/gpu/drm/{Makefile,*.[ch]} drivers/gpu/drm/
+
+ # Copy DRM headers
+ cp -a $GIT_TREE/include/drm include/
+
+ # drivers/gpu/drm/i915/intel_pm.c requires this
+ cp $GIT_TREE/drivers/platform/x86/intel_ips.h drivers/platform/x86
+
+ # Copy radeon reg_srcs for hostprogs
+ cp -a $GIT_TREE/drivers/gpu/drm/radeon/reg_srcs drivers/gpu/drm/radeon
+
+ # Finally get the DRM top-level makefile
+ cp $GIT_TREE/drivers/gpu/drm/Makefile drivers/gpu/drm
+fi
+
# Staging drivers in their own directory
for i in $STAGING_DRIVERS; do
if [ ! -d $GIT_TREE/$i ]; then
--
1.7.11.2


2012-08-09 18:02:29

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 09/13] compat-wireless: Fix cmdline parameter's name

Correct one is network not net.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 555b61b..b5dbc4e 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -245,7 +245,7 @@ if [ $# -ge 1 ]; then
REFRESH="y"
shift
;;
- "net")
+ "network")
ENABLE_NETWORK=1
shift
;;
--
1.7.11.2


2012-08-09 18:36:31

by Sedat Dilek

[permalink] [raw]
Subject: Re: [PATCH 00/13] Merge GSoC DRM changes to admin-update.sh

On Thu, Aug 9, 2012 at 8:29 PM, Sedat Dilek <[email protected]> wrote:
> On Thu, Aug 9, 2012 at 8:01 PM, Ozan Çağlayan <[email protected]> wrote:
>> Hi,
>>
>> The patches below modifies the admin-update.sh script so that it
>> accepts a variable-length last argument, namely network or/and drm,
>> to selectively fetch specific subsystem codes into the tree.
>>
>> The last 2 patches constitutes the work done so far for the my
>> GSoC project.
>>
>> This first attempt is mostly for getting some comments. For example,
>> eventhough you fetch network and drm drivers, make will just build
>> network drivers. I will either port the project to kconfig which
>> will dynamically configure and build what's available or hack
>> config.mk and Makefile to detect the availability of other drivers
>> than the wireless ones.
>>
>> I thank Luis R. Rodriguez, my mentor, for his helpful and highly
>> responsive mentorship :)
>>
>> Ozan Çağlayan (13):
>> compat-wireless: Clean up *.mod.c once after everything
>> compat-wireless: Isolate drivers into different groups
>> compat-wireless: List everything vertically without concatenating
>> compat-wireless: Add ability to enable/disable subsystems
>> compat-wireless: Add 2 convenience functions
>> compat-wireless: Conditionally build network drivers
>> compat-wireless: Put network patches into its directory
>> compat-wireless: No need to search for patches
>> compat-wireless: Fix cmdline parameter's name
>> compat-wireless: Selectively apply patches
>> compat-wireless: Move refresh logic into the loop
>> compat-wireless: Fetch in DRM drivers
>> compat-wireless: Add DRM patches
>>
>
> Am I the only one missing 07/13 in series?
> On [1] I do not see, too.
>
> - "Birinci" Sedat -
>
> [1] http://marc.info/?l=linux-wireless&r=1&b=201208&w=2
>

Looks like "compat-wireless: Put network patches into its directory"
is the missing one.

- Sedat -

2012-08-09 18:43:20

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH 00/13] Merge GSoC DRM changes to admin-update.sh

On 08/09/2012 08:36 PM, Sedat Dilek wrote:
> On Thu, Aug 9, 2012 at 8:29 PM, Sedat Dilek <[email protected]> wrote:
>> On Thu, Aug 9, 2012 at 8:01 PM, Ozan Çağlayan <[email protected]> wrote:
>>> Hi,
>>>
>>> The patches below modifies the admin-update.sh script so that it
>>> accepts a variable-length last argument, namely network or/and drm,
>>> to selectively fetch specific subsystem codes into the tree.
>>>
>>> The last 2 patches constitutes the work done so far for the my
>>> GSoC project.
>>>
>>> This first attempt is mostly for getting some comments. For example,
>>> eventhough you fetch network and drm drivers, make will just build
>>> network drivers. I will either port the project to kconfig which
>>> will dynamically configure and build what's available or hack
>>> config.mk and Makefile to detect the availability of other drivers
>>> than the wireless ones.
>>>
>>> I thank Luis R. Rodriguez, my mentor, for his helpful and highly
>>> responsive mentorship :)
>>>
>>> Ozan Çağlayan (13):
>>> compat-wireless: Clean up *.mod.c once after everything
>>> compat-wireless: Isolate drivers into different groups
>>> compat-wireless: List everything vertically without concatenating
>>> compat-wireless: Add ability to enable/disable subsystems
>>> compat-wireless: Add 2 convenience functions
>>> compat-wireless: Conditionally build network drivers
>>> compat-wireless: Put network patches into its directory
>>> compat-wireless: No need to search for patches
>>> compat-wireless: Fix cmdline parameter's name
>>> compat-wireless: Selectively apply patches
>>> compat-wireless: Move refresh logic into the loop
>>> compat-wireless: Fetch in DRM drivers
>>> compat-wireless: Add DRM patches
>>>
>>
>> Am I the only one missing 07/13 in series?
>> On [1] I do not see, too.
>>
>> - "Birinci" Sedat -
>>
>> [1] http://marc.info/?l=linux-wireless&r=1&b=201208&w=2
>>
>
> Looks like "compat-wireless: Put network patches into its directory"
> is the missing one.
>
> - Sedat -
The patch was probably too big for the mailing list. Ozan do you have a
git tree to pull from or could you put it on some web server.

Hauke


2012-08-09 18:02:24

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 08/13] compat-wireless: No need to search for patches

Don't search for patches with find. Just silent ls errors.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 05ec449..555b61b 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -613,11 +613,7 @@ for dir in $EXTRA_PATCHES; do
patchRefresh $dir
fi

- FOUND=$(find $dir/ -maxdepth 1 -name \*.patch | wc -l)
- if [ $FOUND -eq 0 ]; then
- continue
- fi
- for i in $(ls -v $dir/*.patch); do
+ for i in $(ls -v $dir/*.patch &> /dev/null); do
echo -e "${GREEN}Applying backport patch${NORMAL}: ${BLUE}$i${NORMAL}"
patch -p1 -N -t < $i
RET=$?
--
1.7.11.2


2012-08-09 18:01:56

by Ozan Çağlayan

[permalink] [raw]
Subject: [PATCH 05/13] compat-wireless: Add 2 convenience functions

Add copyFiles and copyDirectories for not repeating same
code snippets again and again.

Signed-off-by: Ozan Çağlayan <[email protected]>
---
scripts/admin-update.sh | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index aa7cbd6..1c516e9 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -165,6 +165,24 @@ nagometer() {

}

+# Copy each file in $1 into $2
+copyFiles() {
+ FILES=$1
+ TARGET=$2
+ for file in $FILES; do
+ echo "Copying $GIT_TREE/$TARGET/$file"
+ cp "$GIT_TREE/$TARGET/$file" $TARGET/
+ done
+}
+
+copyDirectories() {
+ DIRS=$1
+ for dir in $DIRS; do
+ echo "Copying $GIT_TREE/$dir/*.[ch]"
+ cp $GIT_TREE/$dir/{Kconfig,Makefile,*.[ch]} $dir/ &> /dev/null
+ done
+}
+
# First check cmdline args to understand
# which patches to apply and which release tag to set.
#
--
1.7.11.2