From: <ri...@us...> - 2007-04-11 17:57:37
|
Revision: 72 http://ipcop.svn.sourceforge.net/ipcop/?rev=72&view=rev Author: riddles Date: 2007-04-11 10:57:38 -0700 (Wed, 11 Apr 2007) Log Message: ----------- Replace amedyn with amedyn2; this will load firmware with hotplug Modified Paths: -------------- ipcop/trunk/make.sh Added Paths: ----------- ipcop/trunk/config/rootfiles/common/amedyn2 ipcop/trunk/lfs/amedyn2 ipcop/trunk/src/patches/amedyn2-2.6.20.patch Removed Paths: ------------- ipcop/trunk/config/rootfiles/arch_i486/amedyn-smp ipcop/trunk/config/rootfiles/common/amedyn ipcop/trunk/lfs/amedyn Deleted: ipcop/trunk/config/rootfiles/arch_i486/amedyn-smp =================================================================== --- ipcop/trunk/config/rootfiles/arch_i486/amedyn-smp 2007-04-11 15:11:08 UTC (rev 71) +++ ipcop/trunk/config/rootfiles/arch_i486/amedyn-smp 2007-04-11 17:57:38 UTC (rev 72) @@ -1,5 +0,0 @@ -## amedyn-2004-08-04-smp -## -#usr/sbin/amload -#usr/sbin/amioctl -#lib/modules/KVER-smp/kernel/drivers/usb/amedyn.ko Deleted: ipcop/trunk/config/rootfiles/common/amedyn =================================================================== --- ipcop/trunk/config/rootfiles/common/amedyn 2007-04-11 15:11:08 UTC (rev 71) +++ ipcop/trunk/config/rootfiles/common/amedyn 2007-04-11 17:57:38 UTC (rev 72) @@ -1,6 +0,0 @@ -## amedyn-2004-08-04 -## -#usr/bin/br2684ctl -usr/sbin/amload -usr/sbin/amioctl -#lib/modules/KVER/kernel/drivers/usb/amedyn.ko Copied: ipcop/trunk/config/rootfiles/common/amedyn2 (from rev 70, ipcop/trunk/config/rootfiles/common/amedyn) =================================================================== --- ipcop/trunk/config/rootfiles/common/amedyn2 (rev 0) +++ ipcop/trunk/config/rootfiles/common/amedyn2 2007-04-11 17:57:38 UTC (rev 72) @@ -0,0 +1,3 @@ +## amedyn2-2006-09-28 +## +#lib/modules/KVER/extra/amedyn2.ko Deleted: ipcop/trunk/lfs/amedyn =================================================================== --- ipcop/trunk/lfs/amedyn 2007-04-11 15:11:08 UTC (rev 71) +++ ipcop/trunk/lfs/amedyn 2007-04-11 17:57:38 UTC (rev 72) @@ -1,112 +0,0 @@ -############################################################################### -# This file is part of the IPCop Firewall. # -# # -# IPCop is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# IPCop is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with IPCop; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Makefiles are based on LFSMake, which is # -# Copyright (C) 2002 Rod Roard <ro...@su...> # -# # -# Modifications by: # -# ??-12-2003 Mark Wormgoor < ma...@wo...> # -# - Modified Makefile for IPCop build # -# # -# $Id$ -# # -############################################################################### - -############################################################################### -# Definitions -############################################################################### - -include Config - -PKG_NAME = amedyn -VER = 2004-08-04 -HOST_ARCH = all - -THISAPP = amedyn-$(VER) -DL_FILE = $(THISAPP)-src.tgz -DL_FROM = $(URL_SFNET)/zyxel630-11 -DIR_APP = $(DIR_SRC)/amedyn - -TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) - -############################################################################### -# Top-level Rules -############################################################################### - -objects = $(DL_FILE) - -$(DL_FILE) = $(DL_FROM)/$(DL_FILE) - -$(DL_FILE)_MD5 = 90bebc4423f7982d22e5d47ea4b7b910 - -install : $(TARGET) - -check : $(patsubst %,$(DIR_CHK)/%,$(objects)) - -download :$(patsubst %,$(DIR_DL)/%,$(objects)) - -md5 : $(subst %,%_MD5,$(objects)) - -############################################################################### -# Downloading, checking, md5sum -############################################################################### - -$(patsubst %,$(DIR_CHK)/%,$(objects)) : - @$(CHECK) - -$(patsubst %,$(DIR_DL)/%,$(objects)) : - @$(LOAD) - -$(subst %,%_MD5,$(objects)) : - @$(MD5) - -############################################################################### -# Installation Details -############################################################################### - -$(TARGET) : $(firstword $(MAKEFILE_LIST)) $(patsubst %,$(DIR_DL)/%,$(objects)) - @$(PREBUILD) - @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) - - cd $(DIR_APP) && for i in Makefile */Makefile; do \ - sed -i \ - -e 's/$$(shell uname -m)/$(MACHINE)/' \ - -e 's/$$(shell uname -r)/$(KVER)/' \ - -e 's%^.*DEST_KERNEL_MAIN =.*$$%DEST_KERNEL_MAIN = 2.6%' \ - -e 's/depmod -a//' $$i; \ - done - if [ "$(MACHINE)" = "alpha" -o "$(MACHINE)" = "ppc" ]; then \ - cd $(DIR_APP) && for i in Makefile */Makefile; do \ - sed -i -e 's/-march=$$(DEST_MACHINE)//' $$i; \ - done; \ - fi - - cd $(DIR_APP)/init && sed -i -e 's+/usr/sbin+$(CONFIG_ROOT)/firmware+' amload.c - cd $(DIR_APP) && sed -i -e 's/usr\/sbin/usr\/bin/' bridged/Makefile - cd $(DIR_APP)/firmware && sed -i -e 's+^BIN_PATH.*$$+BIN_PATH = $(CONFIG_ROOT)/firmware+' Makefile - cd $(DIR_APP) && sed -i "306s,^,//&,g" module/xdslusb_2.6.c - cd $(DIR_APP) && make AME_MODULE - - rm -f /lib/modules/$(KVER)/kernel/drivers/usb/amedyndbg.ko - cd $(DIR_APP) && sed -i -e 's/#include\ <libintl.h>//' init/amload.c - cd $(DIR_APP) && sed -i -e 's/#include\ <libintl.h>//' init/amioctl.c - cd $(DIR_APP) && sed -i -e 's/#include\ <unistd.h>/#include\ <unistd.h>\n#define gettext(a) a\n#define bindtextdomain(a,b)\n#define textdomain(a)\n/' init/amload.c - cd $(DIR_APP) && sed -i -e 's/#include\ <sys\/stat.h>/#include\ <sys\/stat.h>\n#define gettext(a) a\n#define bindtextdomain(a,b)\n#define textdomain(a)\n/' init/amioctl.c - cd $(DIR_APP) && make AME_INIT AME_FIRMWARE BRIDGED - - @rm -rf $(DIR_APP) - @$(POSTBUILD) Copied: ipcop/trunk/lfs/amedyn2 (from rev 70, ipcop/trunk/lfs/amedyn) =================================================================== --- ipcop/trunk/lfs/amedyn2 (rev 0) +++ ipcop/trunk/lfs/amedyn2 2007-04-11 17:57:38 UTC (rev 72) @@ -0,0 +1,103 @@ +############################################################################### +# This file is part of the IPCop Firewall. # +# # +# IPCop is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPCop is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPCop; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Makefiles are based on LFSMake, which is # +# Copyright (C) 2002 Rod Roard <ro...@su...> # +# # +# Modifications by: # +# ??-12-2003 Mark Wormgoor < ma...@wo...> # +# - Modified Makefile for IPCop build # +# # +# $Id$ +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +PKG_NAME = amedyn2 +VER = 2006-09-28 +HOST_ARCH = all + +THISAPP = amedyn2-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_SFNET)/zyxel630-11 +DIR_APP = $(DIR_SRC)/amedyn2 + +TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 862f7eb5ad44fa08505a2f940520e3c5 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(firstword $(MAKEFILE_LIST)) $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 < $(DIR_PATCHES)/amedyn2-2.6.20.patch + + cd $(DIR_APP) && for i in Makefile */Makefile; do \ + sed -i \ + -e 's/$$(shell uname -m)/$(MACHINE)/' \ + -e 's/$$(shell uname -r)/$(KVER)/' \ + -e 's%^.*DEST_KERNEL_MAIN =.*$$%DEST_KERNEL_MAIN = 2.6%' \ + -e 's/depmod -ae//' $$i; \ + done + if [ "$(MACHINE)" = "alpha" -o "$(MACHINE)" = "ppc" ]; then \ + cd $(DIR_APP) && for i in Makefile */Makefile; do \ + sed -i -e 's/-march=$$(DEST_MACHINE)//' $$i; \ + done; \ + fi + + cd $(DIR_APP)/module && make + cd $(DIR_APP)/module && install -m 0644 amedyn2.ko /lib/modules/$(KVER)/extra/ + + @rm -rf $(DIR_APP) + @$(POSTBUILD) Modified: ipcop/trunk/make.sh =================================================================== --- ipcop/trunk/make.sh 2007-04-11 15:11:08 UTC (rev 71) +++ ipcop/trunk/make.sh 2007-04-11 17:57:38 UTC (rev 72) @@ -1207,7 +1207,7 @@ ipcopmake unzip ipcopmake linux ipcopmake 3cp4218 - ipcopmake amedyn + ipcopmake amedyn2 #ipcopmake CnxADSL # DEBUG #ipcopmake wanpipe # DEBUG #ipcopmake fcdsl # DEBUG Added: ipcop/trunk/src/patches/amedyn2-2.6.20.patch =================================================================== --- ipcop/trunk/src/patches/amedyn2-2.6.20.patch (rev 0) +++ ipcop/trunk/src/patches/amedyn2-2.6.20.patch 2007-04-11 17:57:38 UTC (rev 72) @@ -0,0 +1,391 @@ +diff -ruN amedyn2.bak/module/amedyn2.c amedyn2/module/amedyn2.c +--- amedyn2.bak/module/amedyn2.c 2006-09-28 22:08:43.000000000 +0200 ++++ amedyn2/module/amedyn2.c 2007-02-13 21:34:30.000000000 +0100 +@@ -105,7 +105,7 @@ + + unsigned int altsetting; + +- struct work_struct status_checker; ++ struct delayed_work status_checker; + + unsigned char last_status; + +@@ -150,29 +150,6 @@ + ***************/ + + /* From userspace tool */ +-int jump_to_address(struct amedyn_instance_data *instance, unsigned int place) +-{ +- struct usb_device *dev = instance->usbatm->usb_dev; +- unsigned char buf[6]; /* buffer */ +- +- buf[0] = 0x08; // Command (= set base address) +- buf[1] = 0x04; // Length (= 4 bytes) +- // Value (base address = place) +- buf[2] = (place >> 24) & 0xff; +- buf[3] = (place >> 16) & 0xff; +- buf[4] = (place >> 8) & 0xff; +- buf[5] = place & 0xff; +- if (usb_bulk_msg (dev, usb_sndbulkpipe(dev, ENDPOINT_FIRMWARE), buf, 6, NULL, DATA_TIMEOUT)) +- return -1; +- buf[0] = 0x00; // Command (= jump?) +- buf[1] = 0x01; // Length (= 1 byte) +- buf[2] = 0x14; // Value (= jump to base address) +- if (usb_bulk_msg (dev, usb_sndbulkpipe(dev, ENDPOINT_FIRMWARE), buf, 3, NULL, DATA_TIMEOUT)) +- return -1; +- return 0; +-} +- +-/* From userspace tool */ + /* format a message */ + void format_message(int cmd, int ldata, int address, char *bufin) + { +@@ -225,6 +202,18 @@ + char value; /* returned byte */ + int i; + ++ /* ++ The old function jump_to_address was never use with a address other ++ than 0x00000000. ++ The Windows driver use two transfers. One to set the base address and ++ other to send the jump to base address command, but it can be send as a ++ single transfer. Probably it can be send with the firmware too, as the ++ speedtch.c driver do. ++ */ ++ ++ char jump_to_address_0x00000000[9] = ++ {0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x14} ; ++ + usb_dbg(usbatm, "%s entered\n", __func__); + + if (!(buffer = (unsigned char *)__get_free_page(GFP_KERNEL))) { +@@ -260,7 +249,8 @@ + + dbg("amedyn_upload_firmware: Init load"); + +- if (jump_to_address(instance, 0x00000000)) ++ if (usb_bulk_msg (usb_dev, usb_sndbulkpipe(usb_dev, ENDPOINT_FIRMWARE), ++ jump_to_address_0x00000000, 9, NULL, DATA_TIMEOUT)) + goto out_free; + + /* read something needed */ +@@ -292,10 +282,11 @@ + + dbg("amedyn_upload_firmware: Firmware load"); + +- if (jump_to_address(instance, 0x00000000)) ++ if (usb_bulk_msg (usb_dev, usb_sndbulkpipe(usb_dev, ENDPOINT_FIRMWARE), ++ jump_to_address_0x00000000, 9, NULL, DATA_TIMEOUT)) + goto out_free; + +- msleep(2000); ++ msleep(10000); + + dbg("PostInit..."); + +@@ -510,8 +501,12 @@ + return 0; + } + +-static void amedyn_check_status(struct amedyn_instance_data *instance) ++static void amedyn_check_status(struct work_struct *work) + { ++ ++ struct amedyn_instance_data *instance = ++ container_of(work, struct amedyn_instance_data, ++ status_checker.work); + struct usbatm_data *usbatm = instance->usbatm; + struct atm_dev *atm_dev = usbatm->atm_dev; + unsigned char *buf = instance->scratch_buffer; +@@ -540,6 +535,7 @@ + dbg("Line sync lost?"); + amedyn_line_down_signal (instance); + amedyn_start_synchro(instance); ++ return; + } + + if ( buf[0] == 0x40 ) { +@@ -550,6 +546,7 @@ + atm_warn(usbatm, "Line sync faild with code: %02x\n", buf[1]); + amedyn_line_down_signal (instance); + amedyn_start_synchro(instance); ++ return; + } + + // if ( buf[0] == 0x01 ) +@@ -595,6 +592,7 @@ + break; + } + instance->last_status = status; ++ return; + } + } + +@@ -602,7 +600,7 @@ + { + struct amedyn_instance_data *instance = (void *)data; + +- schedule_work(&instance->status_checker); ++ schedule_delayed_work(&instance->status_checker, 0); + + /* The following check is racy, but the race is harmless */ + if (instance->poll_delay < MAX_POLL_DELAY) +@@ -725,7 +723,7 @@ + } + } + +- instance = kmalloc(sizeof(*instance), GFP_KERNEL); ++ instance = kzalloc(sizeof(*instance), GFP_KERNEL); + + if (!instance) { + usb_err(usbatm, "%s: no memory for instance data!\n", __func__); +@@ -733,8 +731,6 @@ + goto fail_release; + } + +- memset(instance, 0, sizeof(struct amedyn_instance_data)); +- + instance->usbatm = usbatm; + + /* altsetting and enable_isoc may change at any moment, so take a snapshot */ +@@ -785,7 +781,7 @@ + + usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0); + +- INIT_WORK(&instance->status_checker, (void *)amedyn_check_status, instance); ++ INIT_DELAYED_WORK(&instance->status_checker, amedyn_check_status); + + instance->status_checker.timer.function = amedyn_status_poll; + instance->status_checker.timer.data = (unsigned long)instance; +diff -ruN amedyn2.bak/module/usbatm.c amedyn2/module/usbatm.c +--- amedyn2.bak/module/usbatm.c 2006-03-11 13:36:32.000000000 +0100 ++++ amedyn2/module/usbatm.c 2006-11-18 15:54:47.000000000 +0100 +@@ -99,11 +99,11 @@ + + #define UDSL_MAX_RCV_URBS 16 + #define UDSL_MAX_SND_URBS 16 +-#define UDSL_MAX_BUF_SIZE 64 * 1024 /* bytes */ ++#define UDSL_MAX_BUF_SIZE 65536 + #define UDSL_DEFAULT_RCV_URBS 4 + #define UDSL_DEFAULT_SND_URBS 4 +-#define UDSL_DEFAULT_RCV_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */ +-#define UDSL_DEFAULT_SND_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */ ++#define UDSL_DEFAULT_RCV_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */ ++#define UDSL_DEFAULT_SND_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */ + + #define ATM_CELL_HEADER (ATM_CELL_SIZE - ATM_CELL_PAYLOAD) + +@@ -135,7 +135,7 @@ + module_param(snd_buf_bytes, uint, S_IRUGO); + MODULE_PARM_DESC(snd_buf_bytes, + "Size of the buffers used for transmission, in bytes (range: 1-" +- __MODULE_STRING(UDSL_MAX_SND_BUF_SIZE) ", default: " ++ __MODULE_STRING(UDSL_MAX_BUF_SIZE) ", default: " + __MODULE_STRING(UDSL_DEFAULT_SND_BUF_SIZE) ")"); + + +@@ -231,7 +231,7 @@ + ** urbs ** + ************/ + +-static inline struct urb *usbatm_pop_urb(struct usbatm_channel *channel) ++static struct urb *usbatm_pop_urb(struct usbatm_channel *channel) + { + struct urb *urb; + +@@ -248,7 +248,7 @@ + return urb; + } + +-static inline int usbatm_submit_urb(struct urb *urb) ++static int usbatm_submit_urb(struct urb *urb) + { + struct usbatm_channel *channel = urb->context; + int ret; +@@ -895,7 +895,7 @@ + return -EINVAL; + } + +- down(&instance->serialize); /* vs self, usbatm_atm_close, usbatm_usb_disconnect */ ++ mutex_lock(&instance->serialize); /* vs self, usbatm_atm_close, usbatm_usb_disconnect */ + + if (instance->disconnected) { + atm_dbg(instance, "%s: disconnected!\n", __func__); +@@ -909,7 +909,7 @@ + goto fail; + } + +- if (!(new = kmalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) { ++ if (!(new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) { + atm_err(instance, "%s: no memory for vcc_data!\n", __func__); + ret = -ENOMEM; + goto fail; +@@ -939,7 +939,7 @@ + set_bit(ATM_VF_PARTIAL, &vcc->flags); + set_bit(ATM_VF_READY, &vcc->flags); + +- up(&instance->serialize); ++ mutex_unlock(&instance->serialize); + + atm_dbg(instance, "%s: allocated vcc data 0x%p\n", __func__, new); + +@@ -947,7 +947,7 @@ + + fail: + kfree(new); +- up(&instance->serialize); ++ mutex_unlock(&instance->serialize); + return ret; + } + +@@ -968,7 +968,7 @@ + + usbatm_cancel_send(instance, vcc); + +- down(&instance->serialize); /* vs self, usbatm_atm_open, usbatm_usb_disconnect */ ++ mutex_lock(&instance->serialize); /* vs self, usbatm_atm_open, usbatm_usb_disconnect */ + + tasklet_disable(&instance->rx_channel.tasklet); + if (instance->cached_vcc == vcc_data) { +@@ -991,7 +991,7 @@ + clear_bit(ATM_VF_PARTIAL, &vcc->flags); + clear_bit(ATM_VF_ADDR, &vcc->flags); + +- up(&instance->serialize); ++ mutex_unlock(&instance->serialize); + + atm_dbg(instance, "%s successful\n", __func__); + } +@@ -1073,6 +1073,7 @@ + + daemonize(instance->driver->driver_name); + allow_signal(SIGTERM); ++ instance->thread_pid = get_current()->pid; + + complete(&instance->thread_started); + +@@ -1081,9 +1082,9 @@ + if (!ret) + ret = usbatm_atm_init(instance); + +- down(&instance->serialize); ++ mutex_lock(&instance->serialize); + instance->thread_pid = -1; +- up(&instance->serialize); ++ mutex_unlock(&instance->serialize); + + complete_and_exit(&instance->thread_exited, ret); + } +@@ -1097,10 +1098,6 @@ + return ret; + } + +- down(&instance->serialize); +- instance->thread_pid = ret; +- up(&instance->serialize); +- + wait_for_completion(&instance->thread_started); + + return 0; +@@ -1111,7 +1108,7 @@ + tasklet_schedule((struct tasklet_struct *) data); + } + +-static inline void usbatm_init_channel(struct usbatm_channel *channel) ++static void usbatm_init_channel(struct usbatm_channel *channel) + { + spin_lock_init(&channel->lock); + INIT_LIST_HEAD(&channel->list); +@@ -1138,7 +1135,7 @@ + intf->altsetting->desc.bInterfaceNumber); + + /* instance init */ +- instance = kmalloc(sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs), GFP_KERNEL); ++ instance = kzalloc(sizeof(*instance) + sizeof(struct urb *) * (num_rcv_urbs + num_snd_urbs), GFP_KERNEL); + if (!instance) { + dev_err(dev, "%s: no memory for instance data!\n", __func__); + return -ENOMEM; +@@ -1182,7 +1179,7 @@ + /* private fields */ + + kref_init(&instance->refcount); /* dropped in usbatm_usb_disconnect */ +- init_MUTEX(&instance->serialize); ++ mutex_init(&instance->serialize); + + instance->thread_pid = -1; + init_completion(&instance->thread_started); +@@ -1258,7 +1255,7 @@ + instance->urbs[i] = urb; + + /* zero the tx padding to avoid leaking information */ +- buffer = kmalloc(channel->buf_size, GFP_KERNEL); ++ buffer = kzalloc(channel->buf_size, GFP_KERNEL); + if (!buffer) { + dev_err(dev, "%s: no memory for buffer %d!\n", __func__, i); + error = -ENOMEM; +@@ -1345,18 +1342,18 @@ + + usb_set_intfdata(intf, NULL); + +- down(&instance->serialize); ++ mutex_lock(&instance->serialize); + instance->disconnected = 1; + if (instance->thread_pid >= 0) + kill_proc(instance->thread_pid, SIGTERM, 1); +- up(&instance->serialize); ++ mutex_unlock(&instance->serialize); + + wait_for_completion(&instance->thread_exited); + +- down(&instance->serialize); ++ mutex_lock(&instance->serialize); + list_for_each_entry(vcc_data, &instance->vcc_list, list) + vcc_release_async(vcc_data->vcc, -EPIPE); +- up(&instance->serialize); ++ mutex_unlock(&instance->serialize); + + tasklet_disable(&instance->rx_channel.tasklet); + tasklet_disable(&instance->tx_channel.tasklet); +@@ -1407,10 +1404,7 @@ + { + dbg("%s: driver version %s", __func__, DRIVER_VERSION); + +- if (sizeof(struct usbatm_control) > sizeof(((struct sk_buff *) 0)->cb)) { +- printk(KERN_ERR "%s unusable with this kernel!\n", usbatm_driver_name); +- return -EIO; +- } ++ BUILD_BUG_ON(sizeof(struct usbatm_control) > sizeof(((struct sk_buff *) 0)->cb)); + + if ((num_rcv_urbs > UDSL_MAX_RCV_URBS) + || (num_snd_urbs > UDSL_MAX_SND_URBS) +diff -ruN amedyn2.bak/module/usbatm.h amedyn2/module/usbatm.h +--- amedyn2.bak/module/usbatm.h 2006-03-11 13:36:49.000000000 +0100 ++++ amedyn2/module/usbatm.h 2006-11-18 13:45:28.000000000 +0100 +@@ -34,6 +34,7 @@ + #include <linux/list.h> + #include <linux/stringify.h> + #include <linux/usb.h> ++#include <linux/mutex.h> + + /* + #define VERBOSE_DEBUG +@@ -171,7 +172,7 @@ + ********************************/ + + struct kref refcount; +- struct semaphore serialize; ++ struct mutex serialize; + int disconnected; + + /* heavy init */ +diff -ruN amedyn2.bak/module/xusbatm.c amedyn2/module/xusbatm.c +--- amedyn2.bak/module/xusbatm.c 2006-03-11 13:13:31.000000000 +0100 ++++ amedyn2/module/xusbatm.c 2006-11-18 13:22:44.000000000 +0100 +@@ -20,7 +20,6 @@ + ******************************************************************************/ + + #include <linux/module.h> +-#include <linux/netdevice.h> /* FIXME: required by linux/etherdevice.h */ + #include <linux/etherdevice.h> /* for random_ether_addr() */ + + #include "usbatm.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |