X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Ftpl_drv_common.h;h=ebc9130dab4d72de0f86322fc549d2796cc9e8f9;hb=6e1cf1d50bca85f01b5f802b1a76f090e362bf05;hp=f281c0ee334e2be229cf7f9de505a28180fac5f5;hpb=b3fa9a08edcbc459bd8e9df73186e292470ebfc3;p=tpg%2Facess2.git diff --git a/Kernel/include/tpl_drv_common.h b/Kernel/include/tpl_drv_common.h index f281c0ee..ebc9130d 100644 --- a/Kernel/include/tpl_drv_common.h +++ b/Kernel/include/tpl_drv_common.h @@ -78,10 +78,31 @@ enum eTplDrv_IOCtl { DRV_IOCTL_LOOKUP }; -//! \brief eTplDrv_IOCtl.DRV_IOCTL_LOOKUP names for the core IOCtls -//! These are the official lookup names of the core calls +/** + * \brief eTplDrv_IOCtl.DRV_IOCTL_LOOKUP names for the core IOCtls + * These are the official lookup names of the core calls + */ #define DRV_IOCTLNAMES "type", "ident", "version", "lookup" +/** + * \brief Helper macro for the base IOCtl calls + * \param _type Type number from eTplDrv_Type to return + * \param _ident String of max 32-characters that identifies this driver + * \param _version Driver's 8.8.8 BCD version number + * \param _ioctls Pointer to the IOCtls string array + * \warning If you have DEBUG enabled in the calling file, this function + * will do LEAVE()s before returning, so make sure that the + * IOCtl function is ENTER()ed when using debug with this macro + * + * Usage: (Id is the IOCtl call ID) + * \code + * switch(Id) + * { + * BASE_IOCTLS(DRV_TYPE_MISC, "Ident", 0x100, csaIOCtls) + * // Your IOCtls go here, starting at index 4 + * } + * \endcode + */ #define BASE_IOCTLS(_type, _ident, _version, _ioctls) \ case DRV_IOCTL_TYPE: LEAVE('i', (_type)); return (_type);\ case DRV_IOCTL_IDENT: {\ @@ -90,7 +111,7 @@ enum eTplDrv_IOCtl { }\ case DRV_IOCTL_VERSION: LEAVE('x', (_version)); return (_version);\ case DRV_IOCTL_LOOKUP:{\ - int tmp = ModUtil_LookupString( (char**)(_ioctls), (char*)Data );\ + int tmp = ModUtil_LookupString( _ioctls, (const char*)Data );\ LEAVE('i', tmp);\ return tmp;\ }