The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/qat/qat_api/freebsd_module.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* SPDX-License-Identifier: BSD-3-Clause */
    2 /* Copyright(c) 2007-2022 Intel Corporation */
    3 /* $FreeBSD$ */
    4 #include "adf_cfg.h"
    5 #include "cpa.h"
    6 #include "icp_accel_devices.h"
    7 #include "adf_common_drv.h"
    8 #include "icp_adf_debug.h"
    9 #include "icp_adf_init.h"
   10 #include "lac_sal_ctrl.h"
   11 
   12 extern struct mtx *adfDevicesLock;
   13 
   14 static int
   15 adf_module_load(void)
   16 {
   17         CpaStatus ret = CPA_STATUS_SUCCESS;
   18 
   19         qatUtilsMutexInit(&adfDevicesLock);
   20         ret = SalCtrl_AdfServicesRegister();
   21         if (ret != CPA_STATUS_SUCCESS) {
   22                 qatUtilsMutexDestroy(&adfDevicesLock);
   23                 return EFAULT;
   24         }
   25 
   26         return 0;
   27 }
   28 
   29 static int
   30 adf_module_unload(void)
   31 {
   32         CpaStatus ret = CPA_STATUS_SUCCESS;
   33 
   34         ret = SalCtrl_AdfServicesUnregister();
   35         if (ret != CPA_STATUS_SUCCESS) {
   36                 return EBUSY;
   37         }
   38         qatUtilsMutexDestroy(&adfDevicesLock);
   39 
   40         return 0;
   41 }
   42 
   43 static int
   44 adf_modevent(module_t mod, int type, void *arg)
   45 {
   46         int error;
   47 
   48         switch (type) {
   49         case MOD_LOAD:
   50                 error = adf_module_load();
   51                 break;
   52         case MOD_UNLOAD:
   53                 error = adf_module_unload();
   54                 break;
   55         default:
   56                 error = EOPNOTSUPP;
   57                 break;
   58         }
   59 
   60         return (error);
   61 }
   62 
   63 static moduledata_t adf_mod = { "qat_api", adf_modevent, 0 };
   64 
   65 DECLARE_MODULE(qat_api, adf_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND);
   66 MODULE_VERSION(qat_api, 1);
   67 MODULE_DEPEND(qat_api, qat_common, 1, 1, 1);
   68 MODULE_DEPEND(qat_api, linuxkpi, 1, 1, 1);

Cache object: 901a3012395795bcaef163f4b8622462


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.