Re: ipw srcipts for hal



On Mon, 2007-06-25 at 18:20 +0200, dragoran wrote:
> 
> 
> On 6/25/07, Dan Williams <dcbw redhat com> wrote:
>         On Mon, 2007-06-25 at 16:09 +0200, dragoran wrote:
>         >
>         >
>         > On 6/25/07, yelo_3 <yelo_3 yahoo it> wrote:
>         >         > ok, but this does not solve the problem of
>         multiple 
>         >         killswitches (will
>         >         > show up with multiple cards) because both will
>         have
>         >         > /org/freedesktop/Hal/devices/ipw_wlan_switch as
>         uid.
>         >         Yes the previous shell script didn't solve the
>         problem... 
>         >         sorry. This might mean that the UDI should contain
>         the
>         >         interface name as you were saying
>         >         The C code misses the setrfkill section, and a !
>         =null check
>         >         when you fopen the file. 
>         >
>         > ok here is a new version.
>         > it implements setrfkill too and uses g_strdup_printf instead
>         of
>         > sprintf.
>         
>         I don't think argc == 3 is valid for the setrfkill check,
>         since the
>         number of args will still be 2...  
> 
> 
> no it should be correct
> /usr/bin/ipwWirelessCtl =1
> getrfkill = 2
> in case of setrfkill we have:
> /usr/bin/ipwWirelessCtl =1
> getrfkill = 2
> value ( 0 or 1) = 3

Oh right, sorry, I'm doing too many things at once right now.  You're
entirely correct

Dan

>  
> 
>         I'd just put a check before the
>         libhal_ctx_init() that does:
>         
>         if (argc != 2) {
>             fprintf (stderr, "Usage: ipwWirelessCtl [getrfkill]
>         [setrfkill [1|0]]\n");
>             return -1;
>         }
>         or something like that, and get rid of the argc checks for
>         getrfkill and
>         setrfkill.
>         
>         I think we should actually just reparent the device to be a
>         child of
>         Computer.  I also think the script should just rfkill
>         _everything_, and 
>         that it should return '1' if _any_ ipw radios are off.  This
>         script is
>         really only a stopgap until the _real_ kernel rfkill
>         interfaces are
>         complete, and then most these problems go away.  So instead of
>         trying to 
>         overengineer the whole thing, I think it should work like
>         this:
>         
>         a) .fdi file adds _one_ rfkill device if any ipw cards are
>         found
>         b) 'ipwWirelessCtl getrfkill' checks all ipw devices for
>         rfkill status, 
>         and if one of them is killed, it returns 1
>         c) 'ipwWirelessCtl setrfkill 1' kills _all_ ipw devices, while
>         'ipwWirelessCtl 0' re-enables _all_ ipw devices
>         
>         Sound OK?  That way we also don't have to figure out how to
>         unique-ify 
>         the device name, which the future kernel patches will handle
>         for us.
> 
> ok will update it 
> 
> 
>         I've attached an updated .fdi file for ipw devices that
>         excludes Dells,
>         and makes only _one_ killswitch device.
> 
> ok you removed the ipw3945 I will readd it and attach a new
> script/program.
> 
> 
>         Dan
>         
>         
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]