SMC SMCWUSB-N3 [Solucionado]

Buenas tardes. Me dirijo a ustedes con un problema un tanto absurdo, pero que no se me ocurre solucion.

Yo tengo un equipo de sobremesa con debian squeeze(con gnome) y windows 7, conectado a internet mediante el adaptador SMC SMCWUSB-N3 (usb). En windows funciona sin problema, pero en debian no. El controlador esta disponible en la pagina web del fabricante, encontrarlo no es problema. Lo absurdo del asunto, es que como no tengo internet, no puedo descargarmelo. Como los usbs no me los monta, tengo que descargarmelo en windows (tengo dual boot), y cargar la particion ntfs. Una vez abierta la carpeta, tengo varios archivos, entre ellos un Makefile, por lo que supongo que habra que compilarlo con un make install. Nunca he compilado un programa/driver, y no se que debo hacer exactamente. Como no tengo internet, no puedo descargarme build-essentials. Como supongo que el paquete (build essentials) en cuestion tendra dependencias, lo ideal seria instalar mediante apt-get el build essentials en otro ordenador, y copiar los archivos que se baje, pero como hago eso? O bueno, o me pueden proponer otro metodo. Gracias de antemano por su compresion y por tomarse el tiempo de leerme. Un saludo a todos, soy nuevo en el foro.

No sé si esta será la mejor manera de hacerlo pero es una manera.

En estos momentos debería estar en condiciones de instalar paquetes desde la iso que descargó.

ok, muchisimas gracias por responder. Eso deberia solucionarme el asunto de instalar el build-essentials, pero que hago exactamente para compilar e instalar el driver?

Lo mejor es leer el README, seguramente vendrán instrucciones precisas de cómo hacerlo.

Ok, gracias por el consejo. Ya he instalado el build-essential, muchas gracias.

Bien, pongo aqui el readme y el makefile, porque los he leido, y a pesar de entender bien el ingles, el que escribio el readme asumio que no era un completo inutil en linux, en lo que, por desgracia, se equivocaba wink A ver si me podeis ayudar.

Readme:

* README
*
* Ralink Tech Inc.
*
* http://www.ralinktech.com
*

===========================================... Wireless Lan Linux Driver

=======================================================================
Driver lName:
===========
rt2870.o/rt2870.ko

=======================================================================
Supporting Kernel:
===================
linux kernel 2.4 and 2.6 series.
Tested in Redhat 7.3 or later.

=======================================================================
Ralink Hardware:
===================
Ralink 802.11n Wireless LAN Card.

=======================================================================
Description:
=============
This is a linux device driver for Ralink RT2870 USB ABGN WLAN Card.

=======================================================================
Contents:
=============
Makefile         : Makefile
*.c : c files
*.h : header files

=======================================================================
Features:
==========
   This driver implements basic IEEE802.11. Infrastructure and adhoc mode with
   open or shared or WPA-PSK or WPA2-PSK authentication method.
   NONE, WEP, TKIP and AES encryption.

=======================================================================
Build Instructions: 
====================

1> $tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz
    go to "./DPB_RT2870_Linux_STA_x.x.x.x" directory.
   
2> In Makefile
set the "MODE = STA" in Makefile and chose the TARGET to Linux by set "TARGET = LINUX"
define the linux kernel source include file path LINUX_SRC
modify to meet your need.

3> In os/linux/config.mk
define the GCC and LD of the target machine
define the compiler flags CFLAGS
modify to meet your need.
** Build for being controlled by NetworkManager or wpa_supplicant wext functions
   Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y'.
   => #>cd wpa_supplicant-x.x
   => #>./wpa_supplicant -Dwext -ira0 -c wpa_supplicant.conf -d
** Build for being controlled by WpaSupplicant with Ralink Driver
   Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n'.
   => #>cd wpa_supplicant-0.5.7
   => #>./wpa_supplicant -Dralink -ira0 -c wpa_supplicant.conf -d

4> $make
# compile driver source code
# To fix "error: too few arguments to function ¡¥iwe_stream_add_event"
  => $patch -i os/linux/sta_ioctl.c.patch os/linux/sta_ioctl.c

