Lines Matching refs:fname
97 static int file_size(char *fname);
98 static int read_vars(char *fname, char *buf, int buf_maxlen);
337 file_size(char *fname) in file_size() argument
344 if ((fp = fopen(fname, "rb")) == NULL || in file_size()
348 fname, strerror(errno)); in file_size()
1221 char *fname; in dhd_sprom()
1265 fname = nocrc ? argv[2] : argv[1]; in dhd_sprom()
1268 if ((ret = file_size(fname)) < 0) in dhd_sprom()
1290 if ((fp = fopen(fname, "rb")) == NULL) { in dhd_sprom()
1292 fname, strerror(errno)); in dhd_sprom()
1298 words * 2, fname); in dhd_sprom()
1386 read_vars(char *fname, char *buf, int buf_maxlen) in read_vars() argument
1393 if ((fp = fopen(fname, "rb")) == NULL) { in read_vars()
1395 fname, strerror(errno)); in read_vars()
1427 fprintf(stderr, "Invalid line %d in NVRAM file %s\n", line_no, fname); in read_vars()
1433 fprintf(stderr, "NVRAM file %s too long\n", fname); in read_vars()
1706 char *fname = NULL; in dhd_download()
1754 if (fname && vname) { in dhd_download()
1760 if (fname) in dhd_download()
1763 fname = opts.valstr; in dhd_download()
1784 if (!fname) { in dhd_download()
1791 if ((fsize = file_size(fname)) < 0) { in dhd_download()
1796 if ((fp = fopen(fname, "rb")) == NULL) { in dhd_download()
1798 __FUNCTION__, fname, strerror(errno)); in dhd_download()
1958 char *fname = NULL; in dhd_dldn()
1988 if (fname) { in dhd_dldn()
1994 if (!fname) in dhd_dldn()
1995 fname = opts.valstr; in dhd_dldn()
2010 if (!fname) { in dhd_dldn()
2017 if ((fsize = file_size(fname)) < 0) { in dhd_dldn()
2026 __FUNCTION__, fname, fsize, ramsize); in dhd_dldn()
2032 if ((fp = fopen(fname, "rb")) == NULL) { in dhd_dldn()
2034 __FUNCTION__, fname, strerror(errno)); in dhd_dldn()
2044 fprintf(stderr, "%s: error reading file %s\n", __FUNCTION__, fname); in dhd_dldn()
2060 fprintf(stderr, "%s: error reading file %s\n", __FUNCTION__, fname); in dhd_dldn()
2084 char *fname = NULL; in dhd_upload()
2124 if (!fname) { in dhd_upload()
2125 fname = opts.valstr; in dhd_upload()
2145 if (!fname) { in dhd_upload()
2160 if ((fp = fopen(fname, "wb")) == NULL) { in dhd_upload()
2162 __FUNCTION__, fname, strerror(errno)); in dhd_upload()
2188 fprintf(stderr, "%s: error writing to file %s\n", __FUNCTION__, fname); in dhd_upload()
2273 char *fname = NULL; in dhd_coredump()
2307 if (!fname) { in dhd_coredump()
2308 fname = opts.valstr; in dhd_coredump()
2326 if (!fname) { in dhd_coredump()
2366 if ((fp = fopen(fname, "wb")) == NULL) { in dhd_coredump()
2368 __FUNCTION__, fname, strerror(errno)); in dhd_coredump()
2378 fprintf(stderr, "%s: error writing to file %s\n", __FUNCTION__, fname); in dhd_coredump()
2386 fprintf(stderr, "%s: error writing to file %s\n", __FUNCTION__, fname); in dhd_coredump()
2410 fprintf(stderr, "%s: error writing to file %s\n", __FUNCTION__, fname); in dhd_coredump()