Unable to Delete Device - VxWorks

This is a discussion on Unable to Delete Device - VxWorks ; Hi All, I am writing a device driver in VxWorks.... Got a problem ...with deleting the deivce with the vxworks API when the device is removed from the system.... I m trying to use the iosDevDelete() to Delete the device ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Unable to Delete Device

  1. Unable to Delete Device

    Hi All,

    I am writing a device driver in VxWorks.... Got a problem ...with
    deleting the deivce with the vxworks API when the device is removed
    from the system....

    I m trying to use the iosDevDelete() to Delete the device ...

    Query:
    1.Do I have to close all the File descriptors for the device before
    deleting it..?
    2. Do I have to free the device descriptor memory dynamically allocated
    while creating the device separately or iosDevDelete will take care of
    that ?
    3.Is there any API or method of relating a FD to the device descriptor
    of the device?


    Thanks In Advance..

    Abhijit


  2. Re: Unable to Delete Device

    Abhijit:

    The iosDevDelete call is pretty straigtforward - it just deletes the
    device from the vxWorks device tables - it's doesn't even talk with
    your driver that you installed.


    I think the comment header from vxWorks summarizes it well...

    * This routine deletes a device from the I/O system device list, making
    it
    * unavailable to subsequent open() or creat() calls. No interaction
    with
    * the driver occurs, and any file descriptors open on the device or
    pending
    * operations are unaffected.

    iosFdFree will free up all the descriptors. Any memory your driver
    allocated during init will stay with it unless you have some provision
    to free it.

    Good luck,

    LC


    Maverick wrote:
    > Hi All,
    >
    > I am writing a device driver in VxWorks.... Got a problem ...with
    > deleting the deivce with the vxworks API when the device is removed
    > from the system....
    >
    > I m trying to use the iosDevDelete() to Delete the device ...
    >
    > Query:
    > 1.Do I have to close all the File descriptors for the device before
    > deleting it..?
    > 2. Do I have to free the device descriptor memory dynamically allocated
    > while creating the device separately or iosDevDelete will take care of
    > that ?
    > 3.Is there any API or method of relating a FD to the device descriptor
    > of the device?
    >
    >
    > Thanks In Advance..
    >
    > Abhijit



  3. Re: Unable to Delete Device


    Thanx A lot Larry....I found a lot of help in the iosLib.h header
    file....

    iosFdDevFind() is the API that suited my appliction....Just a another
    query whats the differnence between iosFdFree(),iosClose(),and close()
    .....


    Abhijit


  4. Re: Unable to Delete Device

    Maverik -

    close() is the user-level iosLib call to close a file. It in turns
    calls iosClose with the fd, which looks up the "close" entry point that
    your device driver previouly registered with vxworks.

    When the device is closes (your driver "close" functions returns),
    iosFdFree is called to free up the fd.

    HTH,

    LC


    Maverick wrote:
    > Thanx A lot Larry....I found a lot of help in the iosLib.h header
    > file....
    >
    > iosFdDevFind() is the API that suited my appliction....Just a another
    > query whats the differnence between iosFdFree(),iosClose(),and close()
    > ....
    >
    >
    > Abhijit



+ Reply to Thread