[PLUG] [Dev] Adding BSNL EVDO detection to NetworkManager
Chetan S
cshring at gmail.com
Thu Dec 18 14:44:22 IST 2008
On Tue, Dec 9, 2008 at 5:20 PM, Rahul Sundaram
<sundaram at fedoraproject.org> wrote:
> Chetan S wrote:
>
>> The question - which string from the hal listing will make most sense ?
>>
>> If anyone familiar with D-Bus , Hal programming, NetworkManager can
>> they step in and explain if the line of reasoning is fine.
>> Others are free to pitch in too !!ers
>
> Why not go to the NetworkManager list and ask this question? The
> developers of the underlying tools are subscribed in that list as well.
>
> http://mail.gnome.org/mailman/listinfo/networkmanager-list
>
>
> Rahul
Tada ! The problem is solved and in a much more simpler and robust
way than mucking around in C.
* Warning * Long post ahead.
Let me explain -
1. BSNL provides a usb modem AC8700 for EVDO broadband. This gets
autodetected by hal in Ubuntu Intrepid and the moto-modem driver gets
loaded.
2. For some funny reason networkmanager could not detect this and so
i looked around networkmanager source code, hal etc etc.
some utils which help - hal-device, qdbusviewer and good ol grep.
Thankfully before I could add some additional detection lines to
networkmanager usb modem code, there was something I stumbled upon
under hal. Enter our hero - hal-info !!!!
This neat file resides under
/usr/share/hal/fdi/information/10freedesktop/10-modem.fdi for Ubuntu
Intrepid.
Its an xml file and has some neat lines for nokia, novatel etc etc.
How it works -
a. Hal detects the device and loads the appropriate driver
b. Hal info is a xml based "salad dressing" file that hal uses to
inject more information to a specific device listing of hal.
In usb modem case it adds <append key="modem.command_sets"
type="strlist">IS-707-A</append> i.e the commandset info for
cdma2000.
c. Network manager walks the device list searching for the string
IS-707-A and "detects" the modem as usb modem.
A sample listing from that file :
<!-- Novatel -->
<match key="@info.parent:usb.vendor_id" int="0x1410">
<!-- Merlin XS620/S640,S620,EX720,S720,EV620
CDMA/EV-DO,ES620/Merlin ES720/Ovation U720,ES620 SM Bus,U727 -->
<match key="@info.parent:usb.product_id"
int_outof="0x1100;0x1110;0x1410;0x1120;0x1130;0x2100;0x2110;0x2130;0x4100;0x5010">
<match key="@info.parent:usb.interface.number" int="0">
<append key="modem.command_sets" type="strlist">IS-707-A</append>
</match>
</match>
Where to get this information from to create a new entry ???
hal-device ofcourse !!!!!!
So I created the following entry just under the Novatel entry.
<!-- BSNL -->
<match key="@info.parent:usb.vendor_id" int="0x5c6">
<!-- ZTE EVDO AC8700 -->
<match key="@info.parent:usb.product_id" int_outof="0x3197">
<match key="@info.parent:usb.interface.number" int="0">
<append key="modem.command_sets" type="strlist">IS-707-A</append>
</match>
</match>
</match>
the vendor id and product id I gleaned from the hal-device o/p after
the modem driver was loaded by hal.
Bingo ! now when i connected the modem it listed in Network manager
applet automatically and I was able to configure it and use network
manager to connect to BSNL EVDO !!!!! No more gnome-ppp madness.
Next task on hand. How to vary the baud rate that networkmanager uses
for the modem. Cya till then !
If you need any info do ask !
regards,
C
More information about the Plug-mail
mailing list