Lines Matching +full:pre +full:- +full:filled
5 * Copyright (C) 2005-2006 Intel Corporation
6 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
20 * 02110-1301, USA.
29 #include "i1480-dfu.h"
39 * i1480_rceb_check - Check RCEB for expected field values
50 * Return 0 if @rceb matches the expected values, -EINVAL otherwise.
57 struct device *dev = i1480->dev; in i1480_rceb_check()
58 if (rceb->bEventContext != context) { in i1480_rceb_check()
62 rceb->bEventContext, context); in i1480_rceb_check()
63 result = -EINVAL; in i1480_rceb_check()
65 if (rceb->bEventType != expected_type) { in i1480_rceb_check()
69 rceb->bEventType, expected_type); in i1480_rceb_check()
70 result = -EINVAL; in i1480_rceb_check()
72 if (le16_to_cpu(rceb->wEvent) != expected_event) { in i1480_rceb_check()
76 le16_to_cpu(rceb->wEvent), expected_event); in i1480_rceb_check()
77 result = -EINVAL; in i1480_rceb_check()
87 * Command data has to be in i1480->cmd_buf.
89 * @returns size of the reply data filled in i1480->evt_buf or < 0 errno
96 struct uwb_rceb *reply = i1480->evt_buf; in i1480_cmd()
97 struct uwb_rccb *cmd = i1480->cmd_buf; in i1480_cmd()
98 u16 expected_event = reply->wEvent; in i1480_cmd()
99 u8 expected_type = reply->bEventType; in i1480_cmd()
102 init_completion(&i1480->evt_complete); in i1480_cmd()
103 i1480->evt_result = -EINPROGRESS; in i1480_cmd()
107 cmd->bCommandContext = context; in i1480_cmd()
108 result = i1480->cmd(i1480, cmd_name, cmd_size); in i1480_cmd()
113 &i1480->evt_complete, HZ); in i1480_cmd()
115 result = -ETIMEDOUT; in i1480_cmd()
120 result = i1480->evt_result; in i1480_cmd()
122 dev_err(i1480->dev, "%s: command reply reception failed: %zd\n", in i1480_cmd()
132 if (i1480_rceb_check(i1480, i1480->evt_buf, NULL, in i1480_cmd()
135 result = i1480->wait_init_done(i1480); in i1480_cmd()
138 result = i1480->evt_result; in i1480_cmd()
141 dev_err(i1480->dev, "%s returned only %zu bytes, %zu expected\n", in i1480_cmd()
143 result = -EINVAL; in i1480_cmd()
147 result = i1480_rceb_check(i1480, i1480->evt_buf, cmd_name, context, in i1480_cmd()
159 u32 *buf = (u32 *) i1480->cmd_buf; in i1480_print_state()
161 result = i1480->read(i1480, 0x80080000, 2 * sizeof(*buf)); in i1480_print_state()
163 dev_err(i1480->dev, "cannot read U & L states: %d\n", result); in i1480_print_state()
166 dev_info(i1480->dev, "state U 0x%08x, L 0x%08x\n", buf[0], buf[1]); in i1480_print_state()
181 result = i1480_pre_fw_upload(i1480); /* PHY pre fw */ in i1480_fw_upload()
182 if (result < 0 && result != -ENOENT) { in i1480_fw_upload()
188 if (result == -ENOENT) in i1480_fw_upload()
189 dev_err(i1480->dev, "Cannot locate MAC FW file '%s'\n", in i1480_fw_upload()
190 i1480->mac_fw_name); in i1480_fw_upload()
196 if (result < 0 && result != -ENOENT) { in i1480_fw_upload()
204 dev_info(i1480->dev, "firmware uploaded successfully\n"); in i1480_fw_upload()
206 if (i1480->rc_release) in i1480_fw_upload()
207 i1480->rc_release(i1480); in i1480_fw_upload()