Lines Matching refs:nvm
108 ret = tb_nvm_validate(sw->nvm); in nvm_validate_and_write()
112 ret = tb_nvm_write_headers(sw->nvm); in nvm_validate_and_write()
116 buf = sw->nvm->buf_data_start; in nvm_validate_and_write()
117 image_size = sw->nvm->buf_data_size; in nvm_validate_and_write()
126 sw->nvm->flushed = true; in nvm_validate_and_write()
272 sw->nvm->authenticating = true; in nvm_authenticate()
278 sw->nvm->authenticating = true; in nvm_authenticate()
310 struct tb_nvm *nvm = priv; in nvm_read() local
311 struct tb_switch *sw = tb_to_switch(nvm->dev); in nvm_read()
333 struct tb_nvm *nvm = priv; in nvm_write() local
334 struct tb_switch *sw = tb_to_switch(nvm->dev); in nvm_write()
346 ret = tb_nvm_write_buf(nvm, offset, val, bytes); in nvm_write()
354 struct tb_nvm *nvm; in tb_switch_nvm_add() local
360 nvm = tb_nvm_alloc(&sw->dev); in tb_switch_nvm_add()
361 if (IS_ERR(nvm)) { in tb_switch_nvm_add()
362 ret = PTR_ERR(nvm) == -EOPNOTSUPP ? 0 : PTR_ERR(nvm); in tb_switch_nvm_add()
366 ret = tb_nvm_read_version(nvm); in tb_switch_nvm_add()
376 ret = tb_nvm_add_active(nvm, nvm_read); in tb_switch_nvm_add()
382 ret = tb_nvm_add_non_active(nvm, nvm_write); in tb_switch_nvm_add()
387 sw->nvm = nvm; in tb_switch_nvm_add()
393 if (!IS_ERR(nvm)) in tb_switch_nvm_add()
394 tb_nvm_free(nvm); in tb_switch_nvm_add()
401 struct tb_nvm *nvm; in tb_switch_nvm_remove() local
403 nvm = sw->nvm; in tb_switch_nvm_remove()
404 sw->nvm = NULL; in tb_switch_nvm_remove()
406 if (!nvm) in tb_switch_nvm_remove()
410 if (!nvm->authenticating) in tb_switch_nvm_remove()
413 tb_nvm_free(nvm); in tb_switch_nvm_remove()
1958 if (!sw->nvm) { in nvm_authenticate_sysfs()
1977 if (!sw->nvm->flushed) { in nvm_authenticate_sysfs()
1978 if (!sw->nvm->buf) { in nvm_authenticate_sysfs()
2042 else if (!sw->nvm) in nvm_version_show()
2045 ret = sysfs_emit(buf, "%x.%x\n", sw->nvm->major, sw->nvm->minor); in nvm_version_show()