Ticket #1213: os_linux-lsraid_ioc-test.patch

File os_linux-lsraid_ioc-test.patch, 1.2 KB (added by Christian Franke, 6 years ago)

Patch for os_linux.cpp to do a minimal test of LSRAID_IOC_FIRMWARE

  • os_linux.cpp

     
    7878#include "utility.h"
    7979#include "cciss.h"
    8080#include "megaraid.h"
     81#define LSRAID_IOC_FIRMWARE _IOWR('R', 1, struct megasas_ocpacket)
    8182#include "aacraid.h"
    8283#include "nvmecmds.h"
    8384
     
    13211322  }
    13221323
    13231324  /* Open Device IOCTL node */
    1324   if ((m_fd = ::open("/dev/megaraid_sas_ioctl_node", O_RDWR)) >= 0) {
     1325  if ((m_fd = ::open("/dev/megaraid_swr_ioctl_node", O_RDWR)) >= 0) {
    13251326    pt_cmd = &linux_megaraid_device::megasas_cmd;
    13261327  }
    13271328  else if ((m_fd = ::open("/dev/megadev0", O_RDWR)) >= 0) {
     
    13301331  else {
    13311332    int err = errno;
    13321333    linux_smart_device::close();
    1333     return set_err(err, "cannot open /dev/megaraid_sas_ioctl_node or /dev/megadev0");
     1334    return set_err(err, "cannot open /dev/megaraid_swr_ioctl_node or /dev/megadev0");
    13341335  }
    13351336  set_fd(m_fd);
    13361337  return true;
     
    14481449  }
    14491450
    14501451  errno = 0;
    1451   int rc = ioctl(m_fd, MEGASAS_IOC_FIRMWARE, &uio);
     1452  int rc = ioctl(m_fd, LSRAID_IOC_FIRMWARE, &uio);
    14521453  if (pthru->cmd_status || rc != 0) {
    14531454    if (pthru->cmd_status == 12) {
    14541455      return set_err(EIO, "megasas_cmd: Device %d does not exist\n", m_disknum);