5> $cp RT2870STA.dat  /etc/Wireless/RT2870STA/RT2870STA.dat
   
6> load driver, go to "os/linux/" directory.
    #[kernel 2.4]
    #    $/sbin/insmod rt2870sta.o
    #    $/sbin/ifconfig ra0 inet YOUR_IP up
       
    #[kernel 2.6]
    #    $/sbin/insmod rt2870sta.ko
    #    $/sbin/ifconfig ra0 inet YOUR_IP up

7> unload driver   
    $/sbin/ifconfig ra0 down
$/sbin/rmmod rt2870sta

Y aqui el makefile al que hace referencia y hay que configurar:

RT28xx_MODE = STA
TARGET = LINUX

CHIPSET = 3070

#RT28xx_DIR = home directory of RT28xx source code
RT28xx_DIR = $(shell pwd)
RTMP_SRC_DIR = $(RT28xx_DIR)/RT$(CHIPSET)

#PLATFORM: Target platform
PLATFORM = PC
#PLATFORM = 5VT
#PLATFORM = IKANOS_V160
#PLATFORM = IKANOS_V180
#PLATFORM = SIGMA
#PLATFORM = SIGMA_8622
#PLATFORM = INIC
#PLATFORM = STAR
#PLATFORM = IXP
#PLATFORM = INF_TWINPASS
#PLATFORM = INF_DANUBE
#PLATFORM = BRCM_6358
#PLATFORM = INF_AMAZON_SE
#PLATFORM = CAVM_OCTEON
#PLATFORM = CMPC
#PLATFORM = RALINK_2880

ifeq ($(PLATFORM),5VT)
LINUX_SRC = /project/stable/5vt/ralink-2860-sdk/linux-2.6.17
CROSS_COMPILE = /opt/crosstool/uClibc_v5te_le_gcc_4_1_1/bin/arm-linux-
endif

ifeq ($(PLATFORM),IKANOS_V160)
LINUX_SRC = /home/sample/projects/LX_2618_RG_5_3_00r4_SRC/linux-2.6.18
CROSS_COMPILE = mips-linux-
endif

ifeq ($(PLATFORM),IKANOS_V180)
LINUX_SRC = /home/sample/projects/LX_BSP_VX180_5_4_0r1_ALPHA_26DEC07/linux-2.6.18
CROSS_COMPILE = mips-linux-
endif

ifeq ($(PLATFORM),SIGMA)
LINUX_SRC = /root/sigma/smp86xx_kernel_source_2.7.172.0/linux-2.6.15
CROSS_COMPILE = /root/sigma/smp86xx_toolchain_2.7.172.0/build_mipsel_nofpu/staging_dir/bin/mipsel-linux-
endif

ifeq ($(PLATFORM),SIGMA_8622)
LINUX_SRC = /home/snowpin/armutils_2.5.120.1/build_arm/linux-2.4.22-em86xx
CROSS_COMPILE = /home/snowpin/armutils_2.5.120.1/toolchain/bin/arm-elf-
CROSS_COMPILE_INCLUDE = /home/snowpin/armutils_2.5.120.1/toolchain/lib/gcc-lib/arm-elf/2.95.3
endif

ifeq ($(PLATFORM),INIC)
UCOS_SRC = /opt/uCOS/iNIC_rt2880
CROSS_COMPILE = /usr/bin/mipsel-linux-
endif

ifeq ($(PLATFORM),STAR)
LINUX_SRC = /opt/star/kernel/linux-2.4.27-star
CROSS_COMPILE = /opt/star/tools/arm-linux/bin/arm-linux-
endif

ifeq ($(PLATFORM), RALINK_2880)
LINUX_SRC = /project/stable/RT288x/RT288x_SDK/source/linux-2.4.x
CROSS_COMPILE = /opt/buildroot-gdb/bin/mipsel-linux-
endif

