Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Hi all,
i've tried the poweroff and dns323-poweroff executable to turn off the box, but nothing happens ( dns323-poweroff says "still here?").
Looking at the dns323-poweroff src:
/* Power off DNS-323 0x89f8 - read register 0x89f9 - write register Uses an ioctl of the egiga0 network interface. This ultimately ends up in this macro: #define MV_REG_WRITE(offset, val) \ MV_MEMIO_LE32_WRITE((INTER_REGS_BASE | (offset)), (val)) (defined in arch/arm/mach-mv88fxx81/Soc/ctrlEnv/mvCtrlEnvLib.h) To power off, offset must be 0x10100, and val 0x106. */ int main(int argc, char **argv) { int fd; struct ifreq ifr; unsigned long off_data[2] = { 0x10100, 0x106 }; const char *ifname = "egiga0"; fd = socket(AF_INET, SOCK_DGRAM, 0); memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, ifname); ifr.ifr_data = (void *)off_data; if (ioctl(fd, 0x89f9, &ifr) == -1) perror("ioctl"); printf("Still here?\n"); exit(1); }
This piece of code is a bit obscure... i've never used ioctl(), so reading the comment, i suppose that fonz is writing a structure in a "register" of egiga0 with the sole aim to invoke that define using the struct parameters. Calling that define should result in sudden poweoff.
But nothing happens, maybe something changed between different hardware revisions?
Last edited by jules (2008-02-11 23:53:40)
Offline
jules wrote:
This piece of code is a bit obscure...
Yes, powering off via a network interface control call is obscure, but it's the manufacturer's idea, not mine.
Please tell us your kernel version ("uname -a" in telnet).
Offline
fonz wrote:
Yes, powering off via a network interface control call is obscure, but it's the manufacturer's idea, not mine.
Please tell us your kernel version ("uname -a" in telnet).
Thanks for the fast reply, fonz (and also thanks for the awesome work you've done with the funplug).
Here is the uname string:
Linux mybox01 2.6.12.6-arm1 #29 Wed Jan 16 11:47:00 CST 2008 armv5tejl unknown
Given the fact that also the provided "poweroff" binary (i own a ch3snas but i think that this binary should be contained in the dns323 fw too) is unable to switch off the unit, can this issue be considered a bug of the mainline firmware? Is any user with a DNS323 with the latest firmware unable to poweroff his unit too?
Update: Running poweroff, and then dmesg, these new lines were added:
md: stopping all md devices.
md: md0 switched to read-only mode.
Synchronizing SCSI cache for disk sda:
Power down.
Strange, indeed.
Last edited by jules (2008-02-12 23:16:19)
Offline
Hmmm,
my uname -a is:
Linux nas-server 2.6.12.6-arm1 #32 Tue Jan 23 17:11:52 CST 2007 armv5tejl GNU/Linux
It appears we have different kernel build versions, although i'm confused as to how come i have #32 but at a date before yours.
Offline
fonz wrote:
orbitaudio wrote:
Linux nas-server 2.6.12.6-arm1 #32 Tue Jan 23 17:11:52 CST 2007 armv5tejl GNU/Linux
Does dns323-poweroff work on your box?
yup . All your utilities work on my box (well i haven't tested the spindown one) and my chkbutton2 (reads the power button status via ioctl() to 0x89f8) all work on my box.
Offline
orbitaudio wrote:
yup . All your utilities work on my box (well i haven't tested the spindown one) and my chkbutton2 (reads the power button status via ioctl() to 0x89f8) all work on my box.
I haven't set up a cc environment yet so i can't try to read the register as you are proposing, but your post confirms that with a newer build of the kernel (on the original dns323 i think) this issue is not present... maybe this bug has been fixed...
Anyway, i've posted a brief description of my little problem on the aroundmyroom blog too. I hope that the helpful guy over there will help me to sort this issue out.
Offline
hmmm, I wonder if I/O pinouts or even the method/driver for I/O has changed between revisions,
Offline
orbitaudio wrote:
hmmm, I wonder if I/O pinouts or even the method/driver for I/O has changed between revisions,
This is probable... but i just found out that the shutdown function of the webpanel works. So at least, shutting down the unit is possible, one day i'll find out how.
Offline