ncsi-cmd.c (188de5dd80b2b7986e75821374efb67081049b6e) ncsi-cmd.c (9771b8ccdfa6dcb1ac5128ca7fe8649f3092d392)
1/*
2 * Copyright Gavin Shan, IBM Corporation 2016.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/etherdevice.h>
14#include <linux/netdevice.h>
15#include <linux/skbuff.h>
16
17#include <net/ncsi.h>
18#include <net/net_namespace.h>
19#include <net/sock.h>
1/*
2 * Copyright Gavin Shan, IBM Corporation 2016.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/etherdevice.h>
14#include <linux/netdevice.h>
15#include <linux/skbuff.h>
16
17#include <net/ncsi.h>
18#include <net/net_namespace.h>
19#include <net/sock.h>
20#include <net/genetlink.h>
20
21#include "internal.h"
22#include "ncsi-pkt.h"
23
24u32 ncsi_calculate_checksum(unsigned char *data, int len)
25{
26 u32 checksum = 0;
27 int i;

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

341 * and setting length in nca before calling xmit function
342 */
343 if (nch->payload >= 0)
344 nca->payload = nch->payload;
345 nr = ncsi_alloc_command(nca);
346 if (!nr)
347 return -ENOMEM;
348
21
22#include "internal.h"
23#include "ncsi-pkt.h"
24
25u32 ncsi_calculate_checksum(unsigned char *data, int len)
26{
27 u32 checksum = 0;
28 int i;

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

342 * and setting length in nca before calling xmit function
343 */
344 if (nch->payload >= 0)
345 nca->payload = nch->payload;
346 nr = ncsi_alloc_command(nca);
347 if (!nr)
348 return -ENOMEM;
349
350 /* track netlink information */
351 if (nca->req_flags == NCSI_REQ_FLAG_NETLINK_DRIVEN) {
352 nr->snd_seq = nca->info->snd_seq;
353 nr->snd_portid = nca->info->snd_portid;
354 nr->nlhdr = *nca->info->nlhdr;
355 }
356
349 /* Prepare the packet */
350 nca->id = nr->id;
351 ret = nch->handler(nr->cmd, nca);
352 if (ret) {
353 ncsi_free_request(nr);
354 return ret;
355 }
356

--- 23 unchanged lines hidden ---
357 /* Prepare the packet */
358 nca->id = nr->id;
359 ret = nch->handler(nr->cmd, nca);
360 if (ret) {
361 ncsi_free_request(nr);
362 return ret;
363 }
364

--- 23 unchanged lines hidden ---