ifeq ($(PLATFORM),PC)
# Linux 2.6
LINUX_SRC = /lib/modules/$(shell uname -r)/build
# Linux 2.4 Change to your local setting
#LINUX_SRC = /usr/src/linux-2.4
LINUX_SRC_MODULE = /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless/
CROSS_COMPILE =
endif

ifeq ($(PLATFORM),IXP)
LINUX_SRC = /project/stable/Gmtek/snapgear-uclibc/linux-2.6.x
CROSS_COMPILE = arm-linux-
endif

ifeq ($(PLATFORM),INF_TWINPASS)
# Linux 2.6
#LINUX_SRC = /lib/modules/$(shell uname -r)/build
# Linux 2.4 Change to your local setting
LINUX_SRC = /project/stable/twinpass/release/2.0.1/source/kernel/opensource/linux-2.4.31/
CROSS_COMPILE = mips-linux-
endif

ifeq ($(PLATFORM),INF_DANUBE)
LINUX_SRC = /opt/danube/sdk/linux-2.6.16.x
CROSS_COMPILE = mips-linux-
ROOTDIR = /opt/danube/sdk
export ROOTDIR
endif

ifeq ($(PLATFORM),BRCM_6358)
LINUX_SRC =
CROSS_COMPILE =
endif

ifeq ($(PLATFORM),INF_AMAZON_SE)
# Linux 2.6
#LINUX_SRC = /lib/modules/$(shell uname -r)/build
# Linux 2.4 Change to your local setting
LINUX_SRC = /backup/ifx/3.6.2.2/source/kernel/opensource/linux-2.4.31
#CROSS_COMPILE = mips-linux-
#LINUX_SRC = /project/Infineon/3.6.2.2/source/kernel/opensource/linux-2.4.31
CROSS_COMPILE = /opt/uclibc-toolchain/ifx-lxdb-1-2-3-external/gcc-3.3.6/toolchain-mips/R0208V35/mips-linux-uclibc/bin/
endif

ifeq ($(PLATFORM),ST)
LINUX_SRC = /opt/STM/STLinux-2.2/devkit/sources/kernel/linux0039
CROSS_COMPILE = /opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-
ARCH := sh
export ARCH
endif

ifeq ($(PLATFORM),CAVM_OCTEON)
OCTEON_ROOT = /usr/local/Cavium_Networks/OCTEON-SDK
LINUX_SRC = $(OCTEON_ROOT)/linux/kernel_2.6/linux
CROSS_COMPILE = mips64-octeon-linux-gnu-
endif

ifeq ($(PLATFORM),CMPC)
LINUX_SRC = /opt/fvt_11N_SDK_0807/fvt131x_SDK_11n/linux-2.6.17
CROSS_COMPILE =
endif

export RT28xx_DIR RT28xx_MODE LINUX_SRC CROSS_COMPILE CROSS_COMPILE_INCLUDE PLATFORM RELEASE CHIPSET RTMP_SRC_DIR LINUX_SRC_MODULE TARGET

all: build_tools $(TARGET)

build_tools:
make -C tools
$(RT28xx_DIR)/tools/bin2h

test:
make -C tools test

UCOS:
make -C os/ucos/ MODE=$(RT28xx_MODE)
echo $(RT28xx_MODE)

LINUX:
ifneq (,$(findstring 2.4,$(LINUX_SRC)))
cp -f os/linux/Makefile.4 $(RT28xx_DIR)/os/linux/Makefile
make -C $(RT28xx_DIR)/os/linux/
cp -f $(RT28xx_DIR)/os/linux/rt$(CHIPSET)sta.o /tftpboot
else
cp -f os/linux/Makefile.6 $(RT28xx_DIR)/os/linux/Makefile
make  -C  $(LINUX_SRC) SUBDIRS=$(RT28xx_DIR)/os/linux modules
cp -f $(RT28xx_DIR)/os/linux/rt$(CHIPSET)sta.ko /tftpboot
endif

clean:
ifeq ($(TARGET), LINUX)
ifneq (,$(findstring 2.4,$(LINUX_SRC)))
cp -f os/linux/Makefile.4 os/linux/Makefile
else
cp -f os/linux/Makefile.6 os/linux/Makefile
endif
make -C os/linux clean
rm -rf os/linux/Makefile
endif
ifeq ($(TARGET), UCOS)
make -C os/ucos clean MODE=$(RT28xx_MODE)
endif

