30 #include <linux/errno.h>
32 #include <linux/pci.h>
33 #include <linux/device.h>
35 #include <linux/random.h>
36 #include <linux/export.h>
54 unsigned expected_event)
60 dev_err(dev,
"%s: unexpected context id 0x%02x "
61 "(expected 0x%02x)\n", cmd,
67 dev_err(dev,
"%s: unexpected event type 0x%02x "
68 "(expected 0x%02x)\n", cmd,
74 dev_err(dev,
"%s: unexpected event 0x%04x "
75 "(expected 0x%04x)\n", cmd,
106 }
while (context == 0x00 || context == 0xff);
108 result = i1480->
cmd(i1480, cmd_name, cmd_size);
122 dev_err(i1480->
dev,
"%s: command reply reception failed: %zd\n",
133 0, 0xfd, 0x0022) == 0) {
140 if (result != reply_size) {
141 dev_err(i1480->
dev,
"%s returned only %zu bytes, %zu expected\n",
142 cmd_name, result, reply_size);
148 expected_type, expected_event);
161 result = i1480->
read(i1480, 0x80080000, 2 *
sizeof(*buf));
163 dev_err(i1480->
dev,
"cannot read U & L states: %d\n", result);
166 dev_info(i1480->
dev,
"state U 0x%08x, L 0x%08x\n", buf[0], buf[1]);
182 if (result < 0 && result != -
ENOENT) {
183 i1480_print_state(i1480);
189 dev_err(i1480->
dev,
"Cannot locate MAC FW file '%s'\n",
192 i1480_print_state(i1480);
196 if (result < 0 && result != -
ENOENT) {
197 i1480_print_state(i1480);
198 goto error_rc_release;
204 dev_info(i1480->
dev,
"firmware uploaded successfully\n");