firmware.c revision 4101ce14b3f6646f3468f6a489d87d057aab7163
/*
* firmware - Load firmware device
*
* Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
* Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
*
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details:*
*/
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <getopt.h>
#include <errno.h>
#include <stdbool.h>
#include "libudev-private.h"
{
return false;
};
return true;
}
{
char *buf;
bool ret = false;
return false;
}
goto exit;
goto exit;
goto exit;
ret = true;
exit:
return ret;
}
{
{}
};
static const char *searchpath[] = { FIRMWARE_PATH };
char fwencpath[UTIL_PATH_SIZE];
char misspath[UTIL_PATH_SIZE];
char loadpath[UTIL_PATH_SIZE];
char datapath[UTIL_PATH_SIZE];
char fwpath[UTIL_PATH_SIZE];
unsigned int i;
int rc = 0;
udev_log_init("firmware");
for (;;) {
int option;
if (option == -1)
break;
switch (option) {
case 'f':
break;
case 'p':
break;
case 'h':
printf("Usage: firmware --firmware=<fwfile> --devpath=<path> [--help]\n\n");
default:
rc = 1;
goto exit;
}
}
rc = 1;
goto exit;
}
rc = 1;
goto exit;
};
/* lookup firmware file */
for (i = 0; i < ARRAY_SIZE(searchpath); i++) {
break;
break;
}
util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL);
int err;
/* This link indicates the missing firmware file and the associated device */
do {
break;
if (err != 0)
rc = 2;
goto exit;
}
rc = 3;
goto exit;
}
goto exit;
rc = 4;
goto exit;
};
exit:
return rc;
}