Lines Matching +full:read +full:- +full:out
1 /*-
4 * SPDX-License-Identifier: BSD-2-Clause
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * Based on Linux BlueZ BlueFW-0.9 package
75 while ((x = getopt(argc, argv, "f:hn:m:")) != -1) { in main()
85 case 'm': /* Mini-driver */ in main()
122 int fd = -1, error = -1; in bcmfw_check_device()
129 goto out; in bcmfw_check_device()
136 goto out; in bcmfw_check_device()
144 error = -1; in bcmfw_check_device()
147 out: in bcmfw_check_device()
148 if (fd != -1) in bcmfw_check_device()
162 int intr = -1, bulk = -1, fd = -1, error = -1, len; in bcmfw_load_firmware()
169 goto out; in bcmfw_load_firmware()
177 goto out; in bcmfw_load_firmware()
181 * Load mini-driver in bcmfw_load_firmware()
187 goto out; in bcmfw_load_firmware()
191 len = read(fd, buf, sizeof(buf)); in bcmfw_load_firmware()
193 syslog(LOG_ERR, "Could not read(%s). %s (%d)", in bcmfw_load_firmware()
195 goto out; in bcmfw_load_firmware()
205 goto out; in bcmfw_load_firmware()
210 fd = -1; in bcmfw_load_firmware()
221 goto out; in bcmfw_load_firmware()
224 if (read(intr, buf, sizeof(buf)) < 0) { in bcmfw_load_firmware()
225 syslog(LOG_ERR, "Could not read(/dev/%s.%d). %s (%d)", in bcmfw_load_firmware()
227 goto out; in bcmfw_load_firmware()
232 goto out; in bcmfw_load_firmware()
242 goto out; in bcmfw_load_firmware()
246 len = read(fd, buf, sizeof(buf)); in bcmfw_load_firmware()
248 syslog(LOG_ERR, "Could not read(%s). %s (%d)", in bcmfw_load_firmware()
250 goto out; in bcmfw_load_firmware()
260 goto out; in bcmfw_load_firmware()
265 fd = -1; in bcmfw_load_firmware()
267 if (read(intr, buf, sizeof(buf)) < 0) { in bcmfw_load_firmware()
268 syslog(LOG_ERR, "Could not read(/dev/%s.%d). %s (%d)", in bcmfw_load_firmware()
270 goto out; in bcmfw_load_firmware()
276 goto out; in bcmfw_load_firmware()
281 out: in bcmfw_load_firmware()
282 if (fd != -1) in bcmfw_load_firmware()
284 if (bulk != -1) in bcmfw_load_firmware()
286 if (intr != -1) in bcmfw_load_firmware()
300 "Usage: %s -n name -m md_file -f fw_file\n" in bcmfw_usage()
302 "\t-n name device name\n" \ in bcmfw_usage()
303 "\t-m mini-driver image mini-driver image file name for download\n" \ in bcmfw_usage()
304 "\t-f firmware image firmware image file name for download\n" \ in bcmfw_usage()
305 "\t-h display this message\n", BCMFW); in bcmfw_usage()