static int read_config_dword(struct pci_bus *bus, unsigned int devfn, int where, u32 * val) { int ret; ret = config_access(PCI_ACCESS_READ_4, bus, devfn, where, val); return ret; }
static int write_config_dword(struct pci_bus *bus, unsigned int devfn, int where, u32 val) { if (config_access(PCI_ACCESS_WRITE_4, bus, devfn, where, &val)) return -1; return PCIBIOS_SUCCESSFUL; }
static int read_config_word(struct pci_bus *bus, unsigned int devfn, int where, u32 * val) { //u32 data; int ret; ret = config_access(PCI_ACCESS_READ_2, bus, devfn, where, val); //*val = (data >> ((where & 3) << 3)) & 0xffff; return ret; }
static const char *config_control(struct control **as) { const char *t = 0; struct control *a, *b; struct simple_list *l; b = *as; while (b && b->locations) b = b->next; MAKE(a, struct control); a->locations = 0; a->alias = 0; a->clients = 0; if (b) { a->index_names = b->index_names; a->accesses = b->accesses; a->mimes = b->mimes; a->symlinksok = b->symlinksok; a->path_args_ok = b->path_args_ok; a->loglevel = b->loglevel; a->admin = b->admin; a->refresh = b->refresh; } else { a->index_names = 0; a->accesses = 0; a->mimes = 0; a->symlinksok = 0; a->path_args_ok = 0; a->loglevel = 0; a->admin = 0; a->refresh = 0; } a->next = *as; *as = a; GETOPEN(); while (NOTCLOSE()) { REQWORD(); if (strceq(tokbuf, c_location)) { MAKE(l, struct simple_list); GETSTRING(); chopslash(tokbuf); COPY(l->name, tokbuf); if (a->locations) { l->next = a->locations->next; a->locations->next = l; } else { l->next = l; a->locations = l; } } else if (strceq(tokbuf, c_alias)) { GETSTRING(); chopslash(tokbuf); COPY(a->alias, tokbuf); } else if (strceq(tokbuf, c_symlinks)) t = config_flag(&a->symlinksok); else if (strceq(tokbuf, c_path_args)) t = config_flag(&a->path_args_ok); else if (strceq(tokbuf, c_loglevel)) t = config_int(&a->loglevel); else if (strceq(tokbuf, c_index_names)) t = config_list(&a->index_names); else if (strceq(tokbuf, c_access)) t = config_access(&a->accesses); else if (strceq(tokbuf, c_clients)) t = config_access(&a->clients); else if (strceq(tokbuf, c_types)) t = config_mime(&a->mimes, M_TYPE); else if (strceq(tokbuf, c_specials)) t = config_mime(&a->mimes, M_SPECIAL); else if (strceq(tokbuf, c_admin)) t = config_string(&a->admin); else if (strceq(tokbuf, c_refresh)) t = config_int(&a->refresh); else t = e_keyword; if (t) return t; } if (a->alias && (a->locations == 0)) return e_bad_alias; return 0; }
static int ar231x_pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { return config_access(devfn, where, size, &value, 1); }
static int ar231x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * value) { return config_access(devfn, where, size, value, 0); }