ispfw.c (fdafd315ad0d0f28a11b9fb4476a9ab059c62b92) ispfw.c (b0c6b06836351b3908ba5b2a847c89c42d1a46c3)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * ISP Firmware Modules for FreeBSD
5 *
6 * Copyright (c) 2000, 2001, 2006 by Matthew Jacob
7 * All rights reserved.
8 *

--- 24 unchanged lines hidden (view full) ---

33#include <sys/kernel.h>
34#include <sys/linker.h>
35#include <sys/module.h>
36#include <sys/systm.h>
37
38#if defined(ISP_ALL) || !defined(KLD_MODULE)
39#define ISP_2400 1
40#define ISP_2500 1
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * ISP Firmware Modules for FreeBSD
5 *
6 * Copyright (c) 2000, 2001, 2006 by Matthew Jacob
7 * All rights reserved.
8 *

--- 24 unchanged lines hidden (view full) ---

33#include <sys/kernel.h>
34#include <sys/linker.h>
35#include <sys/module.h>
36#include <sys/systm.h>
37
38#if defined(ISP_ALL) || !defined(KLD_MODULE)
39#define ISP_2400 1
40#define ISP_2500 1
41#define ISP_2600 1
42#define ISP_2700 1
43#define ISP_2800 1
41#endif
42
43#ifndef MODULE_NAME
44#define MODULE_NAME "ispfw"
45#endif
46
47#if defined(ISP_2400)
48#include <dev/ispfw/asm_2400.h>
49#endif
50#if defined(ISP_2500)
51#include <dev/ispfw/asm_2500.h>
52#endif
44#endif
45
46#ifndef MODULE_NAME
47#define MODULE_NAME "ispfw"
48#endif
49
50#if defined(ISP_2400)
51#include <dev/ispfw/asm_2400.h>
52#endif
53#if defined(ISP_2500)
54#include <dev/ispfw/asm_2500.h>
55#endif
56#if defined(ISP_2600)
57#include <dev/ispfw/asm_2600.h>
58#endif
59#if defined(ISP_2700)
60#include <dev/ispfw/asm_2700.h>
61#endif
62#if defined(ISP_2800)
63#include <dev/ispfw/asm_2800.h>
64#endif
53
54#if defined(ISP_2400)
55static int isp_2400_loaded;
56#endif
57#if defined(ISP_2500)
58static int isp_2500_loaded;
59#endif
65
66#if defined(ISP_2400)
67static int isp_2400_loaded;
68#endif
69#if defined(ISP_2500)
70static int isp_2500_loaded;
71#endif
72#if defined(ISP_2600)
73static int isp_2600_loaded;
74#endif
75#if defined(ISP_2700)
76static int isp_2700_loaded;
77#endif
78#if defined(ISP_2800)
79static int isp_2800_loaded;
80#endif
60
61#define ISPFW_VERSION 1
62
63#define RMACRO(token) do { \
64 if (token##_loaded) \
65 break; \
66 if (firmware_register(#token, token##_risc_code, \
67 token##_risc_code[3] * sizeof(token##_risc_code[3]), \

--- 17 unchanged lines hidden (view full) ---

85{
86
87#if defined(ISP_2400)
88 RMACRO(isp_2400);
89#endif
90#if defined(ISP_2500)
91 RMACRO(isp_2500);
92#endif
81
82#define ISPFW_VERSION 1
83
84#define RMACRO(token) do { \
85 if (token##_loaded) \
86 break; \
87 if (firmware_register(#token, token##_risc_code, \
88 token##_risc_code[3] * sizeof(token##_risc_code[3]), \

--- 17 unchanged lines hidden (view full) ---

106{
107
108#if defined(ISP_2400)
109 RMACRO(isp_2400);
110#endif
111#if defined(ISP_2500)
112 RMACRO(isp_2500);
113#endif
114#if defined(ISP_2600)
115 RMACRO(isp_2600);
116#endif
117#if defined(ISP_2700)
118 RMACRO(isp_2700);
119#endif
120#if defined(ISP_2800)
121 RMACRO(isp_2800);
122#endif
93 return (0);
94}
95
96static int
97do_unload_fw(void)
98{
99 int error = 0;
100
101#if defined(ISP_2400)
102 UMACRO(isp_2400);
103#endif
104#if defined(ISP_2500)
105 UMACRO(isp_2500);
106#endif
123 return (0);
124}
125
126static int
127do_unload_fw(void)
128{
129 int error = 0;
130
131#if defined(ISP_2400)
132 UMACRO(isp_2400);
133#endif
134#if defined(ISP_2500)
135 UMACRO(isp_2500);
136#endif
137#if defined(ISP_2600)
138 UMACRO(isp_2600);
139#endif
140#if defined(ISP_2700)
141 UMACRO(isp_2700);
142#endif
143#if defined(ISP_2800)
144 UMACRO(isp_2800);
145#endif
107 return (error);
108}
109
110static int
111module_handler(module_t mod, int what, void *arg)
112{
113
114 switch (what) {

--- 8 unchanged lines hidden (view full) ---

123 MODULE_NAME, module_handler, NULL
124};
125#if defined(ISP_ALL) || !defined(KLD_MODULE)
126DECLARE_MODULE(ispfw, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
127#elif defined(ISP_2400)
128DECLARE_MODULE(isp_2400, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
129#elif defined(ISP_2500)
130DECLARE_MODULE(isp_2500, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
146 return (error);
147}
148
149static int
150module_handler(module_t mod, int what, void *arg)
151{
152
153 switch (what) {

--- 8 unchanged lines hidden (view full) ---

162 MODULE_NAME, module_handler, NULL
163};
164#if defined(ISP_ALL) || !defined(KLD_MODULE)
165DECLARE_MODULE(ispfw, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
166#elif defined(ISP_2400)
167DECLARE_MODULE(isp_2400, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
168#elif defined(ISP_2500)
169DECLARE_MODULE(isp_2500, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
170#elif defined(ISP_2600)
171DECLARE_MODULE(isp_2600, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
172#elif defined(ISP_2700)
173DECLARE_MODULE(isp_2700, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
174#elif defined(ISP_2800)
175DECLARE_MODULE(isp_2800, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
131#else
132#error "firmware not specified"
133#endif
176#else
177#error "firmware not specified"
178#endif