Lines Matching refs:rn
59 static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn);
383 struct w1_reg_num *rn) in w1_atoreg_num() argument
407 rn->family = family; in w1_atoreg_num()
408 rn->id = id; in w1_atoreg_num()
410 rn64_le = cpu_to_le64(*(u64 *)rn); in w1_atoreg_num()
411 rn->crc = w1_calc_crc8((u8 *)&rn64_le, 7); in w1_atoreg_num()
415 rn->family, (unsigned long long)rn->id, rn->crc); in w1_atoreg_num()
425 struct w1_reg_num *rn) in w1_slave_search_device() argument
429 if (sl->reg_num.family == rn->family && in w1_slave_search_device()
430 sl->reg_num.id == rn->id && in w1_slave_search_device()
431 sl->reg_num.crc == rn->crc) { in w1_slave_search_device()
443 struct w1_reg_num rn; in w1_master_attribute_store_add() local
447 if (w1_atoreg_num(dev, buf, count, &rn)) in w1_master_attribute_store_add()
451 sl = w1_slave_search_device(md, &rn); in w1_master_attribute_store_add()
460 w1_attach_slave_device(md, &rn); in w1_master_attribute_store_add()
481 struct w1_reg_num rn; in w1_master_attribute_store_remove() local
485 if (w1_atoreg_num(dev, buf, count, &rn)) in w1_master_attribute_store_remove()
489 sl = w1_slave_search_device(md, &rn); in w1_master_attribute_store_remove()
493 dev_info(dev, "Device %02x-%012llx doesn't exists\n", rn.family, in w1_master_attribute_store_remove()
494 (unsigned long long)rn.id); in w1_master_attribute_store_remove()
667 static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn) in w1_attach_slave_device() argument
688 memcpy(&sl->reg_num, rn, sizeof(sl->reg_num)); in w1_attach_slave_device()
693 f = w1_family_registered(rn->family); in w1_attach_slave_device()
697 rn->family, rn->family, in w1_attach_slave_device()
698 (unsigned long long)rn->id, rn->crc); in w1_attach_slave_device()
718 memcpy(msg.id.id, rn, sizeof(msg.id)); in w1_attach_slave_device()
815 struct w1_reg_num rn; in w1_reconnect_slaves() local
817 memcpy(&rn, &sl->reg_num, sizeof(rn)); in w1_reconnect_slaves()
820 w1_attach_slave_device(dev, &rn); in w1_reconnect_slaves()
830 static void w1_slave_found(struct w1_master *dev, u64 rn) in w1_slave_found() argument
834 u64 rn_le = cpu_to_le64(rn); in w1_slave_found()
838 tmp = (struct w1_reg_num *) &rn; in w1_slave_found()
844 if (rn && tmp->crc == w1_calc_crc8((u8 *)&rn_le, 7)) in w1_slave_found()
867 u64 last_rn, rn, tmp64; in w1_search() local
874 rn = last_rn = 0; in w1_search()
881 last_rn = rn; in w1_search()
882 rn = 0; in w1_search()
919 rn |= (tmp64 << i); in w1_search()
931 cb(dev, rn); in w1_search()