• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/char/ipmi/

Lines Matching defs:bmc

176 	/* bmc device attributes */
212 struct bmc_device *bmc;
1796 ipmi_version_major(&intf->bmc->id),
1797 ipmi_version_minor(&intf->bmc->id));
1959 struct bmc_device *bmc = dev_get_drvdata(dev);
1960 return memcmp(bmc->guid, id, 16) == 0;
1983 struct bmc_device *bmc = dev_get_drvdata(dev);
1985 return (bmc->id.product_id == id->product_id
1986 && bmc->id.device_id == id->device_id);
2010 struct bmc_device *bmc = dev_get_drvdata(dev);
2012 return snprintf(buf, 10, "%u\n", bmc->id.device_id);
2019 struct bmc_device *bmc = dev_get_drvdata(dev);
2022 (bmc->id.device_revision & 0x80) >> 7);
2028 struct bmc_device *bmc = dev_get_drvdata(dev);
2031 bmc->id.device_revision & 0x0F);
2038 struct bmc_device *bmc = dev_get_drvdata(dev);
2040 return snprintf(buf, 20, "%u.%x\n", bmc->id.firmware_revision_1,
2041 bmc->id.firmware_revision_2);
2048 struct bmc_device *bmc = dev_get_drvdata(dev);
2051 ipmi_version_major(&bmc->id),
2052 ipmi_version_minor(&bmc->id));
2059 struct bmc_device *bmc = dev_get_drvdata(dev);
2062 bmc->id.additional_device_support);
2069 struct bmc_device *bmc = dev_get_drvdata(dev);
2071 return snprintf(buf, 20, "0x%6.6x\n", bmc->id.manufacturer_id);
2078 struct bmc_device *bmc = dev_get_drvdata(dev);
2080 return snprintf(buf, 10, "0x%4.4x\n", bmc->id.product_id);
2087 struct bmc_device *bmc = dev_get_drvdata(dev);
2090 bmc->id.aux_firmware_revision[3],
2091 bmc->id.aux_firmware_revision[2],
2092 bmc->id.aux_firmware_revision[1],
2093 bmc->id.aux_firmware_revision[0]);
2099 struct bmc_device *bmc = dev_get_drvdata(dev);
2102 (long long) bmc->guid[0],
2103 (long long) bmc->guid[8]);
2106 static void remove_files(struct bmc_device *bmc)
2108 if (!bmc->dev)
2111 device_remove_file(&bmc->dev->dev,
2112 &bmc->device_id_attr);
2113 device_remove_file(&bmc->dev->dev,
2114 &bmc->provides_dev_sdrs_attr);
2115 device_remove_file(&bmc->dev->dev,
2116 &bmc->revision_attr);
2117 device_remove_file(&bmc->dev->dev,
2118 &bmc->firmware_rev_attr);
2119 device_remove_file(&bmc->dev->dev,
2120 &bmc->version_attr);
2121 device_remove_file(&bmc->dev->dev,
2122 &bmc->add_dev_support_attr);
2123 device_remove_file(&bmc->dev->dev,
2124 &bmc->manufacturer_id_attr);
2125 device_remove_file(&bmc->dev->dev,
2126 &bmc->product_id_attr);
2128 if (bmc->id.aux_firmware_revision_set)
2129 device_remove_file(&bmc->dev->dev,
2130 &bmc->aux_firmware_rev_attr);
2131 if (bmc->guid_set)
2132 device_remove_file(&bmc->dev->dev,
2133 &bmc->guid_attr);
2139 struct bmc_device *bmc;
2141 bmc = container_of(ref, struct bmc_device, refcount);
2143 remove_files(bmc);
2144 platform_device_unregister(bmc->dev);
2145 kfree(bmc);
2150 struct bmc_device *bmc = intf->bmc;
2158 sysfs_remove_link(&bmc->dev->dev.kobj, intf->my_dev_name);
2164 kref_put(&bmc->refcount, cleanup_bmc_device);
2165 intf->bmc = NULL;
2169 static int create_files(struct bmc_device *bmc)
2173 bmc->device_id_attr.attr.name = "device_id";
2174 bmc->device_id_attr.attr.owner = THIS_MODULE;
2175 bmc->device_id_attr.attr.mode = S_IRUGO;
2176 bmc->device_id_attr.show = device_id_show;
2178 bmc->provides_dev_sdrs_attr.attr.name = "provides_device_sdrs";
2179 bmc->provides_dev_sdrs_attr.attr.owner = THIS_MODULE;
2180 bmc->provides_dev_sdrs_attr.attr.mode = S_IRUGO;
2181 bmc->provides_dev_sdrs_attr.show = provides_dev_sdrs_show;
2183 bmc->revision_attr.attr.name = "revision";
2184 bmc->revision_attr.attr.owner = THIS_MODULE;
2185 bmc->revision_attr.attr.mode = S_IRUGO;
2186 bmc->revision_attr.show = revision_show;
2188 bmc->firmware_rev_attr.attr.name = "firmware_revision";
2189 bmc->firmware_rev_attr.attr.owner = THIS_MODULE;
2190 bmc->firmware_rev_attr.attr.mode = S_IRUGO;
2191 bmc->firmware_rev_attr.show = firmware_rev_show;
2193 bmc->version_attr.attr.name = "ipmi_version";
2194 bmc->version_attr.attr.owner = THIS_MODULE;
2195 bmc->version_attr.attr.mode = S_IRUGO;
2196 bmc->version_attr.show = ipmi_version_show;
2198 bmc->add_dev_support_attr.attr.name = "additional_device_support";
2199 bmc->add_dev_support_attr.attr.owner = THIS_MODULE;
2200 bmc->add_dev_support_attr.attr.mode = S_IRUGO;
2201 bmc->add_dev_support_attr.show = add_dev_support_show;
2203 bmc->manufacturer_id_attr.attr.name = "manufacturer_id";
2204 bmc->manufacturer_id_attr.attr.owner = THIS_MODULE;
2205 bmc->manufacturer_id_attr.attr.mode = S_IRUGO;
2206 bmc->manufacturer_id_attr.show = manufacturer_id_show;
2208 bmc->product_id_attr.attr.name = "product_id";
2209 bmc->product_id_attr.attr.owner = THIS_MODULE;
2210 bmc->product_id_attr.attr.mode = S_IRUGO;
2211 bmc->product_id_attr.show = product_id_show;
2213 bmc->guid_attr.attr.name = "guid";
2214 bmc->guid_attr.attr.owner = THIS_MODULE;
2215 bmc->guid_attr.attr.mode = S_IRUGO;
2216 bmc->guid_attr.show = guid_show;
2218 bmc->aux_firmware_rev_attr.attr.name = "aux_firmware_revision";
2219 bmc->aux_firmware_rev_attr.attr.owner = THIS_MODULE;
2220 bmc->aux_firmware_rev_attr.attr.mode = S_IRUGO;
2221 bmc->aux_firmware_rev_attr.show = aux_firmware_rev_show;
2223 err = device_create_file(&bmc->dev->dev,
2224 &bmc->device_id_attr);
2226 err = device_create_file(&bmc->dev->dev,
2227 &bmc->provides_dev_sdrs_attr);
2229 err = device_create_file(&bmc->dev->dev,
2230 &bmc->revision_attr);
2232 err = device_create_file(&bmc->dev->dev,
2233 &bmc->firmware_rev_attr);
2235 err = device_create_file(&bmc->dev->dev,
2236 &bmc->version_attr);
2238 err = device_create_file(&bmc->dev->dev,
2239 &bmc->add_dev_support_attr);
2241 err = device_create_file(&bmc->dev->dev,
2242 &bmc->manufacturer_id_attr);
2244 err = device_create_file(&bmc->dev->dev,
2245 &bmc->product_id_attr);
2247 if (bmc->id.aux_firmware_revision_set) {
2248 err = device_create_file(&bmc->dev->dev,
2249 &bmc->aux_firmware_rev_attr);
2252 if (bmc->guid_set) {
2253 err = device_create_file(&bmc->dev->dev,
2254 &bmc->guid_attr);
2261 if (bmc->id.aux_firmware_revision_set)
2262 device_remove_file(&bmc->dev->dev,
2263 &bmc->aux_firmware_rev_attr);
2265 device_remove_file(&bmc->dev->dev,
2266 &bmc->product_id_attr);
2268 device_remove_file(&bmc->dev->dev,
2269 &bmc->manufacturer_id_attr);
2271 device_remove_file(&bmc->dev->dev,
2272 &bmc->add_dev_support_attr);
2274 device_remove_file(&bmc->dev->dev,
2275 &bmc->version_attr);
2277 device_remove_file(&bmc->dev->dev,
2278 &bmc->firmware_rev_attr);
2280 device_remove_file(&bmc->dev->dev,
2281 &bmc->revision_attr);
2283 device_remove_file(&bmc->dev->dev,
2284 &bmc->provides_dev_sdrs_attr);
2286 device_remove_file(&bmc->dev->dev,
2287 &bmc->device_id_attr);
2296 struct bmc_device *bmc = intf->bmc;
2307 if (bmc->guid_set)
2308 old_bmc = ipmi_find_bmc_guid(&ipmidriver, bmc->guid);
2311 bmc->id.product_id,
2312 bmc->id.device_id);
2319 kfree(bmc);
2320 intf->bmc = old_bmc;
2321 bmc = old_bmc;
2323 kref_get(&bmc->refcount);
2329 bmc->id.manufacturer_id,
2330 bmc->id.product_id,
2331 bmc->id.device_id);
2334 unsigned char orig_dev_id = bmc->id.device_id;
2338 "ipmi_bmc.%4.4x", bmc->id.product_id);
2341 bmc->id.product_id,
2342 bmc->id.device_id)) {
2351 bmc->id.product_id, bmc->id.device_id);
2354 bmc->id.device_id++; /* Wraps at 255 */
2355 if (bmc->id.device_id == orig_dev_id) {
2362 bmc->dev = platform_device_alloc(name, bmc->id.device_id);
2363 if (!bmc->dev) {
2370 bmc->dev->dev.driver = &ipmidriver;
2371 dev_set_drvdata(&bmc->dev->dev, bmc);
2372 kref_init(&bmc->refcount);
2374 rv = platform_device_add(bmc->dev);
2377 platform_device_put(bmc->dev);
2378 bmc->dev = NULL;
2381 " Unable to register bmc device: %d\n",
2388 rv = create_files(bmc);
2391 platform_device_unregister(bmc->dev);
2400 bmc->id.manufacturer_id,
2401 bmc->id.product_id,
2402 bmc->id.device_id);
2406 * create symlink from system interface device to bmc device
2419 &bmc->dev->dev.kobj, intf->sysfs_name);
2424 "ipmi_msghandler: Unable to create bmc symlink: %d\n",
2442 rv = sysfs_create_link(&bmc->dev->dev.kobj, &intf->si_dev->kobj,
2451 " Unable to create symlink to bmc: %d\n",
2502 intf->bmc->guid_set = 0;
2507 intf->bmc->guid_set = 0;
2516 memcpy(intf->bmc->guid, msg->msg.data, 16);
2517 intf->bmc->guid_set = 1;
2527 intf->bmc->guid_set = 0x2;
2532 intf->bmc->guid_set = 0;
2533 wait_event(intf->waitq, intf->bmc->guid_set != 2);
2660 intf->bmc = kzalloc(sizeof(*intf->bmc), GFP_KERNEL);
2661 if (!intf->bmc) {
2667 intf->bmc->id = *device_id;