Lines Matching defs:sock
85 void pcc_iorw(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int wr, int flag)
93 pcc_socket_t *t = &socket[sock];
125 pcc_set(sock, PCCR, 0);
131 pcc_set(sock, PCMOD, PCMOD_AS_IO | cbsz | need_ex);
132 pcc_set(sock, PCADR, addr & 0x1ff00000);
137 pcc_set(sock, PCCR, 1);
210 if ((addr = pcc_get(sock, PCIRC)) & PCIRC_BWERR) {
213 pcc_set(sock, PCIRC, addr);
228 void pcc_ioread(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int flag) {
229 pcc_iorw(sock, port, buf, size, nmemb, 0, flag);
232 void pcc_iowrite(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int flag) {
233 pcc_iorw(sock, port, buf, size, nmemb, 1, flag);
256 static unsigned int pcc_get(u_short sock, unsigned int reg)
258 return inl(socket[sock].base + reg);
262 static void pcc_set(u_short sock, unsigned int reg, unsigned int data)
264 outl(data, socket[sock].base + reg);
276 static int __init is_alive(u_short sock)
281 stat = pcc_get(sock, PCIRC);
284 printk("m32r_pcc: No Card is detected at socket %d : stat = 0x%08x\n",stat,sock);
288 printk("m32r_pcc: Insertion fail (%.8x) at socket %d\n",stat,sock);
290 printk("m32r_pcc: Card is Inserted at socket %d(%.8x)\n",sock,stat);
388 static int _pcc_get_status(u_short sock, u_int *value)
392 status = pcc_get(sock,PCIRC);
396 status = pcc_get(sock,PCCR);
400 status = pcc_get(sock,PCCSIGCR);
403 pr_debug("m32r_pcc: GetStatus(%d) = %#4.4x\n", sock, *value);
409 static int _pcc_set_socket(u_short sock, socket_state_t *state)
414 "io_irq %d, csc_mask %#2.2x)", sock, state->flags,
439 pcc_set(sock,PCCSIGCR,reg);
466 static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io)
471 "%#llx-%#llx)\n", sock, io->map, io->flags,
481 static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem)
487 pcc_socket_t *t = &socket[sock];
492 "%#llx, %#x)\n", sock, map, mem->flags,
514 pcc_set(sock, PCCR, 0);
526 pcc_set(sock, PCMOD, mode);
532 pcc_set(sock, PCADR, addr);
539 pcc_set(sock, PCCR, 1);
568 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
570 if (socket[sock].flags & IS_ALIVE) {
574 LOCKED(_pcc_get_status(sock, value));
579 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
581 if (socket[sock].flags & IS_ALIVE)
584 LOCKED(_pcc_set_socket(sock, state));
589 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
591 if (socket[sock].flags & IS_ALIVE)
593 LOCKED(_pcc_set_io_map(sock, io));
598 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
600 if (socket[sock].flags & IS_ALIVE)
602 LOCKED(_pcc_set_mem_map(sock, mem));