netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: xiongsujuan <xiongsujuan.xiongsujuan@huawei.com>
Cc: davem@davemloft.net, zhaochen6@huawei.com,
	aviad.krawczyk@huawei.com, romain.perier@collabora.com,
	bhelgaas@google.com, keescook@chromium.org,
	colin.king@canonical.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V1] add huawei ibma driver modules The driver is used for communication between in-band management agent(iBMA) and out-of-band management controller(iBMC) via pcie bus in Huawei V3 server. The driver provides character device,VNIC and black box interface for application layer.
Date: Thu, 30 Aug 2018 05:17:46 +0200	[thread overview]
Message-ID: <20180830031746.GD16896@lunn.ch> (raw)
In-Reply-To: <1535591472-44997-1-git-send-email-xiongsujuan.xiongsujuan@huawei.com>

On Thu, Aug 30, 2018 at 09:11:12AM +0800, xiongsujuan wrote:

Hi xiongsujuan

Please add a real commit message. Talk about the architecture, etc.

You are also missing a Signed-off-by:

> +const struct file_operations g_bma_cdev_fops = {
> +	.owner = THIS_MODULE,
> +	.open = cdev_open,
> +	.release = cdev_release,
> +	.poll = cdev_poll,
> +	.read = cdev_read,
> +	.write = cdev_write,
> +};
> +
> +static int __init bma_cdev_init(void)
> +{
> +	int i = 0;
> +
> +	int ret = 0;
> +	int err_count = 0;
> +
> +	if (!bma_intf_check_edma_supported())
> +		return -ENXIO;
> +
> +	if (dev_num <= 0 || dev_num > CDEV_MAX_NUM)
> +		return -EINVAL;
> +
> +	memset(&g_cdev_set, 0, sizeof(struct cdev_dev_set));
> +	g_cdev_set.dev_num = dev_num;
> +
> +	for (i = 0; i < dev_num; i++) {
> +		struct cdev_dev *pDev = &g_cdev_set.dev_list[i];
> +
> +		sprintf(pDev->dev_name, "%s%d", CDEV_NAME_PREFIX, i);
> +		pDev->dev_struct.name = pDev->dev_name;
> +		pDev->dev_struct.minor = MISC_DYNAMIC_MINOR;
> +		pDev->dev_struct.fops = &g_bma_cdev_fops;
> +
> +		pDev->dev_id = CDEV_INVALID_ID;
> +
> +		ret = misc_register(&pDev->dev_struct);
> +
> +		if (ret) {
> +			CDEV_LOG(DLOG_DEBUG, "misc_register failed %d", i);
> +			err_count++;
> +			continue;
> +		}
> +
> +		pDev->dev_id = MKDEV(MISC_MAJOR, pDev->dev_struct.minor);
> +
> +		ret = bma_intf_register_type(TYPE_CDEV + i, 0, INTR_DISABLE,
> +					     &pDev->dev_data);
> +
> +		if (ret) {
> +			CDEV_LOG(DLOG_ERROR,
> +				 "cdev %d open failed ,result = %d",
> +				 i, ret);
> +		misc_deregister(&pDev->dev_struct);

I've never seen a Ethernet driver with a cdev. You need to explain
this. What is it, why does it exist, etc.

      Andrew

  reply	other threads:[~2018-08-30  3:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30  1:11 [PATCH V1] add huawei ibma driver modules The driver is used for communication between in-band management agent(iBMA) and out-of-band management controller(iBMC) via pcie bus in Huawei V3 server. The driver provides character device,VNIC and black box interface for application layer xiongsujuan
2018-08-30  3:17 ` Andrew Lunn [this message]
2018-08-30 17:15 ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180830031746.GD16896@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=aviad.krawczyk@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=romain.perier@collabora.com \
    --cc=xiongsujuan.xiongsujuan@huawei.com \
    --cc=zhaochen6@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).