Hi Alvaro,
One more interesting thing, the reason I tried to compile the kernel is I
want to use the latest sierra driver.
As make-kpkg failed at final stage, I thought I might could use the the
sierra.ko compiled, so I copied the module in /lib/modules/2.6.26-486-
voyage/kernel/drivers/usb/serial
Then I tried to load the module, but the OS complained format not correct:
===
voyage: modprobe sierra
FATAL: Error inserting sierra
(/lib/modules/2.6.26-486-voyage/kernel/drivers/usb/serial/sierra.ko):
Invalid module format
==
Attached is the source file, if anybody could help me to compile the module
that will be great.
Robbert
/*
USB Driver for Sierra Wireless
Copyright (C) 2006, 2007, 2008 Kevin Lloyd
IMPORTANT DISCLAIMER: This driver is not commercially supported by
Sierra Wireless. Use at your own risk.
This driver is free software; you can redistribute it and/or modify
it under the terms of Version 2 of the GNU General Public License as
published by the Free Software Foundation.
Portions based on the option driver by Matthias Urlichs
Whom based his on the Keyspan driver by Hugh Blemings
Back ported to kernel 2.6.26
*/
#define DRIVER_VERSION "v.1.3.1b"
#define DRIVER_AUTHOR "Kevin Lloyd "
#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define SWIMS_USB_REQUEST_SetPower 0x00
#define SWIMS_USB_REQUEST_SetNmea 0x07
#define SWIMS_USB_REQUEST_SetMode 0x0B
#define SWIMS_SET_MODE_Modem0x0001
/* per port private data */
#define N_IN_URB4
#define N_OUT_URB 4
#define IN_BUFLEN 4096
static int debug;
static int nmea;
static int truinstall = 1;
enum devicetype {
DEVICE_3_PORT = 0,
DEVICE_1_PORT = 1,
DEVICE_INSTALLER = 2,
};
static int sierra_set_power_state(struct usb_device *udev, __u16 swiState)
{
int result;
dev_dbg(&udev->dev, "%s", __func__);
result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
SWIMS_USB_REQUEST_SetPower, /* __u8 request */
USB_TYPE_VENDOR,/* __u8 request type */
swiState, /* __u16 value */
0, /* __u16 index */
NULL, /* void *data*/
0, /* __u16 size*/
USB_CTRL_SET_TIMEOUT); /* int timeout */
return result;
}
static int sierra_set_ms_mode(struct usb_device *udev, __u16 eSWocMode)
{
int result;
dev_dbg(&udev->dev, "%s", "DEVICE MODE SWITCH\n");
result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
SWIMS_USB_REQUEST_SetMode, /* __u8 request */
USB_TYPE_VENDOR,/* __u8 request type */
eSWocMode, /* __u16 value */
0x, /* __u16 index */
NULL, /* void *data*/
0, /* __u16 size*/
USB_CTRL_SET_TIMEOUT); /* int timeout */
return result;
}
static int sierra_vsc_set_nmea(struct usb_device *udev, __u16 enable)
{
int result;
dev_dbg(&udev->dev, "%s", __func__);
result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
SWIMS_USB_REQUEST_SetNmea, /* __u8 request */
USB_TYPE_VENDOR,/* __u8 request type */
enable, /* __u16 value */
0x, /* __u16 index */
NULL, /* void *data*/
0, /* __u16 size*/
USB_CTRL_SET_TIMEOUT); /* int timeout */
return result;
}
static int sierra_calc_num_ports(struct usb_serial *serial)
{
int result;
int *num_ports = usb_get_serial_data(serial);
dev_dbg(&serial->dev->dev, "%s", __func__);
result = *num_ports;
if (result) {
kfree(num_ports);
usb_set_serial_data(serial, NULL);
}
return result;
}
static int sierra_calc_interface(struct usb_serial *serial)
{
int interface;
struct usb_interface *p_interface;
struct usb_host_interface *p_host_interface;
dev_dbg(&serial->dev->dev, "%s", __func__);