uninstall:
ifeq ($(TARGET), LINUX)
ifneq (,$(findstring 2.4,$(LINUX_SRC)))
make -C $(RT28xx_DIR)/os/linux -f Makefile.4 uninstall
else
make -C $(RT28xx_DIR)/os/linux -f Makefile.6 uninstall
endif
endif

install:
ifeq ($(TARGET), LINUX)
ifneq (,$(findstring 2.4,$(LINUX_SRC)))
make -C $(RT28xx_DIR)/os/linux -f Makefile.4 install
else
make -C $(RT28xx_DIR)/os/linux -f Makefile.6 install
endif
endif

libwapi:
make -C $(RT28xx_DIR)/os/linux -f Makefile.libwapi

He probado un par de cambios, pero al compilar me da error [linux 2]

¿[linux 2] es el único mensaje de error?

[make 1] se sale del directorio /usr/src/lnix-headers2.6.32

Bien, ¿podrías ser un poco mas prolijo, por favor? Antes de eso habrá una o varias lineas con

...
error: blablabla...
....

Suelen ser bastante descriptivos

Como no me deja acceder en modo escritura a la particion de windows, he tenido que instalar debian en una maquina virtual, y luego instalar gnome y replicar el intento de instalacion del driver para conseguir un log decente de los errores (habra formas mas faciles, supongo, pero solo se me ocurria eso, jej). Aqui va exacto:

make>texto.txt

make -C tools
make[1]: se ingresa al directorio `/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/tools'
gcc -g bin2h.c -o bin2h
make[1]: se sale del directorio `/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/tools'
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/Makefile
make  -C  /lib/modules/2.6.32-5-686/build SUBDIRS=/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux modules
make[1]: se ingresa al directorio `/usr/src/linux-headers-2.6.32-5-686'
  CC [M]  /home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.o
make[1]: se sale del directorio `/usr/src/linux-headers-2.6.32-5-686'

Y luego copia pega de make

root@debian:/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0# make
make -C tools
make[1]: se ingresa al directorio `/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/tools'
gcc -g bin2h.c -o bin2h
make[1]: se sale del directorio `/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/tools'
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/Makefile
make  -C  /lib/modules/2.6.32-5-686/build SUBDIRS=/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux modules
make[1]: se ingresa al directorio `/usr/src/linux-headers-2.6.32-5-686'
  CC [M]  /home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.o
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpOSNetDevAttach’:
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1510: error: ‘struct net_device’ has no member named ‘open’
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1511: error: ‘struct net_device’ has no member named ‘stop’
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1512: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1513: error: ‘struct net_device’ has no member named ‘do_ioctl’
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1519: error: ‘struct net_device’ has no member named ‘get_stats’
/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1553: error: ‘struct net_device’ has no member named ‘validate_addr’
make[4]: *** [/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.o] Error 1
make[3]: *** [_module_/home/mikeleitor/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: se sale del directorio `/usr/src/linux-headers-2.6.32-5-686'
make: *** [LINUX] Error 2

Pero hombre de dios, ¿que tendrá que ver que no te deje acceder en modo escritura? mrgreen

  • Descomprimes el tarball y cambias el directorio de trabajo a DPB-blah
  • En el makefile: "MODE = STA" , "TARGET = LINUX" y "LINUX_SRC=/donde/tengas/las/fuentes/del/kernel"
  • En os/linux/config.mk defines gcc y ld y las CFLAGS que utilices
  • Luego tienes que correr uno de esos dos scripts dependiendo de como quieras construir el driver y aplicar un parche si sale el error que te marca de los pocos argumentos
  • make

Muchisimas gracias por ayudarme de verdad. Pero, si no es mucha molestia, podrias ponerme los comandos exactos? Donde guardo las fuentes del kernel? Lo siento, soy un zoquete, je je je. En serio, gracias bigsmile