nfit.c (abaee091a18c19ccd86feb1c8374585d82e96777) nfit.c (d26f73f083ed6fbea7fd3fdbacb527b7f3e75ac0)
1/*
2 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but

--- 234 unchanged lines hidden (view full) ---

243static int nfit_test_cmd_ars_status(struct nd_cmd_ars_status *nd_cmd,
244 unsigned int buf_len)
245{
246 if (buf_len < sizeof(*nd_cmd))
247 return -EINVAL;
248
249 nd_cmd->out_length = 256;
250 nd_cmd->num_records = 0;
1/*
2 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but

--- 234 unchanged lines hidden (view full) ---

243static int nfit_test_cmd_ars_status(struct nd_cmd_ars_status *nd_cmd,
244 unsigned int buf_len)
245{
246 if (buf_len < sizeof(*nd_cmd))
247 return -EINVAL;
248
249 nd_cmd->out_length = 256;
250 nd_cmd->num_records = 0;
251 nd_cmd->address = 0;
252 nd_cmd->length = -1ULL;
251 nd_cmd->status = 0;
252
253 return 0;
254}
255
256static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc,
257 struct nvdimm *nvdimm, unsigned int cmd, void *buf,
258 unsigned int buf_len)

--- 824 unchanged lines hidden (view full) ---

1083
1084static void nfit_test1_setup(struct nfit_test *t)
1085{
1086 size_t offset;
1087 void *nfit_buf = t->nfit_buf;
1088 struct acpi_nfit_memory_map *memdev;
1089 struct acpi_nfit_control_region *dcr;
1090 struct acpi_nfit_system_address *spa;
253 nd_cmd->status = 0;
254
255 return 0;
256}
257
258static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc,
259 struct nvdimm *nvdimm, unsigned int cmd, void *buf,
260 unsigned int buf_len)

--- 824 unchanged lines hidden (view full) ---

1085
1086static void nfit_test1_setup(struct nfit_test *t)
1087{
1088 size_t offset;
1089 void *nfit_buf = t->nfit_buf;
1090 struct acpi_nfit_memory_map *memdev;
1091 struct acpi_nfit_control_region *dcr;
1092 struct acpi_nfit_system_address *spa;
1093 struct nvdimm_bus_descriptor *nd_desc;
1094 struct acpi_nfit_desc *acpi_desc;
1091
1092 offset = 0;
1093 /* spa0 (flat range with no bdw aliasing) */
1094 spa = nfit_buf + offset;
1095 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS;
1096 spa->header.length = sizeof(*spa);
1097 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16);
1098 spa->range_index = 0+1;

--- 31 unchanged lines hidden (view full) ---

1130 dcr->serial_number = ~0;
1131 dcr->code = 0x201;
1132 dcr->windows = 0;
1133 dcr->window_size = 0;
1134 dcr->command_offset = 0;
1135 dcr->command_size = 0;
1136 dcr->status_offset = 0;
1137 dcr->status_size = 0;
1095
1096 offset = 0;
1097 /* spa0 (flat range with no bdw aliasing) */
1098 spa = nfit_buf + offset;
1099 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS;
1100 spa->header.length = sizeof(*spa);
1101 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16);
1102 spa->range_index = 0+1;

--- 31 unchanged lines hidden (view full) ---

1134 dcr->serial_number = ~0;
1135 dcr->code = 0x201;
1136 dcr->windows = 0;
1137 dcr->window_size = 0;
1138 dcr->command_offset = 0;
1139 dcr->command_size = 0;
1140 dcr->status_offset = 0;
1141 dcr->status_size = 0;
1142
1143 acpi_desc = &t->acpi_desc;
1144 set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_dsm_force_en);
1145 set_bit(ND_CMD_ARS_START, &acpi_desc->bus_dsm_force_en);
1146 set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_dsm_force_en);
1147 nd_desc = &acpi_desc->nd_desc;
1148 nd_desc->ndctl = nfit_test_ctl;
1138}
1139
1140static int nfit_test_blk_do_io(struct nd_blk_region *ndbr, resource_size_t dpa,
1141 void *iobuf, u64 len, int rw)
1142{
1143 struct nfit_blk *nfit_blk = ndbr->blk_provider_data;
1144 struct nfit_blk_mmio *mmio = &nfit_blk->mmio[BDW];
1145 struct nd_region *nd_region = &ndbr->nd_region;

--- 243 unchanged lines hidden ---
1149}
1150
1151static int nfit_test_blk_do_io(struct nd_blk_region *ndbr, resource_size_t dpa,
1152 void *iobuf, u64 len, int rw)
1153{
1154 struct nfit_blk *nfit_blk = ndbr->blk_provider_data;
1155 struct nfit_blk_mmio *mmio = &nfit_blk->mmio[BDW];
1156 struct nd_region *nd_region = &ndbr->nd_region;

--- 243 unchanged lines hidden ---