LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-27-2010, 01:27 AM   #1
abhaygc
LQ Newbie
 
Registered: Oct 2010
Posts: 1

Rep: Reputation: 0
MDIO Read/Write character driver


Hello all,
I'm working on "T.I Davinci EVM, DM6467 processor". This EVM has multiple PHYs. I need to be able to edit register settings of the PHYs once the kernel is up, i.e. I'm trying to write a character driver which takes device address, register address and data to be written from user-application and does an MDIO read/write. In the driver ioctl, I use/call the functions "emac_mdio_read" and "emac_mdio_write" defined in "drivers/net/davinci_emac_phy.c" (I'm using kernel version 2.6.18) The module compiles and insmod also succeeds, but when I run it, I get the following error:

Code:
root@192.168.37.179:/# ./i2c_mdio_testapp.out 
<1>
Unable to handle kernel NULL pointer dereference at virtual address 00000080
pgd = c3ddc000
[00000080] *pgd=8431f031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#2]
Modules linked in: ittiam_i2c_mdio_regrw
CPU: 0
PC is at emac_mdio_read+0x3c/0x9c [ittiam_i2c_mdio_regrw]
LR is at 0x1
pc : [<bf0004ec>]    lr : [<00000001>]    Not tainted
sp : c3dd9ef0  ip : 60000093  fp : c3dd9f0c
r10: 00000000  r9 : c3dd8000  r8 : 00000003
r7 : c0603aa0  r6 : 0000000a  r5 : 00000001  r4 : bf0032f0
r3 : 00000080  r2 : 00000000  r1 : 00000080  r0 : 00000036
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  Segment user
Control: 5317F
Table: 83DDC000  DAC: 00000015
Process i2c_mdio_testap (pid: 946, stack limit = 0xc3dd8258)
Stack: (0xc3dd9ef0 to 0xc3dda000)
9ee0:                                     c3dd9f24 c0603aa0 00010708 00000001 
9f00: c3dd9f24 c3dd9f10 bf001318 bf0004c0 c0603aa0 00010708 c3dd9f44 c3dd9f28 
9f20: c00a7eec bf0012dc c0065d38 c0603aa0 00000003 00010708 c3dd9f74 c3dd9f48 
9f40: c00a81cc c00a7e80 00000003 00000000 00000000 00000000 00010708 00000001 
9f60: 00000003 c3dd8000 c3dd9fa4 c3dd9f78 c00a82a8 c00a7f18 c3dd9f9c 00000000 
9f80: c003ce94 40024e00 00000000 00000000 00000036 c0035fa8 00000000 c3dd9fa8 
9fa0: c0035f78 c00a8204 40024e00 00000000 00000003 00000001 00010708 00000003 
9fc0: 40024e00 00000000 00000000 00000036 00000000 00000000 40025000 be8dcce4 
9fe0: 00000000 be8dccc0 0000849c 400e027c 60000010 00000003 00000000 00000000 
Backtrace: 
[<bf0004b0>] (emac_mdio_read+0x0/0x9c [ittiam_i2c_mdio_regrw]) from [<bf001318>] (i2c_mdio_regrw_ioctl+0x4c/0x120 [ittiam_i2c_mdio_regrw])
 r6 = 00000001  r5 = 00010708  r4 = C0603AA0 
[<bf0012cc>] (i2c_mdio_regrw_ioctl+0x0/0x120 [ittiam_i2c_mdio_regrw]) from [<c00a7eec>] (do_ioctl+0x7c/0x98)
 r5 = 00010708  r4 = C0603AA0 
[<c00a7e70>] (do_ioctl+0x0/0x98) from [<c00a81cc>] (vfs_ioctl+0x2c4/0x2ec)
 r6 = 00010708  r5 = 00000003  r4 = C0603A
Could anyone suggest where I'm going on, or is there a ready way using which I can do MDIO Read/Write?..

<I'm sorry, this is not a core networking related issue, but just one involving a network hardware configuration.. Din't know where else this would fit on the forum, so posted it here.. If i'm to post it in a different group, pls redirect me there>

Thank you,

Last edited by abhaygc; 10-27-2010 at 01:55 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Read Write access to a iso9660 filesystem..mount a .iso image as read write ceazar123 Linux - Newbie 16 09-01-2010 09:07 AM
Read Write access to a iso9660 filesystem..mount a .iso image as read write ceazar123 Linux - General 2 08-26-2010 03:32 PM
How to write a character device driver to read the processor's GDT kiranshadow Linux - General 1 05-10-2008 11:28 AM
Driver to read/write to MS Access DB w/Perl bpotts Linux - General 1 09-15-2005 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration