Lines Matching refs:np
37 void sym_nvram_setup_host(struct Scsi_Host *shost, struct sym_hcb *np, struct sym_nvram *nvram) in sym_nvram_setup_host() argument
46 np->rv_scntl0 &= ~0x0a; in sym_nvram_setup_host()
47 np->myaddr = nvram->data.Symbios.host_id & 0x0f; in sym_nvram_setup_host()
49 np->verbose += 1; in sym_nvram_setup_host()
53 np->usrflags |= SYM_AVOID_BUS_RESET; in sym_nvram_setup_host()
56 np->myaddr = nvram->data.Tekram.host_id & 0x0f; in sym_nvram_setup_host()
61 np->myaddr = nvram->data.parisc.host_id; in sym_nvram_setup_host()
63 np->minsync = nvram->data.parisc.factor; in sym_nvram_setup_host()
65 np->maxwide = nvram->data.parisc.width; in sym_nvram_setup_host()
67 case 0: np->scsi_mode = SMODE_SE; break; in sym_nvram_setup_host()
68 case 1: np->scsi_mode = SMODE_HVD; break; in sym_nvram_setup_host()
69 case 2: np->scsi_mode = SMODE_LVD; break; in sym_nvram_setup_host()
143 static void sym_display_Symbios_nvram(struct sym_device *np, Symbios_nvram *nvram) in sym_display_Symbios_nvram() argument
149 sym_name(np), nvram->host_id & 0x0f, in sym_display_Symbios_nvram()
161 sym_name(np), i, in sym_display_Symbios_nvram()
175 static void sym_display_Tekram_nvram(struct sym_device *np, Tekram_nvram *nvram) in sym_display_Tekram_nvram() argument
193 sym_name(np), nvram->host_id & 0x0f, in sym_display_Tekram_nvram()
211 sym_name(np), i, in sym_display_Tekram_nvram()
222 static void sym_display_Symbios_nvram(struct sym_device *np, Symbios_nvram *nvram) { (void)np; (voi… in sym_display_Symbios_nvram() argument
223 static void sym_display_Tekram_nvram(struct sym_device *np, Tekram_nvram *nvram) { (void)np; (void)… in sym_display_Tekram_nvram() argument
243 static void S24C16_set_bit(struct sym_device *np, u_char write_bit, u_char *gpreg, in S24C16_set_bit() argument
262 OUTB(np, nc_gpreg, *gpreg); in S24C16_set_bit()
263 INB(np, nc_mbox1); in S24C16_set_bit()
270 static void S24C16_start(struct sym_device *np, u_char *gpreg) in S24C16_start() argument
272 S24C16_set_bit(np, 1, gpreg, SET_BIT); in S24C16_start()
273 S24C16_set_bit(np, 0, gpreg, SET_CLK); in S24C16_start()
274 S24C16_set_bit(np, 0, gpreg, CLR_BIT); in S24C16_start()
275 S24C16_set_bit(np, 0, gpreg, CLR_CLK); in S24C16_start()
281 static void S24C16_stop(struct sym_device *np, u_char *gpreg) in S24C16_stop() argument
283 S24C16_set_bit(np, 0, gpreg, SET_CLK); in S24C16_stop()
284 S24C16_set_bit(np, 1, gpreg, SET_BIT); in S24C16_stop()
291 static void S24C16_do_bit(struct sym_device *np, u_char *read_bit, u_char write_bit, in S24C16_do_bit() argument
294 S24C16_set_bit(np, write_bit, gpreg, SET_BIT); in S24C16_do_bit()
295 S24C16_set_bit(np, 0, gpreg, SET_CLK); in S24C16_do_bit()
297 *read_bit = INB(np, nc_gpreg); in S24C16_do_bit()
298 S24C16_set_bit(np, 0, gpreg, CLR_CLK); in S24C16_do_bit()
299 S24C16_set_bit(np, 0, gpreg, CLR_BIT); in S24C16_do_bit()
306 static void S24C16_write_ack(struct sym_device *np, u_char write_bit, u_char *gpreg, in S24C16_write_ack() argument
309 OUTB(np, nc_gpcntl, *gpcntl & 0xfe); in S24C16_write_ack()
310 S24C16_do_bit(np, NULL, write_bit, gpreg); in S24C16_write_ack()
311 OUTB(np, nc_gpcntl, *gpcntl); in S24C16_write_ack()
318 static void S24C16_read_ack(struct sym_device *np, u_char *read_bit, u_char *gpreg, in S24C16_read_ack() argument
321 OUTB(np, nc_gpcntl, *gpcntl | 0x01); in S24C16_read_ack()
322 S24C16_do_bit(np, read_bit, 1, gpreg); in S24C16_read_ack()
323 OUTB(np, nc_gpcntl, *gpcntl); in S24C16_read_ack()
330 static void S24C16_write_byte(struct sym_device *np, u_char *ack_data, u_char write_data, in S24C16_write_byte() argument
336 S24C16_do_bit(np, NULL, (write_data >> (7 - x)) & 0x01, gpreg); in S24C16_write_byte()
338 S24C16_read_ack(np, ack_data, gpreg, gpcntl); in S24C16_write_byte()
345 static void S24C16_read_byte(struct sym_device *np, u_char *read_data, u_char ack_data, in S24C16_read_byte() argument
353 S24C16_do_bit(np, &read_bit, 1, gpreg); in S24C16_read_byte()
357 S24C16_write_ack(np, ack_data, gpreg, gpcntl); in S24C16_read_byte()
364 static int sym_write_S24C16_nvram(struct sym_device *np, int offset, in sym_write_S24C16_nvram() argument
373 old_gpreg = INB(np, nc_gpreg); in sym_write_S24C16_nvram()
374 old_gpcntl = INB(np, nc_gpcntl); in sym_write_S24C16_nvram()
378 OUTB(np, nc_gpreg, old_gpreg); in sym_write_S24C16_nvram()
379 OUTB(np, nc_gpcntl, gpcntl); in sym_write_S24C16_nvram()
383 S24C16_set_bit(np, 0, &gpreg, CLR_CLK); in sym_write_S24C16_nvram()
384 S24C16_set_bit(np, 0, &gpreg, CLR_BIT); in sym_write_S24C16_nvram()
387 S24C16_stop(np, &gpreg); in sym_write_S24C16_nvram()
392 S24C16_start(np, &gpreg); in sym_write_S24C16_nvram()
393 S24C16_write_byte(np, &ack_data, in sym_write_S24C16_nvram()
398 S24C16_write_byte(np, &ack_data, (offset+x) & 0xff, in sym_write_S24C16_nvram()
402 S24C16_write_byte(np, &ack_data, data[x+y], in sym_write_S24C16_nvram()
404 S24C16_stop(np, &gpreg); in sym_write_S24C16_nvram()
408 OUTB(np, nc_gpcntl, old_gpcntl); in sym_write_S24C16_nvram()
409 OUTB(np, nc_gpreg, old_gpreg); in sym_write_S24C16_nvram()
418 static int sym_read_S24C16_nvram(struct sym_device *np, int offset, u_char *data, int len) in sym_read_S24C16_nvram() argument
427 old_gpreg = INB(np, nc_gpreg); in sym_read_S24C16_nvram()
428 old_gpcntl = INB(np, nc_gpcntl); in sym_read_S24C16_nvram()
432 OUTB(np, nc_gpreg, old_gpreg); in sym_read_S24C16_nvram()
433 OUTB(np, nc_gpcntl, gpcntl); in sym_read_S24C16_nvram()
437 S24C16_set_bit(np, 0, &gpreg, CLR_CLK); in sym_read_S24C16_nvram()
438 S24C16_set_bit(np, 0, &gpreg, CLR_BIT); in sym_read_S24C16_nvram()
441 S24C16_stop(np, &gpreg); in sym_read_S24C16_nvram()
444 S24C16_start(np, &gpreg); in sym_read_S24C16_nvram()
447 S24C16_write_byte(np, &ack_data, in sym_read_S24C16_nvram()
453 S24C16_write_byte(np, &ack_data, in sym_read_S24C16_nvram()
459 S24C16_start(np, &gpreg); in sym_read_S24C16_nvram()
462 S24C16_write_byte(np, &ack_data, in sym_read_S24C16_nvram()
469 OUTB(np, nc_gpcntl, gpcntl); in sym_read_S24C16_nvram()
473 S24C16_read_byte(np, &data[x], (x == (len-1)), &gpreg, &gpcntl); in sym_read_S24C16_nvram()
477 OUTB(np, nc_gpcntl, gpcntl); in sym_read_S24C16_nvram()
478 S24C16_stop(np, &gpreg); in sym_read_S24C16_nvram()
482 OUTB(np, nc_gpcntl, old_gpcntl); in sym_read_S24C16_nvram()
483 OUTB(np, nc_gpreg, old_gpreg); in sym_read_S24C16_nvram()
497 static int sym_read_Symbios_nvram(struct sym_device *np, Symbios_nvram *nvram) in sym_read_Symbios_nvram() argument
506 if (sym_read_S24C16_nvram (np, SYMBIOS_NVRAM_ADDRESS, data, len)) in sym_read_Symbios_nvram()
538 static void T93C46_Clk(struct sym_device *np, u_char *gpreg) in T93C46_Clk() argument
540 OUTB(np, nc_gpreg, *gpreg | 0x04); in T93C46_Clk()
541 INB(np, nc_mbox1); in T93C46_Clk()
543 OUTB(np, nc_gpreg, *gpreg); in T93C46_Clk()
549 static void T93C46_Read_Bit(struct sym_device *np, u_char *read_bit, u_char *gpreg) in T93C46_Read_Bit() argument
552 T93C46_Clk(np, gpreg); in T93C46_Read_Bit()
553 *read_bit = INB(np, nc_gpreg); in T93C46_Read_Bit()
559 static void T93C46_Write_Bit(struct sym_device *np, u_char write_bit, u_char *gpreg) in T93C46_Write_Bit() argument
568 OUTB(np, nc_gpreg, *gpreg); in T93C46_Write_Bit()
569 INB(np, nc_mbox1); in T93C46_Write_Bit()
572 T93C46_Clk(np, gpreg); in T93C46_Write_Bit()
578 static void T93C46_Stop(struct sym_device *np, u_char *gpreg) in T93C46_Stop() argument
581 OUTB(np, nc_gpreg, *gpreg); in T93C46_Stop()
582 INB(np, nc_mbox1); in T93C46_Stop()
585 T93C46_Clk(np, gpreg); in T93C46_Stop()
591 static void T93C46_Send_Command(struct sym_device *np, u_short write_data, in T93C46_Send_Command() argument
598 T93C46_Write_Bit(np, (u_char) (write_data >> (8 - x)), gpreg); in T93C46_Send_Command()
600 *read_bit = INB(np, nc_gpreg); in T93C46_Send_Command()
606 static void T93C46_Read_Word(struct sym_device *np, in T93C46_Read_Word() argument
614 T93C46_Read_Bit(np, &read_bit, gpreg); in T93C46_Read_Word()
626 static int T93C46_Read_Data(struct sym_device *np, unsigned short *data, in T93C46_Read_Data() argument
634 T93C46_Send_Command(np, 0x180 | x, &read_bit, gpreg); in T93C46_Read_Data()
637 T93C46_Read_Word(np, &data[x], gpreg); in T93C46_Read_Data()
638 T93C46_Stop(np, gpreg); in T93C46_Read_Data()
647 static int sym_read_T93C46_nvram(struct sym_device *np, Tekram_nvram *nvram) in sym_read_T93C46_nvram() argument
654 old_gpreg = INB(np, nc_gpreg); in sym_read_T93C46_nvram()
655 old_gpcntl = INB(np, nc_gpcntl); in sym_read_T93C46_nvram()
660 OUTB(np, nc_gpreg, gpreg); in sym_read_T93C46_nvram()
662 OUTB(np, nc_gpcntl, gpcntl); in sym_read_T93C46_nvram()
665 retv = T93C46_Read_Data(np, (u_short *) nvram, in sym_read_T93C46_nvram()
669 OUTB(np, nc_gpcntl, old_gpcntl); in sym_read_T93C46_nvram()
670 OUTB(np, nc_gpreg, old_gpreg); in sym_read_T93C46_nvram()
679 static int sym_read_Tekram_nvram (struct sym_device *np, Tekram_nvram *nvram) in sym_read_Tekram_nvram() argument
686 switch (np->pdev->device) { in sym_read_Tekram_nvram()
690 x = sym_read_S24C16_nvram(np, TEKRAM_24C16_NVRAM_ADDRESS, in sym_read_Tekram_nvram()
694 x = sym_read_S24C16_nvram(np, TEKRAM_24C16_NVRAM_ADDRESS, in sym_read_Tekram_nvram()
700 x = sym_read_T93C46_nvram(np, nvram); in sym_read_Tekram_nvram()
721 static int sym_read_parisc_pdc(struct sym_device *np, struct pdc_initiator *pdc) in sym_read_parisc_pdc() argument
724 get_pci_node_path(np->pdev, &hwpath); in sym_read_parisc_pdc()
731 static inline int sym_read_parisc_pdc(struct sym_device *np, in sym_read_parisc_pdc() argument
741 int sym_read_nvram(struct sym_device *np, struct sym_nvram *nvp) in sym_read_nvram() argument
743 if (!sym_read_Symbios_nvram(np, &nvp->data.Symbios)) { in sym_read_nvram()
745 sym_display_Symbios_nvram(np, &nvp->data.Symbios); in sym_read_nvram()
746 } else if (!sym_read_Tekram_nvram(np, &nvp->data.Tekram)) { in sym_read_nvram()
748 sym_display_Tekram_nvram(np, &nvp->data.Tekram); in sym_read_nvram()
750 nvp->type = sym_read_parisc_pdc(np, &nvp->data.parisc); in sym_read_nvram()