.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * QLogic qlcnic NIC Driver |
---|
3 | 4 | * Copyright (c) 2009-2013 QLogic Corporation |
---|
4 | | - * |
---|
5 | | - * See LICENSE.qlcnic for copyright and licensing details. |
---|
6 | 5 | */ |
---|
7 | 6 | |
---|
8 | 7 | #ifndef __QLCNIC_DCBX_H |
---|
.. | .. |
---|
42 | 41 | unsigned long state; |
---|
43 | 42 | }; |
---|
44 | 43 | |
---|
45 | | -static inline void qlcnic_clear_dcb_ops(struct qlcnic_dcb *dcb) |
---|
46 | | -{ |
---|
47 | | - kfree(dcb); |
---|
48 | | -} |
---|
49 | | - |
---|
50 | 44 | static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_dcb *dcb) |
---|
51 | 45 | { |
---|
52 | 46 | if (dcb && dcb->ops->get_hw_capability) |
---|
53 | 47 | return dcb->ops->get_hw_capability(dcb); |
---|
54 | 48 | |
---|
55 | | - return 0; |
---|
| 49 | + return -EOPNOTSUPP; |
---|
56 | 50 | } |
---|
57 | 51 | |
---|
58 | 52 | static inline void qlcnic_dcb_free(struct qlcnic_dcb *dcb) |
---|
.. | .. |
---|
66 | 60 | if (dcb && dcb->ops->attach) |
---|
67 | 61 | return dcb->ops->attach(dcb); |
---|
68 | 62 | |
---|
69 | | - return 0; |
---|
| 63 | + return -EOPNOTSUPP; |
---|
70 | 64 | } |
---|
71 | 65 | |
---|
72 | 66 | static inline int |
---|
.. | .. |
---|
75 | 69 | if (dcb && dcb->ops->query_hw_capability) |
---|
76 | 70 | return dcb->ops->query_hw_capability(dcb, buf); |
---|
77 | 71 | |
---|
78 | | - return 0; |
---|
| 72 | + return -EOPNOTSUPP; |
---|
79 | 73 | } |
---|
80 | 74 | |
---|
81 | 75 | static inline void qlcnic_dcb_get_info(struct qlcnic_dcb *dcb) |
---|
.. | .. |
---|
90 | 84 | if (dcb && dcb->ops->query_cee_param) |
---|
91 | 85 | return dcb->ops->query_cee_param(dcb, buf, type); |
---|
92 | 86 | |
---|
93 | | - return 0; |
---|
| 87 | + return -EOPNOTSUPP; |
---|
94 | 88 | } |
---|
95 | 89 | |
---|
96 | 90 | static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb) |
---|
.. | .. |
---|
98 | 92 | if (dcb && dcb->ops->get_cee_cfg) |
---|
99 | 93 | return dcb->ops->get_cee_cfg(dcb); |
---|
100 | 94 | |
---|
101 | | - return 0; |
---|
| 95 | + return -EOPNOTSUPP; |
---|
102 | 96 | } |
---|
103 | 97 | |
---|
104 | 98 | static inline void qlcnic_dcb_aen_handler(struct qlcnic_dcb *dcb, void *msg) |
---|
.. | .. |
---|
113 | 107 | dcb->ops->init_dcbnl_ops(dcb); |
---|
114 | 108 | } |
---|
115 | 109 | |
---|
116 | | -static inline void qlcnic_dcb_enable(struct qlcnic_dcb *dcb) |
---|
| 110 | +static inline int qlcnic_dcb_enable(struct qlcnic_dcb *dcb) |
---|
117 | 111 | { |
---|
118 | | - if (dcb && qlcnic_dcb_attach(dcb)) |
---|
119 | | - qlcnic_clear_dcb_ops(dcb); |
---|
| 112 | + return dcb ? qlcnic_dcb_attach(dcb) : 0; |
---|
120 | 113 | } |
---|
121 | 114 | #endif |
---|