Lines Matching defs:cfg
18 static void initialize_config(struct rsxx_card_cfg *cfg)
20 cfg->hdr.version = RSXX_CFG_VERSION;
22 cfg->data.block_size = RSXX_HW_BLK_SIZE;
23 cfg->data.stripe_size = RSXX_HW_BLK_SIZE;
24 cfg->data.vendor_id = RSXX_VENDOR_ID_IBM;
25 cfg->data.cache_order = (-1);
26 cfg->data.intr_coal.mode = RSXX_INTR_COAL_DISABLED;
27 cfg->data.intr_coal.count = 0;
28 cfg->data.intr_coal.latency = 0;
31 static u32 config_data_crc32(struct rsxx_card_cfg *cfg)
38 return ~crc32(~0, &cfg->data, sizeof(cfg->data));
55 static void config_data_swab(struct rsxx_card_cfg *cfg)
57 u32 *data = (u32 *) &cfg->data;
60 for (i = 0; i < (sizeof(cfg->data) / 4); i++)
64 static void config_data_le_to_cpu(struct rsxx_card_cfg *cfg)
66 u32 *data = (u32 *) &cfg->data;
69 for (i = 0; i < (sizeof(cfg->data) / 4); i++)
73 static void config_data_cpu_to_le(struct rsxx_card_cfg *cfg)
75 u32 *data = (u32 *) &cfg->data;
78 for (i = 0; i < (sizeof(cfg->data) / 4); i++)
86 struct rsxx_card_cfg cfg;
89 memcpy(&cfg, &card->config, sizeof(cfg));
91 if (unlikely(cfg.hdr.version != RSXX_CFG_VERSION)) {
94 cfg.hdr.version);
99 config_data_cpu_to_le(&cfg);
101 cfg.hdr.crc = config_data_crc32(&cfg);
107 config_data_swab(&cfg);
108 config_hdr_cpu_to_be(&cfg.hdr);
110 st = rsxx_creg_write(card, CREG_ADD_CONFIG, sizeof(cfg), &cfg, 1);