Lines Matching defs:len
11 static int eeprom_write(struct adapter *adapter, u16 addr, u8 *buf, u16 len)
13 return flex_i2c_write(adapter, 0x20000000, 0x50, addr, buf, len);
17 u32 len, u8 *wbuf, u8 *rbuf, int retries)
22 if (eeprom_write(adapter, addr, wbuf, len) == len) {
23 if (eeprom_lrc_read(adapter, addr, len, rbuf, retries) == 1)
32 static int eeprom_writeKey(struct adapter *adapter, u8 *key, u32 len)
37 if (len != 16)
40 memcpy(wbuf, key, len);
48 static int eeprom_readKey(struct adapter *adapter, u8 *key, u32 len)
52 if (len != 16)
58 memcpy(key, buf, len);
91 u16 addr, u8 *buf, u16 len)
93 return fc->i2c_request(fc,FC_READ,FC_I2C_PORT_EEPROM,0x50,addr,buf,len);
98 static u8 calc_lrc(u8 *buf, int len)
102 for (i = 0; i < len; i++)
108 flexcop_access_op_t op, u16 addr, u8 *buf, u16 len, int retries)
114 addr & 0xff, buf, len);
122 u8 *buf, u16 len, int retries)
124 int ret = flexcop_eeprom_request(fc, FC_READ, addr, buf, len, retries);
126 if (calc_lrc(buf, len - 1) != buf[len - 1])