uint cf_init_intf_priv(struct intf_priv *pintfpriv) { _func_enter_; pintfpriv->max_xmitsz = 512; pintfpriv->max_recvsz = 512; pintfpriv->max_iosz = 128; pintfpriv->intf_status = 0; pintfpriv->io_wsz = 0; pintfpriv->io_rsz = 0; _rwlock_init(&pintfpriv->rwlock); pintfpriv->allocated_io_rwmem = (volatile u8 *)_malloc(pintfpriv->max_xmitsz +4); if (pintfpriv->allocated_io_rwmem == NULL) goto cfio_init_intf_priv_fail; pintfpriv->io_rwmem = pintfpriv->allocated_io_rwmem + 4\ - ( (u32)(pintfpriv->allocated_io_rwmem) & 3); _func_exit_; return _SUCCESS; cfio_init_intf_priv_fail: if (pintfpriv->allocated_io_rwmem) _mfree((u8 *)pintfpriv->allocated_io_rwmem, pintfpriv->max_xmitsz +4); _func_exit_; return _FAIL; }
void _cklock_init(cklock_t *lock, const char *file, const char *func, const int line) { _mutex_init(&lock->mutex, file, func, line); _rwlock_init(&lock->rwlock, file, func, line); }