Author Topic: Wake on Lan for Nvidia chipset with reversed MAC address  (Read 7567 times)

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Wake on Lan for Nvidia chipset with reversed MAC address
« on: October 04, 2008, 11:00:44 pm »
Hello,

according to some other posts in the forum, there is a bug in certain Nvidia Ethernet chipsets which cause the Mac address to be stored in reverse. This seems to be the case for example in my MSI Media Live. Consequently, wake on lan only works if you you send the reversed MAC address, otherwise the computer ignores it and does not turn on. Consequently, in my 0710, WOL does not work for the MSI Media Live.

I was wondering if anyone figured out an easy fix for this? I assume it's not as simple as changing the Mac address in the Media Director settings in the web admin, as LMCE would not longer recognize the device properly while it's turned on.

One solution could be to edit the code, and whenever LMCE send a wake on lan packet, have it also send the same packet with reversed MAC address, as I don't think could cause much harm in the 95% of cases where it's useless. I'll be happy to do that if someone could point out where the code for WOL is located (in which binary). Unless there is some other easier solution?

Thank you.

Jean

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #1 on: October 05, 2008, 12:01:47 am »
i think it would be worth a shot.

-Thom

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #2 on: October 05, 2008, 06:07:22 am »
Thom,

if you tell me where to look in the code, I'll be happy to try and add this, test it and submit to you guys.

Jean

PS: If you have some general suggestions about how to find where certain things are done in the code, I'm all ears...

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #3 on: October 05, 2008, 09:21:33 am »
WakeupMD.sh and WakeupMDs.sh.

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #4 on: October 05, 2008, 07:44:35 pm »
Hari,

thanks, even easier if it's not C code :-)
My changes seem to work. After I test them a little bit more, where/how would I submit the code for consideration?

Jean

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #5 on: October 05, 2008, 08:54:00 pm »
Hari,

thanks, even easier if it's not C code :-)
My changes seem to work. After I test them a little bit more, where/how would I submit the code for consideration?

Jean
a wiki page with a patch, linked from the msi pages would be a great start.

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #6 on: October 06, 2008, 05:49:19 pm »
Hari,

pardon my ignorance, but where to can I upload the patched files to link to them from the wiki page? I found an upload feature in the wiki itself, but it's only for images.

Otherwise I can just print the lines that need to be added to the files, but it makes it even more difficult for a user without linux knowledge to add this patch.

In my opinion, our goal here is to make a system that works out of the box for almost everyone, regardless of manufacturer's bugs and caveats (the average user doesn't care about reversed MAC addresses, they just want the system to work as advertised), not a collection of patches, so it would still be best to simply add this to the code and not even have to talk about it in the wiki. I hope you agree?

Jean

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #7 on: October 06, 2008, 05:51:58 pm »
Yeah. Send the patch to me, and I will take a look at it.

I'll add it to the trunk once i've reviewed it. Thanks a lot jeangot! :D

-Thom

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #8 on: October 06, 2008, 06:21:07 pm »
[...] so it would still be best to simply add this to the code and not even have to talk about it in the wiki. I hope you agree?
Mostly. I was just thinking the page could be helpful until we have our next release or an update out..

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #9 on: October 09, 2008, 04:16:34 am »
Thom, I just sent you the files.

Hari: for the people who are able to change files on their system, I might as well post here what I did (since I still don't know how to upload files to the Wiki).

So in WakeMD.sh (on the core) I added this:
#For motherboards with Nvidia Ethernet chipset with reversed MAC address, we issue a wake command with reversed MAC
Reversed_Parm_MAC="${Parm_MAC:15:2}:${Parm_MAC:12:2}:${Parm_MAC:9:2}:${Parm_MAC:6:2}:${Parm_MAC:3:2}:${Parm_MAC:0:2}";
/usr/sbin/etherwake -b -i "$IntIf" "$Reversed_Parm_MAC"

And in WakeMDs.sh this:
   #For motherboards with Nvidia Ethernet chipset with reversed MAC address, we issue a wake command with reversed MAC
Reversed_HostMAC="${HostMAC:15:2}:${HostMAC:12:2}:${HostMAC:9:2}:${HostMAC:6:2}:${HostMAC:3:2}:${HostMAC:0:2}";
      /usr/sbin/etherwake -b -i "$IntIf" "$Reversed_HostMAC"

And I put it right after the original etherwake command in each case.

Jean

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #10 on: October 09, 2008, 08:53:57 am »
cool. Now let's only do that for the MAC range of the buggy nvidia chipset...

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Wake on Lan for Nvidia chipset with reversed MAC address
« Reply #11 on: October 10, 2008, 05:22:05 am »
Hari,

great idea. Do you know what that range might be by any chance, or should we just do it for all Nvidia chips?

Jean