15 writel(cmd, isp_nvram(ha));
25 static inline int eeprom_no_addr_bits(
struct scsi_qla_host *ha)
31 static inline int eeprom_no_data_bits(
struct scsi_qla_host *ha)
67 if (previousBit != dataBit) {
74 previousBit = dataBit;
83 mask = 1 << (eeprom_no_addr_bits(ha) - 1);
87 for (i = 0; i < eeprom_no_addr_bits(ha); i++) {
90 if (previousBit != dataBit) {
97 previousBit = dataBit;
124 for (i = 0; i < eeprom_no_data_bits(ha); i++) {
132 data = (data << 1) | dataBit;
139 static int eeprom_readword(
int eepromAddr,
u16 * value,
144 fm93c56a_datain(ha, value);
145 fm93c56a_deselect(ha);
155 eeprom_readword(offset, &val, ha);
166 index = (offset - 1) / 2;
173 rval = (
u8)((val & 0xff00) >> 8);
175 rval = (
u8)((val & 0x00ff));
190 spin_unlock_irqrestore(&ha->hardware_lock, flags);
209 DEBUG2(
printk(
"scsi%ld : Trying to get SEM lock - mask= 0x%x, code = "
210 "0x%x\n", ha->
host_no, sem_mask, sem_bits));
213 writel((sem_mask | sem_bits), isp_semaphore(ha));
214 value =
readw(isp_semaphore(ha));
215 spin_unlock_irqrestore(&ha->hardware_lock, flags);
216 if ((value & (sem_mask >> 16)) == sem_bits) {
219 sem_mask, sem_bits));
232 writel(sem_mask, isp_semaphore(ha));
233 readl(isp_semaphore(ha));
234 spin_unlock_irqrestore(&ha->hardware_lock, flags);
246 writel((sem_mask | sem_bits), isp_semaphore(ha));
247 value =
readw(isp_semaphore(ha));
248 spin_unlock_irqrestore(&ha->hardware_lock, flags);
249 if ((value & (sem_mask >> 16)) == sem_bits) {
250 DEBUG2(
printk(
"scsi%ld : Got SEM LOCK - mask= 0x%x, code = "
251 "0x%x, sema code=0x%x\n", ha->
host_no,
252 sem_mask, sem_bits, value));