OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> How To Load G_file_storage.ko? Error Occus
andyzn
post Jul 3 2006, 06:21 AM
Post #1





Group: Members
Posts: 13
Joined: 3-July 06
Member No.: 10,306



I have a board with USB slave 1.1, and Linux installed on it.

I have connected it with a PC through a USB cable.

And I want to make the PC "know" the device?

on the board(the kernel is 2.6.11):

1. start Linux

2. dd bs=1M count=8 if=/dev/zero /root/data (FAT32)

3. modprobe g_file_storage file=/root/data

HERE IS THE ERROR MESSAGE:
*****************************************
Using /lib/modules/2.6.11-XSBase27x/kernel/drivers/usb/gadget/g_file_storage.ko
insmod: cannot insert `/lib/modules/2.6.11-XSBase27x/kernel/drivers/usb/gadget/g
_file_storage.ko': Device or resource busy (-1): Device or resource busy
modprobe: failed to load module g_file_storage
*****************************************

which device is busy?

Or
what should I do before I "modprobe g_file_storage..."?
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
lardman
post Jul 5 2006, 03:03 AM
Post #2





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



I don't know, but a quick google turned up some posts and patches which might be of use:

http://www.nabble.com/pxa27x_udc-fails-w-g...l-t1036446.html


Si
Go to the top of the page
 
+Quote Post
andyzn
post Jul 6 2006, 10:14 PM
Post #3





Group: Members
Posts: 13
Joined: 3-July 06
Member No.: 10,306



Thanks for that. But the patch dosen't work.

And this time I make the g_file_storage module builed in while compling.

Then make some changes in file_storage.c

/**********************************************************************/
static char *file[MAX_LUNS] = {"/root/back_file", };/* changed*/
static int ro[MAX_LUNS] = {0, };
/**********************************************************************/

but while rebooting, it says unable to open "/root/back_file".

ERROR WHILE REBOOTING:
pxa27x_udc: version 23-Sep-2004
g_file_storage gadget: controller 'pxa27x_udc' not recognized
g_file_storage gadget-lun0: unable to open backing file: /root/back_file

the code related is here:

static int open_backing_file(.............)
{
.......
.......
/* R/W if we can, R/O if we must */
ro = curlun->ro;
if (!ro) {
filp = filp_open(filename, O_RDWR | O_LARGEFILE, 0);
if (-EROFS == PTR_ERR(filp))
ro = 1;
}
if (ro)
filp = filp_open(filename, O_RDONLY | O_LARGEFILE, 0);
if (IS_ERR(filp)) {
LINFO(curlun, "unable to open backing file: %s\n", filename);/***/
return PTR_ERR(filp);
}

.......
.......
}

the /root/back_file is created like this:
[root@Bill ~]vi /root/back_file
[root@Bill ~]dd bs=1M count=8 if=/dev/zero of=/root/back_file
[root@Bill ~]fdisk -S 8 -H 16 -C 128 /root/disk
Above is from llinux-usb.org/gadget/file_storage.html
then
[root@Bill ~]chmod 777 /root/back_file


file_storage.c I have changed is attached

QUOTE(lardman @ Jul 5 2006, 03:03 AM)
I don't know, but a quick google turned up some posts and patches which might be of use:

http://www.nabble.com/pxa27x_udc-fails-w-g...l-t1036446.html


Si
*
Go to the top of the page
 
+Quote Post

Posts in this topic
andyzn   How To Load G_file_storage.ko? Error Occus   Jul 3 2006, 06:21 AM
lardman   How do you get a terminal prompt, not over a usb e...   Jul 3 2006, 06:27 AM
andyzn   Today I found g_ether is builded in. SO I recompil...   Jul 5 2006, 12:14 AM
andyzn   Here is sth after dmesg: [root@emdoor bin]# dmesg...   Jul 5 2006, 12:35 AM
lardman   I don't know, but a quick google turned up som...   Jul 5 2006, 03:03 AM
andyzn   Thanks for that. But the patch dosen't work. ...   Jul 6 2006, 10:14 PM
lardman   What does filp indicate the error is? Your file m...   Jul 10 2006, 03:25 AM
andyzn   Oh, sorry. Actually it is [root@Bill ~]fdisk -S...   Jul 10 2006, 04:18 AM
andyzn   I have checked the error, error = PTR_ERR(filp) ...   Jul 10 2006, 08:06 PM
andyzn   after dmesg,below is the information while rebooti...   Jul 10 2006, 08:19 PM
andyzn   rootfs is not mounted while open /root/back_file,a...   Jul 10 2006, 10:44 PM
lardman   I didn't notice it before, but this can't ...   Jul 10 2006, 02:57 PM
andyzn   In gadget/gadget_chips.h #ifdef CONFIG_USB_GADGET...   Jul 10 2006, 07:29 PM
lardman   I was going to suggest that. Have you tried using...   Jul 11 2006, 01:05 AM
andyzn   I am happy to say, my windows host could recognize...   Jul 11 2006, 01:13 AM
lardman   Glad you've got it sorted Si   Jul 11 2006, 01:28 AM
andyzn   The host(windows XP) always says "it should b...   Jul 11 2006, 05:54 AM
lardman   I'm not sure. You could always format it using...   Jul 11 2006, 06:05 AM
andyzn   That is interesting. I changed the partition type ...   Jul 11 2006, 09:58 PM
andyzn   Goal: To simulate the flash of the board to be a U...   Jul 11 2006, 10:39 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2014 - 04:28 AM