Lines Matching full:cfg

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