]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_resource.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / dev / cxgb / ulp / iw_cxgb / iw_cxgb_resource.h
1 /**************************************************************************
2
3 Copyright (c) 2007, 2008 Chelsio Inc.
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8
9  1. Redistributions of source code must retain the above copyright notice,
10     this list of conditions and the following disclaimer.
11
12  2. Neither the name of the Chelsio Corporation nor the names of its
13     contributors may be used to endorse or promote products derived from
14     this software without specific prior written permission.
15
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 POSSIBILITY OF SUCH DAMAGE.
27
28 $FreeBSD$
29
30 ***************************************************************************/
31 #ifndef __CXIO_RESOURCE_H__
32 #define __CXIO_RESOURCE_H__
33
34 extern int cxio_hal_init_rhdl_resource(u32 nr_rhdl);
35 extern void cxio_hal_destroy_rhdl_resource(void);
36 extern int cxio_hal_init_resource(struct cxio_rdev *rdev_p,
37                                   u32 nr_tpt, u32 nr_pbl,
38                                   u32 nr_rqt, u32 nr_qpid, u32 nr_cqid,
39                                   u32 nr_pdid);
40 extern u32 cxio_hal_get_stag(struct cxio_hal_resource *rscp);
41 extern void cxio_hal_put_stag(struct cxio_hal_resource *rscp, u32 stag);
42 extern u32 cxio_hal_get_qpid(struct cxio_hal_resource *rscp);
43 extern void cxio_hal_put_qpid(struct cxio_hal_resource *rscp, u32 qpid);
44 extern u32 cxio_hal_get_cqid(struct cxio_hal_resource *rscp);
45 extern void cxio_hal_put_cqid(struct cxio_hal_resource *rscp, u32 cqid);
46 extern void cxio_hal_destroy_resource(struct cxio_hal_resource *rscp);
47
48 #define PBL_OFF(rdev_p, a) ( (a) - (rdev_p)->rnic_info.pbl_base )
49 extern int cxio_hal_pblpool_create(struct cxio_rdev *rdev_p);
50 extern void cxio_hal_pblpool_destroy(struct cxio_rdev *rdev_p);
51 extern u32 cxio_hal_pblpool_alloc(struct cxio_rdev *rdev_p, int size);
52 extern void cxio_hal_pblpool_free(struct cxio_rdev *rdev_p, u32 addr, int size);
53
54 #define RQT_OFF(rdev_p, a) ( (a) - (rdev_p)->rnic_info.rqt_base )
55 extern int cxio_hal_rqtpool_create(struct cxio_rdev *rdev_p);
56 extern void cxio_hal_rqtpool_destroy(struct cxio_rdev *rdev_p);
57 extern u32 cxio_hal_rqtpool_alloc(struct cxio_rdev *rdev_p, int size);
58 extern void cxio_hal_rqtpool_free(struct cxio_rdev *rdev_p, u32 addr, int size);
59 #endif