ncsi-manage.c (6e2d6b2728fcb408eabd7991804f8cb33ff59f20) | ncsi-manage.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 */ --- 5 unchanged lines hidden (view full) --- 14#include <linux/skbuff.h> 15 16#include <net/ncsi.h> 17#include <net/net_namespace.h> 18#include <net/sock.h> 19#include <net/addrconf.h> 20#include <net/ipv6.h> 21#include <net/if_inet6.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 */ --- 5 unchanged lines hidden (view full) --- 14#include <linux/skbuff.h> 15 16#include <net/ncsi.h> 17#include <net/net_namespace.h> 18#include <net/sock.h> 19#include <net/addrconf.h> 20#include <net/ipv6.h> 21#include <net/if_inet6.h> |
22#include <net/genetlink.h> |
|
22 23#include "internal.h" 24#include "ncsi-pkt.h" 25#include "ncsi-netlink.h" 26 27LIST_HEAD(ncsi_dev_list); 28DEFINE_SPINLOCK(ncsi_dev_lock); 29 --- 371 unchanged lines hidden (view full) --- 401 402 return NULL; 403} 404 405static void ncsi_request_timeout(struct timer_list *t) 406{ 407 struct ncsi_request *nr = from_timer(nr, t, timer); 408 struct ncsi_dev_priv *ndp = nr->ndp; | 23 24#include "internal.h" 25#include "ncsi-pkt.h" 26#include "ncsi-netlink.h" 27 28LIST_HEAD(ncsi_dev_list); 29DEFINE_SPINLOCK(ncsi_dev_lock); 30 --- 371 unchanged lines hidden (view full) --- 402 403 return NULL; 404} 405 406static void ncsi_request_timeout(struct timer_list *t) 407{ 408 struct ncsi_request *nr = from_timer(nr, t, timer); 409 struct ncsi_dev_priv *ndp = nr->ndp; |
410 struct ncsi_cmd_pkt *cmd; 411 struct ncsi_package *np; 412 struct ncsi_channel *nc; |
|
409 unsigned long flags; 410 411 /* If the request already had associated response, 412 * let the response handler to release it. 413 */ 414 spin_lock_irqsave(&ndp->lock, flags); 415 nr->enabled = false; 416 if (nr->rsp || !nr->cmd) { 417 spin_unlock_irqrestore(&ndp->lock, flags); 418 return; 419 } 420 spin_unlock_irqrestore(&ndp->lock, flags); 421 | 413 unsigned long flags; 414 415 /* If the request already had associated response, 416 * let the response handler to release it. 417 */ 418 spin_lock_irqsave(&ndp->lock, flags); 419 nr->enabled = false; 420 if (nr->rsp || !nr->cmd) { 421 spin_unlock_irqrestore(&ndp->lock, flags); 422 return; 423 } 424 spin_unlock_irqrestore(&ndp->lock, flags); 425 |
426 if (nr->flags == NCSI_REQ_FLAG_NETLINK_DRIVEN) { 427 if (nr->cmd) { 428 /* Find the package */ 429 cmd = (struct ncsi_cmd_pkt *) 430 skb_network_header(nr->cmd); 431 ncsi_find_package_and_channel(ndp, 432 cmd->cmd.common.channel, 433 &np, &nc); 434 ncsi_send_netlink_timeout(nr, np, nc); 435 } 436 } 437 |
|
422 /* Release the request */ 423 ncsi_free_request(nr); 424} 425 426static void ncsi_suspend_channel(struct ncsi_dev_priv *ndp) 427{ 428 struct ncsi_dev *nd = &ndp->ndev; 429 struct ncsi_package *np = ndp->active_package; --- 1144 unchanged lines hidden --- | 438 /* Release the request */ 439 ncsi_free_request(nr); 440} 441 442static void ncsi_suspend_channel(struct ncsi_dev_priv *ndp) 443{ 444 struct ncsi_dev *nd = &ndp->ndev; 445 struct ncsi_package *np = ndp->active_package; --- 1144 unchanged lines hidden --- |