FreeBSD kernel CXGB device code
cxgb_t3fw.c
Go to the documentation of this file.
1/*
2 * from: FreeBSD: src/sys/tools/fw_stub.awk,v 1.6 2007/03/02 11:42:53 flz
3 */
4#include <sys/cdefs.h>
5__FBSDID("$FreeBSD$");
6#include <sys/param.h>
7#include <sys/errno.h>
8#include <sys/kernel.h>
9#include <sys/module.h>
10#include <sys/linker.h>
11#include <sys/firmware.h>
12#include <sys/systm.h>
13#include <cxgb_t3fw.h>
14#include <t3b_protocol_sram.h>
15#include <t3b_tp_eeprom.h>
16#include <t3c_protocol_sram.h>
17#include <t3c_tp_eeprom.h>
18
19static int
20cxgb_t3fw_modevent(module_t mod, int type, void *unused)
21{
22 const struct firmware *fp;
23 int error;
24 switch (type) {
25 case MOD_LOAD:
26
27 fp = firmware_register("cxgb_t3fw", t3fw,
28 (size_t)t3fw_length,
29 0, NULL);
30 if (fp == NULL)
31 goto fail_0;
32 return (0);
33 fail_0:
34 return (ENXIO);
35 case MOD_UNLOAD:
36 error = firmware_unregister("cxgb_t3fw");
37 return (error);
38 }
39 return (EINVAL);
40}
41
42static moduledata_t cxgb_t3fw_mod = {
43 "cxgb_t3fw",
45 0
46};
47DECLARE_MODULE(cxgb_t3fw, cxgb_t3fw_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
48MODULE_VERSION(cxgb_t3fw, 1);
49MODULE_DEPEND(cxgb_t3fw, firmware, 1, 1, 1);
50
51static int
52cxgb_t3b_protocol_sram_modevent(module_t mod, int type, void *unused)
53{
54 const struct firmware *fp;
55 int error;
56 switch (type) {
57 case MOD_LOAD:
58
59 fp = firmware_register("cxgb_t3b_protocol_sram", t3b_protocol_sram,
61 0, NULL);
62 if (fp == NULL)
63 goto fail_0;
64 return (0);
65 fail_0:
66 return (ENXIO);
67 case MOD_UNLOAD:
68 error = firmware_unregister("cxgb_t3b_protocol_sram");
69 return (error);
70 }
71 return (EINVAL);
72}
73
74static moduledata_t cxgb_t3b_protocol_sram_mod = {
75 "cxgb_t3b_protocol_sram",
77 0
78};
79DECLARE_MODULE(cxgb_t3b_protocol_sram, cxgb_t3b_protocol_sram_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
80MODULE_VERSION(cxgb_t3b_protocol_sram, 1);
81MODULE_DEPEND(cxgb_t3b_protocol_sram, firmware, 1, 1, 1);
82
83static int
84cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused)
85{
86 const struct firmware *fp;
87 int error;
88 switch (type) {
89 case MOD_LOAD:
90
91 fp = firmware_register("cxgb_t3b_tp_eeprom", t3b_tp_eeprom,
93 0, NULL);
94 if (fp == NULL)
95 goto fail_0;
96 return (0);
97 fail_0:
98 return (ENXIO);
99 case MOD_UNLOAD:
100 error = firmware_unregister("cxgb_t3b_tp_eeprom");
101 return (error);
102 }
103 return (EINVAL);
104}
105
106static moduledata_t cxgb_t3b_tp_eeprom_mod = {
107 "cxgb_t3b_tp_eeprom",
109 0
110};
111DECLARE_MODULE(cxgb_t3b_tp_eeprom, cxgb_t3b_tp_eeprom_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
112MODULE_VERSION(cxgb_t3b_tp_eeprom, 1);
113MODULE_DEPEND(cxgb_t3b_tp_eeprom, firmware, 1, 1, 1);
114
115static int
116cxgb_t3c_protocol_sram_modevent(module_t mod, int type, void *unused)
117{
118 const struct firmware *fp;
119 int error;
120 switch (type) {
121 case MOD_LOAD:
122
123 fp = firmware_register("cxgb_t3c_protocol_sram", t3c_protocol_sram,
125 0, NULL);
126 if (fp == NULL)
127 goto fail_0;
128 return (0);
129 fail_0:
130 return (ENXIO);
131 case MOD_UNLOAD:
132 error = firmware_unregister("cxgb_t3c_protocol_sram");
133 return (error);
134 }
135 return (EINVAL);
136}
137
138static moduledata_t cxgb_t3c_protocol_sram_mod = {
139 "cxgb_t3c_protocol_sram",
141 0
142};
143DECLARE_MODULE(cxgb_t3c_protocol_sram, cxgb_t3c_protocol_sram_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
144MODULE_VERSION(cxgb_t3c_protocol_sram, 1);
145MODULE_DEPEND(cxgb_t3c_protocol_sram, firmware, 1, 1, 1);
146
147static int
148cxgb_t3c_tp_eeprom_modevent(module_t mod, int type, void *unused)
149{
150 const struct firmware *fp;
151 int error;
152 switch (type) {
153 case MOD_LOAD:
154
155 fp = firmware_register("cxgb_t3c_tp_eeprom", t3c_tp_eeprom,
156 (size_t)t3c_tp_eeprom_length,
157 0, NULL);
158 if (fp == NULL)
159 goto fail_0;
160 return (0);
161 fail_0:
162 return (ENXIO);
163 case MOD_UNLOAD:
164 error = firmware_unregister("cxgb_t3c_tp_eeprom");
165 return (error);
166 }
167 return (EINVAL);
168}
169
170static moduledata_t cxgb_t3c_tp_eeprom_mod = {
171 "cxgb_t3c_tp_eeprom",
173 0
174};
175DECLARE_MODULE(cxgb_t3c_tp_eeprom, cxgb_t3c_tp_eeprom_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
176MODULE_VERSION(cxgb_t3c_tp_eeprom, 1);
177MODULE_DEPEND(cxgb_t3c_tp_eeprom, firmware, 1, 1, 1);
static int cxgb_t3c_tp_eeprom_modevent(module_t mod, int type, void *unused)
Definition: cxgb_t3fw.c:148
static int cxgb_t3c_protocol_sram_modevent(module_t mod, int type, void *unused)
Definition: cxgb_t3fw.c:116
static moduledata_t cxgb_t3b_tp_eeprom_mod
Definition: cxgb_t3fw.c:106
static int cxgb_t3fw_modevent(module_t mod, int type, void *unused)
Definition: cxgb_t3fw.c:20
static moduledata_t cxgb_t3c_protocol_sram_mod
Definition: cxgb_t3fw.c:138
__FBSDID("$FreeBSD$")
static int cxgb_t3b_protocol_sram_modevent(module_t mod, int type, void *unused)
Definition: cxgb_t3fw.c:52
MODULE_VERSION(cxgb_t3fw, 1)
static moduledata_t cxgb_t3fw_mod
Definition: cxgb_t3fw.c:42
MODULE_DEPEND(cxgb_t3fw, firmware, 1, 1, 1)
static int cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused)
Definition: cxgb_t3fw.c:84
static moduledata_t cxgb_t3c_tp_eeprom_mod
Definition: cxgb_t3fw.c:170
DECLARE_MODULE(cxgb_t3fw, cxgb_t3fw_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST)
static moduledata_t cxgb_t3b_protocol_sram_mod
Definition: cxgb_t3fw.c:74
static unsigned char t3fw[30976]
Definition: cxgb_t3fw.h:37
static unsigned int t3fw_length
Definition: cxgb_t3fw.h:36
static unsigned char t3b_protocol_sram[2564]
static unsigned int t3b_protocol_sram_length
static unsigned int t3b_tp_eeprom_length
Definition: t3b_tp_eeprom.h:36
static unsigned char t3b_tp_eeprom[2116]
Definition: t3b_tp_eeprom.h:37
static unsigned char t3c_protocol_sram[2564]
static unsigned int t3c_protocol_sram_length
static unsigned int t3c_tp_eeprom_length
Definition: t3c_tp_eeprom.h:36
static unsigned char t3c_tp_eeprom[2116]
Definition: t3c_tp_eeprom.h:37