• Home
  • Reviews
  • Articles
  • News
  • Tools
  • GamingHeaven
  • Forums
  • Network
 

Go Back   DriverHeaven.net > Forums > Software / Tools > Programming, Coding, (Web)Design

Notices

Reply
 
LinkBack Thread Tools
Old Nov 8, 2006, 08:49 AM   #1
DriverHeaven Newbie
 
Join Date: Nov 2006
Posts: 3
RooJ is on a distinguished road

Activating a wireless card (DeviceioControl)

Not sure if this is the right place to ask but im wanting to communicate directly with a device driver from a vb6 application and need some guidance.

Basically we (a school) have bought 35 laptops that have an annoying issue with them. When starting with the AC power adapter plugged in, the wireless card will activate itself on boot allowing people to login without problems. When running from the battery however the wireless card doesnt activate itself until you either hit a toggle switch at the front of the laptop or when a certain packaged software runs (after logon).
As a school this isn't going to work and as the company we purchased them from wont take the laptops back, and the laptop manufacturers state that "this laptop doesnt have the ability to activate its wireless card automatically before logon unless running from mains" im left trying to fix the problem myself.

What i want to do is create a windows service (which isnt a problem) that when ran does what the preinstalled software does, activates the wireless card.
Ive searched the web and found some very interesting sites, i know now that to open a handle to a driver you use CreateFile() using the name of the device as filename. You use DeviceioControl() to send requests to the driver, but what i dont have much of a clue about is IOCTL codes. Is there any easy way to find out what the code would be to "activate wireless card"? Its an Atheros ARG5005G wireless card

Thanks,

Roo
RooJ is offline   Reply With Quote
Old Nov 9, 2006, 06:16 AM   #2
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,256
UberLord is on a distinguished road

Why not just create a service to run the packaged software at boot?

But that is just a load of BS really - I know for sure that atheros cards work fine without mains power when you run either Linux or FreeBSD

As to the ioctl codes - that would be specfic to the OS and the driver. Maybe you could email atheros directly and if they can supply any specs. Don't hold your breath though as they won't give them to the open source crowd either!
UberLord is offline   Reply With Quote
Old Nov 9, 2006, 10:05 AM   #3
DriverHeaven Newbie
 
Join Date: Nov 2006
Posts: 3
RooJ is on a distinguished road

Quote:
Why not just create a service to run the packaged software at boot?
When running as a service the software doesn't activate the card (not sure why). Also we're trying to avoid using the software as much as possible, when a user logs on we dont really want the packaged software to be running.

Quote:
But that is just a load of BS really - I know for sure that atheros cards work fine without mains power when you run either Linux or FreeBSD
The card works fine when activated, but doesnt activate itself on boot. Ive tried reinstalling XP in hopes that it was just the built in software or drivers causing the issue but the exact same problem occured (with the latest version of the card drivers). Ive also found that the card wasn't activated when running from a linux live cd.

Quote:
As to the ioctl codes - that would be specfic to the OS and the driver. Maybe you could email atheros directly and if they can supply any specs. Don't hold your breath though as they won't give them to the open source crowd either!
Yeah i guessed from the complete lack of codes available online that it would be a pain to get them, doubt atheros would be able to help. Im thinking as a last resort that i might have to debug the driver or the preinstalled software that actually succeeds in starting the card. Maybe i can watch how their software does it and copy, i may even find a dll i can use thats responsible for communicating with the driver.

If you have any tips on debugging drivers id love to hear from you, i have experience with debugging normal applications so im sure it wont be completely foreign to me. I know there might be legal issues with this but i have little choice.

Thanks for the help

Roo
RooJ is offline   Reply With Quote
Old Nov 10, 2006, 12:16 PM   #4
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,256
UberLord is on a distinguished road

Quote:
Originally Posted by RooJ View Post
Ive also found that the card wasn't activated when running from a linux live cd.
Depends on the livecd.
Gentoo's LiveCD doesn't automatically activate the wireless, whereas once Gentoo is installed proper it will.

This is mainly because no live cd ships with the binary firmwares required for the wireless driver as that goes against the binary firmware license. The only exception I know of is the rt2500 driver as that has no firmware With sucks as I know athereos requires one. Infact, OpenBSD are making an open firmware for the card - which according to reports sort of works.

Quote:
If you have any tips on debugging drivers id love to hear from you, i have experience with debugging normal applications so im sure it wont be completely foreign to me. I know there might be legal issues with this but i have little choice.
Only driver debugging I've ever done was in Linux as the source is easily to hand.

NFC how to go about it in windows ....

Good luck though! I think you'll need it.
UberLord is offline   Reply With Quote
Old Nov 13, 2006, 04:42 AM   #5
DriverHeaven Newbie
 
Join Date: Nov 2006
Posts: 3
RooJ is on a distinguished road

Ive been looking into programs such as devfilter and driverspNT which seem to work well, they hook the driver of your choice and monitor api's. Im not sure whether i should be hooking the driver "AR5211" or something relating to NDIS, Ndisuio etc but i feel im closing in on a solution (hopefully). The control codes im getting back from driverspy when monitoring the driver dont change whether i enable or disable the card, and without doing either the api is still called occasionally anyway. The only Control codes i recieve for IRP_MJ_DEVICE_CONTROL when monitoring the driver is 0x0017003E for example.

Monitoring NDIS produces interesting results:

Process Major ...|Function..........................|IOCTL
svchost.exe:916 |IRP_MJ_CREATE
svchost.exe:916 |IRP_MJ_DEVICE_CONTROL|0x170010
svchost.exe:916 |IRP_MJ_CLEANUP
svchost.exe:916 |IRP_MJ_CLOSE
svchost.exe:916 |IRP_MJ_CREATE
svchost.exe:916 |IRP_MJ_DEVICE_CONTROL|0x170008

But once again these are repeated aslong as the card is activated, i think these might be related to holding a connection, checking SSID's etc.

Anyway i guess its just a case of digging for more information + trial and error.
Thanks for the help.

Roo.
RooJ is offline   Reply With Quote
Old Dec 14, 2006, 03:22 AM   #6
Delete Me
 
Join Date: Mar 2004
Posts: 14,676
pr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to all

in windows, if im not mistaken, you need the GUID for the driver, which is generated on the fly at isntall time, to accomplish much of any sort of low level control.


It can be done though...sony laptops ship with a software "WiFi Switch", you may look that up and see if you can find anything helpful on it
pr0digal jenius is offline   Reply With Quote
 

 
Powered by: vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Artwork by Allan 'Zardon' Campbell, vBulletin implementation by Craig '5320' Humphreys based on original artwork by Ratchet.

All times are GMT -5. The time now is 04:18 AM. Copyright ©2008 HeavenMedia.net