ipmb_dev           68 drivers/char/ipmi/ipmb_dev_int.c static inline struct ipmb_dev *to_ipmb_dev(struct file *file)
ipmb_dev           70 drivers/char/ipmi/ipmb_dev_int.c 	return container_of(file->private_data, struct ipmb_dev, miscdev);
ipmb_dev           76 drivers/char/ipmi/ipmb_dev_int.c 	struct ipmb_dev *ipmb_dev = to_ipmb_dev(file);
ipmb_dev           83 drivers/char/ipmi/ipmb_dev_int.c 	spin_lock_irq(&ipmb_dev->lock);
ipmb_dev           85 drivers/char/ipmi/ipmb_dev_int.c 	while (list_empty(&ipmb_dev->request_queue)) {
ipmb_dev           86 drivers/char/ipmi/ipmb_dev_int.c 		spin_unlock_irq(&ipmb_dev->lock);
ipmb_dev           91 drivers/char/ipmi/ipmb_dev_int.c 		ret = wait_event_interruptible(ipmb_dev->wait_queue,
ipmb_dev           92 drivers/char/ipmi/ipmb_dev_int.c 				!list_empty(&ipmb_dev->request_queue));
ipmb_dev           96 drivers/char/ipmi/ipmb_dev_int.c 		spin_lock_irq(&ipmb_dev->lock);
ipmb_dev           99 drivers/char/ipmi/ipmb_dev_int.c 	queue_elem = list_first_entry(&ipmb_dev->request_queue,
ipmb_dev          104 drivers/char/ipmi/ipmb_dev_int.c 	atomic_dec(&ipmb_dev->request_queue_len);
ipmb_dev          106 drivers/char/ipmi/ipmb_dev_int.c 	spin_unlock_irq(&ipmb_dev->lock);
ipmb_dev          118 drivers/char/ipmi/ipmb_dev_int.c 	struct ipmb_dev *ipmb_dev = to_ipmb_dev(file);
ipmb_dev          149 drivers/char/ipmi/ipmb_dev_int.c 	ret = i2c_smbus_xfer(ipmb_dev->client->adapter, rq_sa,
ipmb_dev          150 drivers/char/ipmi/ipmb_dev_int.c 			     ipmb_dev->client->flags,
ipmb_dev          159 drivers/char/ipmi/ipmb_dev_int.c 	struct ipmb_dev *ipmb_dev = to_ipmb_dev(file);
ipmb_dev          162 drivers/char/ipmi/ipmb_dev_int.c 	mutex_lock(&ipmb_dev->file_mutex);
ipmb_dev          163 drivers/char/ipmi/ipmb_dev_int.c 	poll_wait(file, &ipmb_dev->wait_queue, wait);
ipmb_dev          165 drivers/char/ipmi/ipmb_dev_int.c 	if (atomic_read(&ipmb_dev->request_queue_len))
ipmb_dev          167 drivers/char/ipmi/ipmb_dev_int.c 	mutex_unlock(&ipmb_dev->file_mutex);
ipmb_dev          180 drivers/char/ipmi/ipmb_dev_int.c static void ipmb_handle_request(struct ipmb_dev *ipmb_dev)
ipmb_dev          184 drivers/char/ipmi/ipmb_dev_int.c 	if (atomic_read(&ipmb_dev->request_queue_len) >=
ipmb_dev          192 drivers/char/ipmi/ipmb_dev_int.c 	memcpy(&queue_elem->request, &ipmb_dev->request,
ipmb_dev          194 drivers/char/ipmi/ipmb_dev_int.c 	list_add(&queue_elem->list, &ipmb_dev->request_queue);
ipmb_dev          195 drivers/char/ipmi/ipmb_dev_int.c 	atomic_inc(&ipmb_dev->request_queue_len);
ipmb_dev          196 drivers/char/ipmi/ipmb_dev_int.c 	wake_up_all(&ipmb_dev->wait_queue);
ipmb_dev          199 drivers/char/ipmi/ipmb_dev_int.c static u8 ipmb_verify_checksum1(struct ipmb_dev *ipmb_dev, u8 rs_sa)
ipmb_dev          202 drivers/char/ipmi/ipmb_dev_int.c 	return (rs_sa + ipmb_dev->request.netfn_rs_lun +
ipmb_dev          203 drivers/char/ipmi/ipmb_dev_int.c 		ipmb_dev->request.checksum1);
ipmb_dev          206 drivers/char/ipmi/ipmb_dev_int.c static bool is_ipmb_request(struct ipmb_dev *ipmb_dev, u8 rs_sa)
ipmb_dev          208 drivers/char/ipmi/ipmb_dev_int.c 	if (ipmb_dev->msg_idx >= IPMB_REQUEST_LEN_MIN) {
ipmb_dev          209 drivers/char/ipmi/ipmb_dev_int.c 		if (ipmb_verify_checksum1(ipmb_dev, rs_sa))
ipmb_dev          222 drivers/char/ipmi/ipmb_dev_int.c 		if (!(ipmb_dev->request.netfn_rs_lun & NETFN_RSP_BIT_MASK))
ipmb_dev          238 drivers/char/ipmi/ipmb_dev_int.c 	struct ipmb_dev *ipmb_dev = i2c_get_clientdata(client);
ipmb_dev          239 drivers/char/ipmi/ipmb_dev_int.c 	u8 *buf = (u8 *)&ipmb_dev->request;
ipmb_dev          242 drivers/char/ipmi/ipmb_dev_int.c 	spin_lock_irqsave(&ipmb_dev->lock, flags);
ipmb_dev          245 drivers/char/ipmi/ipmb_dev_int.c 		memset(&ipmb_dev->request, 0, sizeof(ipmb_dev->request));
ipmb_dev          246 drivers/char/ipmi/ipmb_dev_int.c 		ipmb_dev->msg_idx = 0;
ipmb_dev          264 drivers/char/ipmi/ipmb_dev_int.c 		buf[++ipmb_dev->msg_idx] = GET_8BIT_ADDR(client->addr);
ipmb_dev          268 drivers/char/ipmi/ipmb_dev_int.c 		if (ipmb_dev->msg_idx >= sizeof(struct ipmb_msg) - 1)
ipmb_dev          271 drivers/char/ipmi/ipmb_dev_int.c 		buf[++ipmb_dev->msg_idx] = *val;
ipmb_dev          275 drivers/char/ipmi/ipmb_dev_int.c 		ipmb_dev->request.len = ipmb_dev->msg_idx;
ipmb_dev          277 drivers/char/ipmi/ipmb_dev_int.c 		if (is_ipmb_request(ipmb_dev, GET_8BIT_ADDR(client->addr)))
ipmb_dev          278 drivers/char/ipmi/ipmb_dev_int.c 			ipmb_handle_request(ipmb_dev);
ipmb_dev          284 drivers/char/ipmi/ipmb_dev_int.c 	spin_unlock_irqrestore(&ipmb_dev->lock, flags);
ipmb_dev          292 drivers/char/ipmi/ipmb_dev_int.c 	struct ipmb_dev *ipmb_dev;
ipmb_dev          295 drivers/char/ipmi/ipmb_dev_int.c 	ipmb_dev = devm_kzalloc(&client->dev, sizeof(*ipmb_dev),
ipmb_dev          297 drivers/char/ipmi/ipmb_dev_int.c 	if (!ipmb_dev)
ipmb_dev          300 drivers/char/ipmi/ipmb_dev_int.c 	spin_lock_init(&ipmb_dev->lock);
ipmb_dev          301 drivers/char/ipmi/ipmb_dev_int.c 	init_waitqueue_head(&ipmb_dev->wait_queue);
ipmb_dev          302 drivers/char/ipmi/ipmb_dev_int.c 	atomic_set(&ipmb_dev->request_queue_len, 0);
ipmb_dev          303 drivers/char/ipmi/ipmb_dev_int.c 	INIT_LIST_HEAD(&ipmb_dev->request_queue);
ipmb_dev          305 drivers/char/ipmi/ipmb_dev_int.c 	mutex_init(&ipmb_dev->file_mutex);
ipmb_dev          307 drivers/char/ipmi/ipmb_dev_int.c 	ipmb_dev->miscdev.minor = MISC_DYNAMIC_MINOR;
ipmb_dev          309 drivers/char/ipmi/ipmb_dev_int.c 	ipmb_dev->miscdev.name = devm_kasprintf(&client->dev, GFP_KERNEL,
ipmb_dev          312 drivers/char/ipmi/ipmb_dev_int.c 	ipmb_dev->miscdev.fops = &ipmb_fops;
ipmb_dev          313 drivers/char/ipmi/ipmb_dev_int.c 	ipmb_dev->miscdev.parent = &client->dev;
ipmb_dev          314 drivers/char/ipmi/ipmb_dev_int.c 	ret = misc_register(&ipmb_dev->miscdev);
ipmb_dev          318 drivers/char/ipmi/ipmb_dev_int.c 	ipmb_dev->client = client;
ipmb_dev          319 drivers/char/ipmi/ipmb_dev_int.c 	i2c_set_clientdata(client, ipmb_dev);
ipmb_dev          322 drivers/char/ipmi/ipmb_dev_int.c 		misc_deregister(&ipmb_dev->miscdev);
ipmb_dev          331 drivers/char/ipmi/ipmb_dev_int.c 	struct ipmb_dev *ipmb_dev = i2c_get_clientdata(client);
ipmb_dev          334 drivers/char/ipmi/ipmb_dev_int.c 	misc_deregister(&ipmb_dev->miscdev);