Lines Matching refs:cr

3127 #define cf_put_1quad(cr, q) (((cr)->data++)[0] = cpu_to_be32(q))  argument
3129 #define cf_put_4bytes(cr, b1, b2, b3, b4) \ argument
3130 (((cr)->data++)[0] = cpu_to_be32(((b1) << 24) | ((b2) << 16) | ((b3) << 8) | (b4)))
3132 #define cf_put_keyval(cr, key, val) (((cr)->data++)[0] = cpu_to_be32(((key) << 24) | (val))) argument
3134 static inline void cf_put_str(struct config_rom_ptr *cr, const char *str) in cf_put_str() argument
3143 cf_put_4bytes(cr, fourb[0], fourb[1], fourb[2], fourb[3]); in cf_put_str()
3149 static inline void cf_put_crc16(struct config_rom_ptr *cr, int unit) in cf_put_crc16() argument
3151 *cr->unitdir[unit].start = in cf_put_crc16()
3152 cpu_to_be32((cr->unitdir[unit].length << 16) | in cf_put_crc16()
3153 ohci_crc16(cr->unitdir[unit].start + 1, in cf_put_crc16()
3154 cr->unitdir[unit].length)); in cf_put_crc16()
3157 static inline void cf_unit_begin(struct config_rom_ptr *cr, int unit) in cf_unit_begin() argument
3159 if (cr->unitdir[unit].refer != NULL) { in cf_unit_begin()
3160 *cr->unitdir[unit].refer |= in cf_unit_begin()
3161 cpu_to_be32 (cr->data - cr->unitdir[unit].refer); in cf_unit_begin()
3162 cf_put_crc16(cr, cr->unitdir[unit].refunit); in cf_unit_begin()
3164 cr->unitnum = unit; in cf_unit_begin()
3165 cr->unitdir[unit].start = cr->data++; in cf_unit_begin()
3168 static inline void cf_put_refer(struct config_rom_ptr *cr, char key, int unit) in cf_put_refer() argument
3170 cr->unitdir[unit].refer = cr->data; in cf_put_refer()
3171 cr->unitdir[unit].refunit = cr->unitnum; in cf_put_refer()
3172 (cr->data++)[0] = cpu_to_be32(key << 24); in cf_put_refer()
3175 static inline void cf_unit_end(struct config_rom_ptr *cr) in cf_unit_end() argument
3177 cr->unitdir[cr->unitnum].length = cr->data - in cf_unit_end()
3178 (cr->unitdir[cr->unitnum].start + 1); in cf_unit_end()
3179 cf_put_crc16(cr, cr->unitnum); in cf_unit_end()
3186 struct config_rom_ptr cr; in ohci_init_config_rom() local
3188 memset(&cr, 0, sizeof(cr)); in ohci_init_config_rom()
3191 cr.data = ohci->csr_config_rom_cpu; in ohci_init_config_rom()
3194 cf_unit_begin(&cr, 0); in ohci_init_config_rom()
3195 cf_put_1quad(&cr, reg_read(ohci, OHCI1394_BusID)); in ohci_init_config_rom()
3196 cf_put_1quad(&cr, reg_read(ohci, OHCI1394_BusOptions)); in ohci_init_config_rom()
3197 cf_put_1quad(&cr, reg_read(ohci, OHCI1394_GUIDHi)); in ohci_init_config_rom()
3198 cf_put_1quad(&cr, reg_read(ohci, OHCI1394_GUIDLo)); in ohci_init_config_rom()
3199 cf_unit_end(&cr); in ohci_init_config_rom()
3214 cf_unit_begin(&cr, 1); in ohci_init_config_rom()
3216 cf_put_keyval(&cr, 0x03, reg_read(ohci,OHCI1394_VendorID) & 0xFFFFFF); in ohci_init_config_rom()
3217 cf_put_refer(&cr, 0x81, 2); /* Textual description unit */ in ohci_init_config_rom()
3218 cf_put_keyval(&cr, 0x0c, 0x0083c0); /* Node capabilities */ in ohci_init_config_rom()
3220 cf_unit_end(&cr); in ohci_init_config_rom()
3223 cf_unit_begin(&cr, 2); in ohci_init_config_rom()
3224 cf_put_keyval(&cr, 0, 0); in ohci_init_config_rom()
3225 cf_put_1quad(&cr, 0); in ohci_init_config_rom()
3226 cf_put_str(&cr, "Linux OHCI-1394"); in ohci_init_config_rom()
3227 cf_unit_end(&cr); in ohci_init_config_rom()
3229 ohci->csr_config_rom_length = cr.data - ohci->csr_config_rom_cpu; in ohci_init_config_rom()